Skip to content

Commit 5f51505

Browse files
authored
Update website banner (#36)
* Update website banner * Update queue and estimated time message
1 parent 5d7ac55 commit 5f51505

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

kvfinder-web-portal/R/mod_server_submitJob.R

+11-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ submit_job <- function(input, output, pdb_name_click_load, url_address, session)
4040
# Just another check if user uploaded a PDB or fetched a PDB ID before to submit
4141
} else if (length(input$pdb_id) > 0 & input$send_pdb_id == 0 & input$input_type != "pdb_from_file") {
4242
shinyWidgets::sendSweetAlert(session = session, title = "Oops!", text = "Please load from PDB or upload a PDB file before to submit.", type = "error")
43-
} else if (removal_dist_input == 0 & vol_cutoff_input ==0) {
43+
} else if (removal_dist_input == 0 & vol_cutoff_input == 0) {
4444
shinyWidgets::sendSweetAlert(session = session, title = "Oops!", text = "Removal distance and volume cutoff cannot be zero at the same time.", type = "error")
4545
} else {
4646
# if pass through the above checks...
@@ -85,33 +85,35 @@ submit_job <- function(input, output, pdb_name_click_load, url_address, session)
8585
if (post_output$status_code == 200) { # job is running successfully
8686
# get ID of the submitted job
8787
get_run_id <<- content(post_output)$id
88-
# get queue size
88+
# get queue size
8989
get_queue <- content(post_output)$queue_size
90-
if(is.null(get_queue)){
91-
get_queue = -1 #if the job was already ran and does not go to the queue, the queue_size doens't exist
90+
if (is.null(get_queue)) {
91+
get_queue <- -1 # if the job was already ran and does not go to the queue, the queue_size doens't exist
9292
} else {
93-
get_queue = as.numeric(get_queue)
93+
get_queue <- as.numeric(get_queue)
9494
}
95-
if(get_queue > 0){ #if there are other jobs in queue
95+
if (get_queue > 0) { # if there are other jobs in queue
9696
# Show submission message
97+
minutes <- ifelse(ceiling((get_queue + 1) * 10 / 60) > 1, " minutes", " minute")
9798
output$run_id <- renderText({
9899
paste(
99100
br(),
100101
p("Your job has been successfully submitted to the KVFinder-web server!"),
101102
p("Please save the following job ID: ", tags$b(get_run_id), "to check your results later."),
102-
p("Your job is ", tags$b(get_queue) ," in the queue and the estimated time is ", tags$b(ceiling(((get_queue+1)*10)/60)) ," min."),
103+
p("Your job is currently in position", tags$b(get_queue + 1), " in the queue and the estimated time is ", tags$b(ceiling(((get_queue + 1) * 10) / 60)), minutes, "."),
103104
p("Once the job is completed, the results will be available for 1 day."),
104105
p("\u26A0\ufe0f Warning: KVFinder-web portal is a single-page application. Please do not reload this page or you will lose your progress.")
105106
)
106107
})
107-
} else if(get_queue == 0) {
108+
} else if (get_queue == 0) {
108109
# Show submission message
110+
minutes <- ifelse(ceiling((get_queue + 1) * 10 / 60) > 1, " minutes", " minute")
109111
output$run_id <- renderText({
110112
paste(
111113
br(),
112114
p("Your job has been successfully submitted to the KVFinder-web server!"),
113115
p("Please save the following job ID: ", tags$b(get_run_id), "to check your results later."),
114-
p("The estimated time of your job is ", tags$b(ceiling(((get_queue+1)*10)/60)) ," min."),
116+
p("Your job is currently in position", tags$b(get_queue + 1), " in the queue and the estimated time is ", tags$b(ceiling(((get_queue + 1) * 10) / 60)), minutes, "."),
115117
p("Once the job is completed, the results will be available for 1 day."),
116118
p("\u26A0\ufe0f Warning: KVFinder-web portal is a single-page application. Please do not reload this page or you will lose your progress.")
117119
)
39.4 KB
Loading

0 commit comments

Comments
 (0)