diff --git a/R/appServer.R b/R/appServer.R index ad9718c..f3cdb99 100644 --- a/R/appServer.R +++ b/R/appServer.R @@ -15,6 +15,51 @@ appServer <- function(input, output, session) { caller = "norgast" ) + output$tabeller <- shiny::renderTable({ + query <- paste0("SELECT table_name FROM information_schema.tables + WHERE table_schema = '", Sys.getenv("MYSQL_DB_DATA"), "';") + tabell <- try(rapbase::loadRegData("data", query, "mysql"), TRUE) + }) + + # Environment + output$user <- shiny::renderText({ + paste("rapbase::getUserName(session):", + user$name()) + }) + output$group <- shiny::renderText({ + paste("rapbase::getUserGroups(session):", + user$group()) + }) + output$resh_id <- shiny::renderText({ + paste("rapbase::getUserReshId(session):", + user$org()) + }) + output$role <- shiny::renderText({ + paste("rapbase::getUserRole(session):", + user$role()) + }) + output$database <- shiny::renderText({ + Sys.getenv("MYSQL_DB_DATA") + }) + output$full_name <- shiny::renderText({ + paste("rapbase::getUserFullName(session):", + user$name()) + }) + output$instance <- shiny::renderText({ + Sys.getenv("R_RAP_INSTANCE") + }) + output$config_path <- shiny::renderText({ + Sys.getenv("R_RAP_CONFIG_PATH") + }) + output$sp_usergroups <- shiny::renderText({ + paste("Sys.getenv('SHINYPROXY_USERGROUPS'):", + Sys.getenv("SHINYPROXY_USERGROUPS")) + }) + output$locale <- shiny::renderText({ + Sys.getlocale() + }) + + # RegData <- norgast::NorgastHentRegData() # skjemaoversikt <- norgast::NorgastHentskjemaoversikt() # skjemaoversikt$HovedDato <- as.Date(skjemaoversikt$HovedDato) diff --git a/R/appUi.R b/R/appUi.R index 1a6e567..d489138 100644 --- a/R/appUi.R +++ b/R/appUi.R @@ -26,7 +26,28 @@ appUi <- function() { rapbase::navbarWidgetInput("navbar-widget", selectOrganization = TRUE), norgast::startside_UI("startside") - )#, + ), + + shiny::tabPanel( + "debugging", + shiny::h4("Test 'rapbase' functions using the session object:"), + shiny::textOutput("user"), + shiny::textOutput("group"), + shiny::textOutput("resh_id"), + shiny::textOutput("role"), + shiny::textOutput("full_name"), + shiny::h4("Environment var R_RAP_INSTANCE:"), + shiny::textOutput("instance"), + shiny::h4("Environment var R_RAP_CONFIG_PATH:"), + shiny::textOutput("config_path"), + shiny::h4("Environment var(s) provided by SHINYPROXY (if any):"), + shiny::textOutput("sp_usergroups"), + shiny::h4("Locale settings:"), + shiny::textOutput("locale"), + shiny::h4("Database og tabeller:"), + shiny::textOutput("database"), + shiny::tableOutput("tabeller") + ) # shiny::tabPanel( # "Fordelinger",