Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

194 feature support multiple application in analytics app #195

Merged
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ cran-comments.md
CRAN-SUBMISSION
^docs$
^CRAN-SUBMISSION$
.devcontainer
44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
averissimo marked this conversation as resolved.
Show resolved Hide resolved
"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"
}
}
}
}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", role = c("aut", "cre")),
person("Kamil", "Żyła", , "[email protected]", role = "aut"),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions R/analytics-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
)
)
)
Expand Down
18 changes: 17 additions & 1 deletion R/prepare-admin-panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,30 @@ 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(
as.Date(input$date_from), as.Date(input$date_to)
)
})

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())
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ replicaSet
scalable
ssl
tabset
dropdown
Loading