diff --git a/Dockerfile b/Dockerfile index 8284d59..e9e0390 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ RUN apt-get update -y && apt-get install -y libssh-dev python3-pip git libmariad RUN R -q -e 'install.packages(c("ellipsis"), repos="https://cran.rstudio.com/")' RUN R -q -e 'install.packages(c("shiny"), repos="https://cran.rstudio.com/")' -RUN R -q -e 'install.packages(c("shinyFeedback", "shinyWidgets", "shinydashboard", "shinydashboardPlus", "ssh", "remotes", "markdown", "lubridate", "jsonlite", "dplyr", "DT", "glue", "httr", "purrr", "RColorBrewer", "rlang", "shinyBS", "shinyjs", "tidyverse", "uuid", "memoise", "rclipboard", "shinyvalidate", "shinylogs", "testhat", "bsicons", "listviewer", "htmltools", "cookies", "RMariaDB", "DBI", "parsedate", "testthat", "shinylogs", "ids"), repos="https://cran.r-project.org")' +RUN R -q -e 'install.packages(c("shinyFeedback", "shinyWidgets", "shinydashboard", "shinydashboardPlus", "ssh", "remotes", "markdown", "lubridate", "jsonlite", "dplyr", "DT", "glue", "httr", "purrr", "RColorBrewer", "rlang", "shinyBS", "shinyjs", "tidyverse", "uuid", "memoise", "rclipboard", "shinyvalidate", "shinylogs", "testhat", "bsicons", "listviewer", "htmltools", "cookies", "RMariaDB", "DBI", "parsedate", "testthat", "shinylogs", "ids", "shinycssloaders"), repos="https://cran.r-project.org")' RUN R -q -e "remotes::install_github('getwilds/proofr@v0.3.0')" diff --git a/app/about.md b/app/about.md index 53a2814..dad4112 100644 --- a/app/about.md +++ b/app/about.md @@ -1,5 +1,7 @@ -### Resources +### Getting Help with PROOF and WDL at Fred Hutch - Get started with PROOF [How-To documentation](https://sciwiki.fredhutch.org/dasldemos/proof-how-to/) and [troubleshooting tips](https://sciwiki.fredhutch.org/dasldemos/proof-troubleshooting/) +- Ask a question about or report a problem with PROOF in our [GitHub repository](https://github.com/getwilds/proof/issues/new?template=Blank+issue) +- Email us at [wilds@fredhutch.org](mailto:wilds@fredhutch.org) - Find curated WDL workflow repositories and containers in Fred Hutch [DaSL's getWILDS GitHub organization](https://github.com/orgs/getwilds/repositories?q=wdl). - Find Cromwell and WDL Resources in [Fred Hutch's GitHub organization](https://github.com/FredHutch?utf8=%E2%9C%93&q=wdl+OR+cromwell&type=&language=). - Learn about Cromwell and WDL on the [Fred Hutch Biomedical Data Science Wiki](https://sciwiki.fredhutch.org/compdemos/Cromwell/). @@ -10,7 +12,7 @@ ## Users Elsewhere This Shiny app and the R packages it relies on are all open source. Thus, if you are at a different institution and want to use this application to support your work or your users, we encourage you to look through our resources and fork our repositories. Feel free to contact DaSL developers by filing issues or emailing `wilds@fredhutch.org`. For this use case, we have provided the more general "DIY Cromwell" login button at the top. -### Resources +### Some Resources for Using Cromwell - DIY: Get a Cromwell server running by yourself (does not require logging in). To learn more about how to get your Cromwell server running, read through the instructions in the GitHub repo [FredHutch/diy-cromwell-server](https://github.com/FredHutch/diy-cromwell-server) - `rcromwell`: An [R package](https://github.com/getwilds/rcromwell) that makes interacting with the Cromwell API easier. - `shiny-cromwell`: This app's [GitHub repo](https://github.com/FredHutch/shiny-cromwell) contains information on how to set started with this application. diff --git a/app/buttons.R b/app/buttons.R index 1f2fc9f..19bef6c 100644 --- a/app/buttons.R +++ b/app/buttons.R @@ -2,7 +2,8 @@ logInButton <- actionButton( inputId = "proofAuth", label = "PROOF Login", - class = "btn-sm", + class = "btn-success btn-sm", + style = "color: white;", icon = icon("truck-fast") ) @@ -20,6 +21,7 @@ logInCromwellButton <- inputId = "ownCrom", label = "DIY Cromwell", class = "btn-sm", + style = "color: white;", icon = icon("plug-circle-xmark") ) logOutCromwellButton <- diff --git a/app/modals.R b/app/modals.R index 464e939..9ee890f 100644 --- a/app/modals.R +++ b/app/modals.R @@ -13,7 +13,11 @@ loginModal <- function(failed = FALSE, error = "Invalid username or password") { }, footer = tagList( modalButton("Cancel"), - actionButton("submit", "Submit") + shinyFeedback::loadingButton( + inputId = "submit", + label = "Submit", + class = "btn btn-default" + ) ), easyClose = TRUE ) diff --git a/app/server.R b/app/server.R index 2167472..eb83f54 100644 --- a/app/server.R +++ b/app/server.R @@ -26,6 +26,7 @@ library(rcromwell) library(cookies) library(listviewer) +library(rclipboard) library(ids) @@ -41,7 +42,6 @@ source("cookies-db.R") SANITIZE_ERRORS <- FALSE PROOF_TIMEOUT <- 20 -FOCUS_ID <- 1 SHINY_LOGGING <- as.logical(Sys.getenv("SHINY_LOG", FALSE)) # FIXME: maybe remove later, was running into some timeouts during testing @@ -57,14 +57,35 @@ server <- function(input, output, session) { session$allowReconnect(TRUE) - # Upper right github icon for source code - output$gitHtml <- renderText({ - glue('Code: FredHutch/shiny-cromwell -
- Built from: {substring(COMMIT_SHORT_SHA, 1, 7)} -
- Last built on: {stamp("Mar 1, 1999", quiet = TRUE)(ymd_hms(COMMIT_TIMESTAMP))} - ') + # For the Help page + output$gitHtml <- renderUI({ + div( + tags$span( + tags$b("Code:"), + tags$a( + "FredHutch/shiny-cromwell", + href = glue("https://github.com/FredHutch/shiny-cromwell/tree/{COMMIT_BRANCH}"), + target="_blank" + ) + ), + tags$br(), + tags$span( + tags$b("Built from:"), + tags$a( + glue("{substring(COMMIT_SHORT_SHA, 1, 7)}"), + href = glue("https://github.com/FredHutch/shiny-cromwell/tree/{COMMIT_SHA}"), + target="_blank" + ) + ), + tags$br(), + tags$span( + tags$b('Last built on:', style = "display:inline;"), + tags$p( + glue('Last built on: {stamp("Mar 1, 1999", quiet = TRUE)(ymd_hms(COMMIT_TIMESTAMP))}'), + style = "display:inline;" + ) + ) + ) }) rv <- reactiveValues(token = "", url = "", validateFilepath="", own = FALSE, user = "") @@ -76,8 +97,7 @@ server <- function(input, output, session) { inputJSON_state = NULL, input2JSON_state = NULL, workOptions_state = NULL, - abortWorkflowID_state = NULL, - troubleWorkflowID_state = NULL + abortWorkflowID_state = NULL ) # Login and UI component handling @@ -164,6 +184,9 @@ server <- function(input, output, session) { same_site = "strict" ) + # reset loading spinner + shinyFeedback::resetLoadingButton("submit") + removeModal() } } else { @@ -286,6 +309,14 @@ server <- function(input, output, session) { } }) + observe({ + if (proof_loggedin_serverup(rv$url, rv$token)) { + shinyjs::toggleState("cromwellStart", + proof_status(token = rv$token)$jobStatus != "RUNNING" + ) + } + }) + # Disable or enable the Delete button for deleting proof server observeEvent(input$cromwellDelete, { showModal(verifyCromwellDeleteModal()) @@ -334,7 +365,7 @@ server <- function(input, output, session) { cromwellProofStatusData <- reactivePoll(2000, session, checkFunc = function() { if (!is.null(input$tabs)) { - if (input$tabs != "cromwell") return(NULL) + if (input$proof != "Server") return(NULL) } if (proof_loggedin(rv$token)) { tmp <- proof_status(token = rv$token) @@ -351,6 +382,7 @@ server <- function(input, output, session) { proofStatusTextGenerator <- function(name, list_index, tip = "", value_if_null = NULL) { renderUI({ if (proof_loggedin(rv$token)) { + dat <- cromwellProofStatusData() if (nzchar(tip)) { tags$span( bslib::tooltip( @@ -360,7 +392,7 @@ server <- function(input, output, session) { ), HTML(paste0( strong(glue("{name}: ")), - purrr::flatten(cromwellProofStatusData())[[list_index]] %||% value_if_null + purrr::flatten(dat)[[list_index]] %||% value_if_null )) ) } else { @@ -368,7 +400,7 @@ server <- function(input, output, session) { icon("question-circle"), HTML(paste0( strong(glue("{name}: ")), - purrr::flatten(cromwellProofStatusData())[[list_index]] %||% value_if_null + purrr::flatten(dat)[[list_index]] %||% value_if_null )) ) } @@ -478,6 +510,7 @@ server <- function(input, output, session) { url = rv$url, token = rv$token ) + shinyjs::disable("submitWorkflow") HTML(glue('