Skip to content

Commit

Permalink
added system options to app info (function and ui output).
Browse files Browse the repository at this point in the history
  • Loading branch information
john-harrold committed Nov 21, 2023
1 parent 2cb6859 commit 3402638
Show file tree
Hide file tree
Showing 48 changed files with 223 additions and 136 deletions.
12 changes: 12 additions & 0 deletions R/ASM_Server.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,18 @@ ASM_Server <- function(id,

uiele = app_info[["uiele_packages"]]

uiele})
#------------------------------------
output$ui_asm_sys_options = renderUI({
state = ASM_fetch_state(id = id,
input = input,
session = session,
FM_yaml_file = FM_yaml_file,
MOD_yaml_file = MOD_yaml_file)
app_info = FM_fetch_app_info(session)

uiele = app_info[["uiele_options"]]

uiele})
#------------------------------------
# fileReaderData must be defined outside of the outputs below so it
Expand Down
27 changes: 24 additions & 3 deletions R/formods.R
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ user_dir}
#'@export
#'@title Adds Message to Log File and Displays it to the Console
#'@description Add the supplied txt and the module type to the log file and
#'display it to the console.
#'display it to the console.
#'@param state Module state after yaml read
#'@param entry Text to add
#'@param escape_braces Set to \code{TRUE} (default) to escape curly braces in the entry, set to \code{FALSE} to have the values interpreted.
Expand Down Expand Up @@ -890,9 +890,11 @@ NULL}
#' \itemize{
#' \item{uiele:} All system information as UI elements to be used in shiny apps.
#' \item{uiele_packages:} UI element for installed packages to be used in shiny apps.
#' \item{uiele_options:} UI element for current options.
#' \item{uiele_modules: } UI element for loaded formods modules to be used in shiny apps.
#' \item{msgs:} System information as text to be used in a report/terminal.
#' \item{si_packages} Dataframe with currently used packages.
#' \item{si_options} Dataframe with current options
#' }
#'@examples
#' # We need a Shiny session object to use this function:
Expand Down Expand Up @@ -975,9 +977,9 @@ FM_fetch_app_info <- function(session){
}
}
}

uiele = tagList(uiele, uiele_modules)

if(found_devtools){
si = devtools::session_info()
si_packages = si$packages
Expand All @@ -989,11 +991,30 @@ FM_fetch_app_info <- function(session){
}
}

si_opt_list = options()
si_options = NULL
uiele_options = NULL
for(oname in names(si_opt_list)){

value = deparse(si_opt_list[[oname]])
value = paste0(value, collapse = "\n")
si_options =
rbind(si_options,
data.frame(option = oname,
value = value ))
}


if(found_DT){
uiele_options = DT::datatable(si_options)
}

res = list(uiele = uiele,
uiele_packages = uiele_packages,
uiele_modules = uiele_modules ,
uiele_options = uiele_options ,
msgs = msgs,
si_options = si_options,
si_packages = si_packages)

res}
Expand Down
44 changes: 22 additions & 22 deletions docs/articles/included_modules.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/articles/making_modules.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pkgdown_sha: ~
articles:
included_modules: included_modules.html
making_modules: making_modules.html
last_built: 2023-11-13T16:00Z
last_built: 2023-11-21T01:58Z

5 changes: 5 additions & 0 deletions docs/reference/ASM_Server.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/reference/ASM_fetch_code.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/reference/ASM_fetch_dlfn.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/reference/ASM_fetch_state.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/reference/ASM_init_state.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/reference/ASM_test_mksession.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/reference/ASM_write_state.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3402638

Please sign in to comment.