Access dashboard tabs through name

I am trying to access my dashboard tabs through your name instead of the default id given to you.
This way you would not have to search or reposition the dashboard every time you make changes
EXAMPLE:
With a link via http like this -> image

I redirect myself to my Dashboard Tab -> image

I have my example here, but I want to know if there is a better way to do this because it works, but it gives me an error

[{"id":"46fac66.8b8fc38","type":"ui_ui_control","z":"b8fff5c2.a60e08","name":"","events":"change","x":800,"y":960,"wires":[["8f3c85ae.dab168","7054486.a46fcb8"]]},{"id":"5b7f7cfb.c92134","type":"function","z":"b8fff5c2.a60e08","name":"","func":"msg.payload = {tab: msg.req.params.id}\nflow.set(\"DashboardRedirectReq\",msg.req)\nflow.set(\"DashboardRedirectRes\",msg.res)\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":960,"wires":[["46fac66.8b8fc38","94069b42.5dc2c8"]]},{"id":"e3cabf79.d0b63","type":"http in","z":"b8fff5c2.a60e08","name":"","url":"/dashboard/:id","method":"get","upload":false,"swaggerDoc":"","x":450,"y":960,"wires":[["5b7f7cfb.c92134"]]},{"id":"bbc2e007.333ce","type":"http response","z":"b8fff5c2.a60e08","name":"http out dash","statusCode":"","headers":{},"x":1510,"y":960,"wires":[]},{"id":"8f3c85ae.dab168","type":"debug","z":"b8fff5c2.a60e08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":830,"y":900,"wires":[]},{"id":"94069b42.5dc2c8","type":"debug","z":"b8fff5c2.a60e08","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":670,"y":900,"wires":[]},{"id":"d1d64796.06d338","type":"debug","z":"b8fff5c2.a60e08","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1010,"y":900,"wires":[]},{"id":"7054486.a46fcb8","type":"change","z":"b8fff5c2.a60e08","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.payload","tot":"msg"},{"t":"move","p":"tab","pt":"msg","to":"payload.tab","tot":"msg"},{"t":"move","p":"name","pt":"msg","to":"payload.name","tot":"msg"},{"t":"move","p":"socketid","pt":"msg","to":"payload.socketid","tot":"msg"},{"t":"move","p":"socketip","pt":"msg","to":"payload.socketip","tot":"msg"},{"t":"move","p":"params","pt":"msg","to":"payload.params","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":960,"wires":[["d1d64796.06d338","d634d6a9.449308"]]},{"id":"85bcb0a7.59f5","type":"comment","z":"b8fff5c2.a60e08","name":"Set The tab on the ID","info":"","x":480,"y":900,"wires":[]},{"id":"d634d6a9.449308","type":"function","z":"b8fff5c2.a60e08","name":"","func":"msg.req=flow.get(\"DashboardRedirectReq\")\nmsg.res=flow.get(\"DashboardRedirectRes\")\nmsg.URL=\"http://localhost:1880/ui/#!/\"+msg.payload.tab\nreturn msg;","outputs":1,"noerr":0,"x":1170,"y":960,"wires":[["9f58d19a.01e3f","67c16c5d.f2de84"]]},{"id":"9f58d19a.01e3f","type":"debug","z":"b8fff5c2.a60e08","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1170,"y":900,"wires":[]},{"id":"67c16c5d.f2de84","type":"template","z":"b8fff5c2.a60e08","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"Refresh\" content=\"0; url={{URL}}\" />\n  </head>\n  <body>\n    <p>Redirecting to <a href=\"{{URL}}\"></a>.</p>\n  </body>\n</html>","output":"str","x":1360,"y":960,"wires":[["bbc2e007.333ce"]]},{"id":"52bd9fc.5f04f6","type":"comment","z":"b8fff5c2.a60e08","name":"Page gonna redirect to the Position of the tab by his name","info":"","x":1310,"y":1000,"wires":[]},{"id":"19d51cf7.655b23","type":"catch","z":"b8fff5c2.a60e08","name":"","scope":["bbc2e007.333ce"],"uncaught":false,"x":1250,"y":1040,"wires":[["cf8075a7.2dfd28"]]},{"id":"cf8075a7.2dfd28","type":"debug","z":"b8fff5c2.a60e08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1410,"y":1040,"wires":[]}]

You can use an inject node (check the "inject once" checkbox) set it to json with {"tab":"my_tab_name"} - change the my_tab_name, connect it to a ui-control node.

Once you hit deploy it will switch to this tab.

1 Like

Yes, that's the point.
But what I want is to get through the name with the browser
The problem I have at the moment is that it gives me the error: Error [ERR_HTTP_HEADERS_SENT]
since it is done several times.

Do not you think there should be an option on the dashboard to access the tabs through the name?

Do you know if it is possible to obtain the id (number) of a tab and its tab name without changing the dashboard url?

@Nxito Were you ever able to find a solution to this? I'm also looking for a more permanent link solution for dashboard bookmarks.

u can see this posts:
https://discourse.nodered.org/t/configuring-a-dashboard-tab-in-response-to-a-url/19106/6
https://discourse.nodered.org/t/help-with-this-node-that-lists-the-dashboard-menu/17359

1 Like