I would like to upload a basic shiny app in the web (somewhere free) with say five tabs, but i want users to see only 4 of them, the last one is the metrics of the app only for my internal use. Then how can it be invisible to users but not to me?
You should add a simple login widget (passwordInput) and upon entering the correct password, the fifth tab can be made visible. It would also require you to create the ui for the fifth tab on the server side so that it appears conditionally.
The tab will appear in the tab list even if the page has not been "unlocked" by the password. Does the hidden content that is rendered in the server's renderUI() show before the password is entered?
once the password is entered, nothing happens
This might require more information on what your implemented code looks like (with all the sensitive content removed) to diagnose.
the password is required at every tab but directed for tab3 only
In the example, the password field is outside of the tabsetPanel()and therefore appears independently of what tab is currently selected. This is a valid implementation but may not match what you envision for the design.
If you prefer the password field to only appear in the relevant tab, simply move the password field to be inside that tab.
ui = fluidPage(
tabsetPanel(
tabPanel(
title = 'tab1',
h1('This is tab 1')
),
tabPanel(
title = 'tab2',
h1('This is tab 2')
),
tabPanel(
title = 'tab3',
passwordInput(
inputId = 'pwd',
label = 'Enter password'
),
uiOutput('uiTab3')
)
)
)
If you want the password field to also disappear after the correct password is entered, you'll need to either hide the password field element using JavaScript/shinyJS, or have the password field rendered by the renderUI when the correct password has not yet been entered.