I'm aware Dashboard 1.0 is deprecated, however....
Problem
You maintain links to Dashboard 1.0 pages ("tabs") from your browser bookmarks, or maybe your mobile device. e.g. to take you straight to a specific page of your dashboard.
Node-RED dashboard generates URLs that end like this:
/ui/#!/0
/ui/#!/1
/ui/#!/2
Those numbers are array indexes, not persistent identifiers. When you delete or reorder tabs, Dashboard rebuilds the internal array, so your links break.
Solution
Import this tiny flow (3 nodes). You can set up mappings yourself (in the function node), then it will automatically map e.g.
http://your_nodered_server:1880/red/ui/bedroom_lights
to
http://your_nodered_server:1880/red/ui/#!/1
(Yes I know it's not rocket science, but I had been meaning to do this for a while, so thought I'd post it here in case anyone else wanted this workaround...)
[{"id":"http_in_router","type":"http in","z":"a09201df.15c79","name":"Stable URL router","url":"/red/ui/:page","method":"get","upload":false,"swaggerDoc":"","x":250,"y":100,"wires":[["fn_router"]]},{"id":"fn_router","type":"function","z":"a09201df.15c79","name":"Lookup + build redirect","func":"// http://your_server:1880/red/nice_url_you_choose redirects to the \n// first NodeRED dashboard page\n\n// So when IDs change, just come here and update them\n\n const map = {\n \"nice_url_you_choose\": \"0\",\n \"test\": \"1\"\n};\n\nconst page = msg.req.params.page;\nconst tab = map[page];\n\nif (!tab) {\n msg.statusCode = 404;\n msg.payload = `Unknown page: ${page}`;\n return msg;\n}\n\nmsg.statusCode = 302;\nmsg.headers = {\n \"Location\": `/red/ui/#!/${tab}`\n};\nmsg.payload = \"\";\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":100,"wires":[["http_response_router"]]},{"id":"http_response_router","type":"http response","z":"a09201df.15c79","name":"Send redirect","statusCode":"","headers":{},"x":770,"y":100,"wires":[]}]
