How to disable/enable UI tab from UI

I want to disable / enable tabs in dependence on login. it is possible?


not currently - though @shrickus may be looking at a Pull Request that would allow disabling of tabs. Not sure how dynamic this would be and certainly not sure how it would tie into authentication given there is no user authentication support built in.

I've added two new properties on the ui_tab node -- disabled and hidden. I seem to remember there was a msg-based way to toggle the "collapsed" property of a ui_group, but can't recall how. Dave, would that same mechanism work for these new properties? Is there any code that would need to be implemented to "look" for those types of msg?

would need some changes to the ui-ui-control.js node to add the extra property(ies) and then also in main.js (around line 504) to grab them and do the right thing. Not sure it needs two properties as once disabled hide is redundant - so maybe just three states ?

Thanks for doing some of my homework for me...

Actually, I planned on allowing a disabled "page" to show up as non-selectable (greyed-out? lined-through? banned icon?) on the Nav menu. That would be a nice way to let someone know that there are other parts of the dashboard available, but they don't have access to them right now (e.g. they need to input an access code first).

1 Like

Oh, that reminds me... I'm also thinking that disabled pages not have their source included in the dashboard SPA. I can't see a good reason why any of their embedded code (css, js) should reach the browser, and potentially mess with other pages' rendering or behavior.

Oh. So disabled is just greyed out. Hidden is navigable but not in menu. So both would then be “really” not available ?

Right -- if you want to pretend it does not exist then both need to be set to "true".

yes. i want to show tabs after input password in keyboard tab and hidden keyboard tab

it is actually protection against undesirable visitors. turn off the tabs I want, and then turn them on after I sign in.

Sorry for bringing up an old thread, just wanted to ask:
this is currently not implemented, right?
I am looking for exactly the same functionality for "undesirable visitors", as Bambulko mentioned.

Correct it's not yet implemented (though a basic PR is now in place so work has commenced)... BUT this is not really something I could recommend for security as the end urls will still be available to all as soon as anyone logs in.

Independently on the logging is any chance to be done on the fly? I mean for instance to have a button on dashboard that I can configure so a tab is enabled/disabled, the purpose is to make dashboard to load more quick and disable a tab where I have some graphs so all move smoother and lighter to load but having the option at certain moment to enable it directly from same dashboard and allow it to load the data-

Thanks in advance

Yes the ui-control node can show and hide tabs, so you just need a button to send a msg and then trigger the ui-control node appropriately.

Thanks for your reply, so it means i a tab is hidden is not loaded all info on the explorer? so there is lighter to open?


(node-red v0.20.7, node-red-dashboard v2.15.5)

I have tried this: {"tab": {"disable": "Tab3"}}
{"tabs": {"disable": "Tab3"}}
But it is not working. Is there something I am missing?

Hello and thank you for all your advice available on this forum.
You said in 2018 that the possibility of deactivating a UI tab was not implemented (post: / 3848). Is this the case today?
If not, do you know of a way to prevent a user from accessing a hidden page even if they type the url directly in the browser?