diff --git a/.Rbuildignore b/.Rbuildignore index ed0d1e24..bc93f253 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -16,3 +16,4 @@ cran-comments.md CRAN-SUBMISSION ^docs$ ^CRAN-SUBMISSION$ +.devcontainer diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..90d126a1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,44 @@ +{ + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/rocker-org/devcontainer-features/r-rig:latest": { + "version": "release", + "vscodeRSupport": "languageserver", + "installRadian": true, + "installDevTools": true + }, + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "libpq-dev" + }, + "ghcr.io/rocker-org/devcontainer-features/r-dependent-packages:0": {}, + "ghcr.io/rocker-org/devcontainer-features/rstudio-server:0": { + "version": "daily" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "forwardPorts": [ + 8787 + ], + "portsAttributes": { + "8787": { + "label": "RStudio IDE" + } + }, + "remoteEnv": { + "PKG_SYSREQS": "true", + "RENV_CONFIG_PAK_ENABLED": "TRUE" + }, + "customizations": { + "vscode": { + "extensions": [ + "REditorSupport.r", + "github.copilot" + ], + "settings": { + "r.rterm.linux": "/usr/local/bin/radian", + "git.confirmSync": false, + "workbench.settings.editor": "json" + } + } + } +} \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 51474988..9d5dddb1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: shiny.telemetry Title: 'Shiny' App Usage Telemetry -Version: 0.3.1 +Version: 0.3.1.9001 Authors@R: c( person("André", "Veríssimo", , "opensource+andre@appsilon.com", role = c("aut", "cre")), person("Kamil", "Żyła", , "kamil@appsilon.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index c56e0d45..621477a8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# shiny.telemetry 0.3.1.9001 + +### New Features + +- Added a dropdown to the `analytics_app()` to switch between applications. + # shiny.telemetry 0.3.1 ### New Features diff --git a/R/analytics-app.R b/R/analytics-app.R index aef77e6c..cbd797e9 100644 --- a/R/analytics-app.R +++ b/R/analytics-app.R @@ -65,6 +65,13 @@ analytics_ui <- function() { "download_data", "Download", style = "margin-left: 2em;" ) ) + ), + semantic.dashboard::menuItem( + shiny.semantic::selectInput( + inputId = "app_name", + label = shiny::tags$label("Application name", shiny.semantic::icon("laptop")), + choices = character() + ) ) ) ) diff --git a/R/prepare-admin-panel.R b/R/prepare-admin-panel.R index 6ad94040..b1e243ac 100644 --- a/R/prepare-admin-panel.R +++ b/R/prepare-admin-panel.R @@ -168,7 +168,7 @@ prepare_admin_panel_components <- function( hour_levels <- c("12am", paste0(1:11, "am"), "12pm", paste0(1:11, "pm")) - log_data <- shiny::reactive({ + full_log_data <- shiny::reactive({ shiny::req(input$date_from, input$date_to) data_storage$read_event_data( @@ -176,6 +176,22 @@ prepare_admin_panel_components <- function( ) }) + shiny::observeEvent(full_log_data(), { + applications <- sort(unique(full_log_data()$app_name)) %||% character(0L) + shiny.semantic::update_dropdown_input( + session = session, + input_id = "app_name", + choices = applications, + value = applications[1] + ) + }) + + log_data <- shiny::reactive({ + shiny::req(input$app_name) + full_log_data() %>% + dplyr::filter(.data$app_name == input$app_name) + }) + is_log_empty <- shiny::reactive(nrow(shiny::req(log_data())) == 0) output$filters <- shiny::renderUI(date_filters()) diff --git a/inst/WORDLIST b/inst/WORDLIST index 92b32617..ea2351ab 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -20,3 +20,4 @@ replicaSet scalable ssl tabset +dropdown