Skip to content

Commit

Permalink
testing environment variable LOCAL for js
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Dec 18, 2024
1 parent 9d239d1 commit d0a0786
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 38 deletions.
49 changes: 30 additions & 19 deletions app/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,17 @@ app <- function() {
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
# uiOutput("conditional_data_ui"),
uf,
# uf,
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
)
),
tags$hr()
),
conditionalPanel(
Expand Down Expand Up @@ -371,24 +381,25 @@ app <- function() {
))
})

output$conditional_data_ui <- renderUI({
if (Sys.getenv("RUN_MODE") != "SERVER") {
res <- div(
class = "var-box-output",
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
)
)
)
return(res)
}
})
# TODO: not needed anymore?
# output$conditional_data_ui <- renderUI({
# if (Sys.getenv("RUN_MODE") != "SERVER") {
# res <- div(
# class = "var-box-output",
# conditionalPanel(
# condition = "input.conditionedPanels == 'Data'",
# fileInput("file", "Choose CSV File",
# accept = c(
# "text/csv",
# "text/comma-separated-values,text/plain",
# ".csv"
# )
# )
# )
# )
# return(res)
# }
# })

download_file <- reactive({
file <- download(session, "/home/shiny/results") # NOTE: from COMELN
Expand Down
49 changes: 30 additions & 19 deletions bs/R/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,17 @@ app <- function() {
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
# uiOutput("conditional_data_ui"),
uf,
# uf,
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
)
),
tags$hr()
),
conditionalPanel(
Expand Down Expand Up @@ -371,24 +381,25 @@ app <- function() {
))
})

output$conditional_data_ui <- renderUI({
if (Sys.getenv("RUN_MODE") != "SERVER") {
res <- div(
class = "var-box-output",
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
)
)
)
return(res)
}
})
# TODO: not needed anymore?
# output$conditional_data_ui <- renderUI({
# if (Sys.getenv("RUN_MODE") != "SERVER") {
# res <- div(
# class = "var-box-output",
# conditionalPanel(
# condition = "input.conditionedPanels == 'Data'",
# fileInput("file", "Choose CSV File",
# accept = c(
# "text/csv",
# "text/comma-separated-values,text/plain",
# ".csv"
# )
# )
# )
# )
# return(res)
# }
# })

download_file <- reactive({
file <- download(session, "/home/shiny/results") # NOTE: from COMELN
Expand Down

0 comments on commit d0a0786

Please sign in to comment.