Compare commits

...

2 Commits

6 changed files with 29 additions and 8 deletions

View File

@@ -1 +1,21 @@
source("renv/activate.R")
(function() {
paths <- c(
"FORM_AUTH_ENABLED",
"FORM_VERSION",
"FORM_TITLE"
)
lines <- paths[Sys.getenv(paths) == ""]
if (length(lines) > 0) {
cli::cli_h3("Настройка путей окружения")
cli::cli_code(paste0(lines, "="))
cli::cli_inform(c(
"i" = "Для нормальной работы скриптов добавьте в {.file .Renviron}:"
))
}
})()

10
app.R
View File

@@ -118,9 +118,9 @@ server <- function(input, output, session) {
if (AUTH_ENABLED) {
reactiveValuesToList(res_auth)
if (res_auth$admin) {
print("admin")
# print("admin")
} else {
print("not_admin")
# print("not_admin")
showing_buttons <- FALSE
}
}
@@ -234,8 +234,8 @@ server <- function(input, output, session) {
) {
nested_key_id <- mhcs()$get_key_id(table_name)
input_types <- unname(id_and_types_list)
input_ids <- names(id_and_types_list)
input_types <- unname(id_and_types_list)
input_ids <- names(id_and_types_list)
if (missing(ns)) ns <- NULL
@@ -1138,7 +1138,7 @@ server <- function(input, output, session) {
append = TRUE
)
message <- glue::glue("Данные таблицы '{table_name}' успешно обновлены")
message <- glue::glue("Данные таблицы '{table_name}' успешно обновлены (добавлено {nrow(df)} записей)")
showNotification(
message,
type = "message"

View File

@@ -5,7 +5,7 @@ set_global_options = function(
APP.DEBUG = FALSE,
# APP.FILE_DB = fs::path("data.sqlite"),
shiny.host = "127.0.0.1",
shiny.port = 1337,
shiny.port = 1338,
...
) {
options(

View File

@@ -263,7 +263,8 @@ update_forms_with_data = function(
local_delimeter = getOption("SYMBOL_DELIM"),
ns
) {
options(box.path = here::here())
box::use(modules/data_manipulations[is_this_empty_value])
# print("-----------------")

View File

@@ -3,7 +3,7 @@
# SETUP AUTH =============================
# Init DB using credentials data
credentials <- data.frame(
user = c("admin", "user"),
user = c("admin", "user"),
password = c("admin", "user"),
# password will automatically be hashed
admin = c(TRUE, FALSE),