Skip to content

Commit

Permalink
updated the download part of the serverless app
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Oct 17, 2024
1 parent 80a99a3 commit 5bb897e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions bs/R/DoseResponse.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ DoseResponseServer <- function(id, data, listResults) {
})
req(length(indices) >= 1)
l <- listResults$all_data[indices]
if (Sys.getenv("RUN_MODE") == "BROWSER") {
if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
} else {
jsString <- createJSString(l)
session$sendCustomMessage(
type = "downloadZip",
Expand All @@ -136,9 +139,6 @@ DoseResponseServer <- function(id, data, listResults) {
FileContent = jsString
)
)
} else if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
}
})
})
Expand Down
8 changes: 4 additions & 4 deletions bs/R/assumption.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ assServer <- function(id, data, listResults) {
req(length(indices) >= 1)
l <- listResults$all_data[indices]

if (Sys.getenv("RUN_MODE") == "BROWSER") {
if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
} else {
jsString <- createJSString(l)
session$sendCustomMessage(
type = "downloadZip",
Expand All @@ -243,9 +246,6 @@ assServer <- function(id, data, listResults) {
FileContent = jsString
)
)
} else if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
}
})
})
Expand Down
8 changes: 4 additions & 4 deletions bs/R/correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ corrServer <- function(id, data, listResults) {
})
req(length(indices) >= 1)
l <- listResults$all_data[indices]
if (Sys.getenv("RUN_MODE") == "BROWSER") {
if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
} else {
jsString <- createJSString(l)
session$sendCustomMessage(
type = "downloadZip",
Expand All @@ -130,9 +133,6 @@ corrServer <- function(id, data, listResults) {
FileContent = jsString
)
)
} else if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
}
})
})
Expand Down
8 changes: 4 additions & 4 deletions bs/R/statisticalTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ testsServer <- function(id, data, listResults) {
})
req(length(indices) >= 1)
l <- listResults$all_data[indices]
if (Sys.getenv("RUN_MODE") == "BROWSER") {
if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
} else {
jsString <- createJSString(l)
session$sendCustomMessage(
type = "downloadZip",
Expand All @@ -275,9 +278,6 @@ testsServer <- function(id, data, listResults) {
FileContent = jsString
)
)
} else if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
}
})
})
Expand Down
8 changes: 4 additions & 4 deletions bs/R/visualisation.R
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ visServer <- function(id, data, listResults) {
})
req(length(indices) >= 1)
l <- listResults$all_data[indices]
if (Sys.getenv("RUN_MODE") == "BROWSER") {
if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
} else {
jsString <- createJSString(l)
session$sendCustomMessage(
type = "downloadZip",
Expand All @@ -285,9 +288,6 @@ visServer <- function(id, data, listResults) {
FileContent = jsString
)
)
} else if (Sys.getenv("RUN_MODE") == "SERVER") {
excelFile <- createExcelFile(l)
upload(session, excelFile, new_name = "Results.xlsx") # TODO: add possibility for desired file name
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion docs/app.json

Large diffs are not rendered by default.

0 comments on commit 5bb897e

Please sign in to comment.