library(shiny)
library(shinyFiles)
library(qrmarkdown)
# Define UI for application that draws a histogram
ui <- shinyUI(bootstrapPage(
tags$h2("qrmarkdown"),
tags$hr(),
tabsetPanel(
type = "tabs",
tabPanel(
"Summary",
tableOutput("myqueue"),
actionButton("button_update", "Update")
),
tabPanel(
"Workflow",
tags$h1("Job"),
fileInput("file_rmd", "Choose Rmd File",
accept = c("rmarkdown/rmd")),
shinyFilesButton('files', 'File select', 'Please select a file', FALSE),
shinyDirButton('folder', label = 'select output dir',
title = 'output dir')
),
tabPanel("Schedule", tableOutput("table"))
) # tab
))
# Define server logic required to draw a histogram
server <- function(input, output) {
q.wd('.log')
myqueue <- q.show()
file_rmd <- reactive({
input$file_rmd
})
observeEvent(input$button_update,
{
output$myqueue <- renderTable({
q.show()
})
})
output$myqueue <- renderTable({
myqueue
})
shinyFileChoose(input, 'files', roots=c(wd='.'), filetypes=c('', 'txt'),
defaultPath='', defaultRoot='wd')
observe({
shinyDirChoose(input, 'folder',
roots=c(wd=.pkg.log$log.dir),
filetypes=c('rmd'))
print(input$folder)
})
}
# Run the application
shinyApp(ui = ui, server = server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.