refactor: push all global vars to globla options

This commit is contained in:
2026-06-16 15:40:46 +03:00
parent df740c4f71
commit 4c50473c7e
2 changed files with 26 additions and 30 deletions

View File

@@ -1,6 +1,13 @@
.on_load = function(ns) {
check_and_init_scheme()
# set global settings:
set_global_options(
shiny.host = "0.0.0.0",
shiny.port = 1338,
APP.DEBUG = FALSE
)
}
@@ -8,9 +15,6 @@
#' @description костыли для упрощения работы себе
set_global_options = function(
SYMBOL_DELIM = "; ",
APP.DEBUG = FALSE,
# shiny.host = "127.0.0.1",
# shiny.port = 1338,
...
) {
@@ -33,17 +37,21 @@ set_global_options = function(
options(
SYMBOL_DELIM = SYMBOL_DELIM,
# form.db_path = config::get("form_db_path"),
APP.DEBUG = APP.DEBUG,
# shiny.host = shiny.host,
# shiny.port = shiny.port,
...
)
}
# global vars ------------------------------------
#' @export
AUTH_ENABLED <- config::get("form_auth_enabled")
#' @export
#' TODO: нормальный разворот
ENABLED_SCHEMES <- unlist(config::get()$form_schemes)
ENABLED_SCHEMES <- stats::setNames(names(ENABLED_SCHEMES), ENABLED_SCHEMES)
# -------------------------------------------------
#' @export
check_and_init_scheme = function() {