Dashboard access tab by name instead of id

Hello everybody!

I know I can access my dashboard with localhost:1880/ui/!#/ and I can access a specific tab by attaching its id at the end.

What I'd like to do: access a tab by its name, so that I don't have to adjust my bookmarks everytime I play around with node-red and adding/removing tabs. I know this might be ambiguous if two or more tabs have the same name, but that can be avoided by the user.

A work-around I found: use localhost:1880/ui/!#/0?tab=Home and evaluate in a function node:

if (msg.payload === "change") {
    if (msg.tab === 0) {
        return msg.params;
    }
    else {
        return [];
    }
}

If the output is fed into a ui_control node, it will jump to the named tab. But the params object is not removed and even a subsequent call of localhost:1880/ui/!#/0 will jump to the tab named "Home"...

Is there a solution to this? Or is there even a better solution for my desire? Thanks in advance!

2 Likes

Seems like a reasonable request -- but I cannot speak to whether the code supports that.

What I have done when I need to control the UI pages is to either

  1. create an http in with the named endpoint, then render and return the page to be displayed
  2. install node-red-contrib-uibuilder and set up my own dirs/files for the pages in my app

I realize these are probably not good answers for you, since it sounds like you already have a dashboard solution in place -- but just in case you had not looked at using uibuilder, there ya go...

Thank you, Steve!

I think I will give your first method a try. The second one is a little bit too much for me. I'm struggling enough to make my flows work. And I'm very happy to have a simple yet sufficient dashboard set up that works :grinning:

Nevertheless, maybe my idea is worth thinking about

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.