Closed ferguskeatinge closed 3 years ago
Currently, this is only doable in CSS by adding in your UI something like :
tags$style(
"[tooltip]:before {left: 110% !important; right: auto !important}",
".container-fab {right: auto !important; left: 0 !important;}"
)
Logout button will appear on left.
Full example:
credentials <- data.frame(
user = c("shiny", "shinymanager"),
password = c("123", "456"),
stringsAsFactors = FALSE
)
library(shiny)
library(shinymanager)
ui <- fluidPage(
tags$head(
# Tooltip bouton shinymanager
tags$style(
"[tooltip]:before {left: 110% !important; right: auto !important}",
".container-fab {right: auto !important; left: 0 !important;}"
)
),
tags$h2("My secure application"),
verbatimTextOutput("auth_output")
)
# Wrap your UI with secure_app
ui <- secure_app(ui)
server <- function(input, output, session) {
res_auth <- secure_server(
check_credentials = check_credentials(credentials)
)
output$auth_output <- renderPrint({
reactiveValuesToList(res_auth)
})
# your classic server logic
}
shinyApp(ui, server)
@pvictor How do I position the FAB button on the top right corner?
Not currently possible, we have to re-write the fab button functionnality. I'll let you know
@howardbaek Thanks for asking this question ! I would like to do the same thing.
@pvictor Thanks for the response, this would be a wonderful addition !
If you re-install from GitHub, there's a new argument fab_position
in secure_app
to specify FAB button position. Example:
credentials <- data.frame(
user = c("shiny", "shinymanager"),
password = c("123", "456"),
stringsAsFactors = FALSE
)
library(shiny)
library(shinymanager)
ui <- fluidPage(
tags$h2("My secure application"),
verbatimTextOutput("auth_output")
)
# Wrap your UI with secure_app
ui <- secure_app(ui, fab_position = "top-right") # <- set position of FAB button here
server <- function(input, output, session) {
res_auth <- secure_server(
check_credentials = check_credentials(credentials)
)
output$auth_output <- renderPrint({
reactiveValuesToList(res_auth)
})
# your classic server logic
}
shinyApp(ui, server)
Victor
Any way to move the location of the floating action logout/admin button?
Thanks.