# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) #https://gist.github.com/jcheng5/3830244757f8ca25d4b00ce389ea41b3 withConsoleRedirect <- function(containerId, expr) { # Change type="output" to type="message" to catch stderr # (messages, warnings, and errors) instead of stdout. txt <- capture.output(results <- expr, type = "output") if (length(txt) > 0) { insertUI(paste0("#", containerId), where = "beforeEnd", ui = paste0(txt, "\n", collapse = "") ) } results } # Define UI for application that draws a histogram ui <- fluidPage( # Application title titlePanel("Update SVN"), actionButton("update","Update from SVN repository"), pre(id="console"), tags$ul( tags$li(tags$a(href="../index.html","Main Index")), tags$li(tags$a(href="../Bayesian/index.Rmd","Bayesian")), tags$li(tags$a(href="../EDA/index.Rmd","Exploratory Data Analysis")), tags$li(tags$a(href="../RIntro/index.Rmd","R Group Presentations")), tags$li(tags$a(href="../IntroStats/index.Rmd","Intro Stats Index"))) ) # Define server logic required to draw a histogram server <- function(input, output) { observeEvent(input$update, { status <- system("/www1/shiny-server/updateRshiny",intern = TRUE) insertUI("#console",ui=paste(status,collapse="\n")) system2("touch",file.path("/www1/shiny-server", c("Bayesian","IntroStats","EDA","RIntro"), "index.Rmd")) showNotification("Update Complete.\n") # insertUI("#console",ui=paste(log.txt)) }) } # Run the application shinyApp(ui = ui, server = server)