List of dashboard tab names

356 views
Skip to first unread message

David Harpe

unread,
Aug 24, 2017, 2:31:52 PM8/24/17
to Node-RED UI
Hi everyone,

I have a simple system status application where I have several UI dashboards on different tabs and I'd like to cycle through each tab at a preset interval.  I have been successful in doing this with a message node on repeat, a function and the UI Control node. All of that works great so main mission accomplished, but I'd like to make it better/more flexible.

Currently the way I do it is the function node has a hand-coded list of tab names to pass to UI Control. What I'd like to do is grab a list of tab names from somewhere and avoid the hardcoding part. Then I could drop this flow into any application where I need to cycle through all of the dashboard tabs.

Does dashboard expose a list of dashboard tabs in a property somewhere? If so, where?  Is there a list somewhere of everything that dashboard exposes?

Sorry if this is an obvious question...

Thanks,

Dave

steve rickus

unread,
Aug 28, 2017, 5:02:35 PM8/28/17
to Node-RED UI
This is not an obvious question -- it's a good one that I've wondered about, as well. Time to build a flow...

Here's a bit of an ugly hack of an idea... use an http-request node to get the current flow definitions, and filter out only the ui_tab nodes:


From this array of ui_tab nodes, you should be able to build a dynamic list of tabs to iterate through. However, I don't see any way to specify an order to the array -- it seems to be related to what order they were created, but you would have to get the definitive answer from Nick or Dave.

The list of API methods that node-red exposes can be found at https://nodered.org/docs/api/admin/methods/
--
Steve
Reply all
Reply to author
Forward
0 new messages