library(shiny)
library(shinydashboard)
# UI----------------------------------------------------------------------------
ui <- dashboardPage(
title = "Test Local App Config",
dashboardHeader(title = "Local App Config"),
dashboardSidebar(
sidebarMenu(id = "sidebarmenu",
menuItem("Main", tabName = "main", icon = icon("dashboard")
) ## end sidebarMenu
) ## end dashboardSidebar
),
# UI Body --------------------------------------------------------------------
dashboardBody(
tabItems(
tabItem(tabName = "main",
fluidRow(
column(width = 6,
box(
title = "Sys.info()",
status = "primary",solidHeader = TRUE,width = NULL,
shiny::tableOutput("info")
),
box(
title = ".libPaths()",
status = "primary",solidHeader = TRUE,width = NULL,
shiny::tableOutput("libpaths")
),
box(
title = "Sys.getenv()",
status = "primary",solidHeader = TRUE,width = NULL,
shiny::tableOutput("getenv")
)
),
column(width = 6,
box(
title = "Packages",
status = "primary",solidHeader = TRUE,width = NULL,
shiny::tableOutput("packages")
))
)
) ## end tabItem "main"
) ## end tabItems
) ## end dashboardBody
) ## end dashboardPage
# Server ------------------------------------------------------------------------
server <- function(input,output){
output$info <- renderTable({
data.frame(Variable = names(Sys.info()),
Value = as.character(Sys.info()))
})
output$libpaths <- renderTable({
data.frame(Paths = as.character(.libPaths()))
})
output$getenv <- renderTable({
data.frame(Variable = names(Sys.getenv()),
Value = as.character(Sys.getenv()))
})
output$packages <- renderTable({
data.frame(installed.packages())[,.(Package,Version,Built,LibPath)]
})
}
shinyApp(ui = ui, server = server)