Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthon committed Nov 14, 2024
1 parent c97ff4c commit 1cd39d7
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
45 changes: 45 additions & 0 deletions R/appServer.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 22 additions & 1 deletion R/appUi.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1cd39d7

Please sign in to comment.