refactor: push all global vars to globla options
This commit is contained in:
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user