Node-red-dashboard's "Go to Dashboard" button in editor does not respect document.location.pathname

Hi,
I'm writing this post the second time, as my original post got flagged by Akismet as spam and has been hidden for a good week now.

I'm running Node-RED in a docker container and behind a reverse proxy that I have very limited control over. This reverse proxy creates a route from ht#p://DeviceIP/lorem/ipsum/red to ht#p://127.0.0.1:1880/red.

I noticed that the "Go to Dashboard" Button in the Node-RED Editor points to ht#p://DeviceIP/red/ui, and not ht#p://DeviceIP/lorem/ipsum/red/ui

By changing the settings.js to

//ui: { path: "lorem/ipsum/red/ui" },

I can make the button point to the correct url, however this will also result in the dashboard now being served at ht#p://DeviceIP/lorem/ipsum/lorem/ipsum/red (as expected).

The issue boils down to node-red-dashboard/ui_base.html not including the document.location.pathname, in this case lorem/ipsum.

By changing it to

var lnk = document.location.host+document.location.pathname+RED.settings.httpNodeRoot+"/"+uip;

the button now points to the correct url, including the pathname set by the reverse proxy.

I'd like to contribute a pull request for this, but first wanted to discuss this here. You can see my changes also at add pathname to show-dashboard button link · psten/node-red-dashboard@d8e4e90 (github.com)

Anything that I missed, why document.location.pathname should not be included in the link to the dashboard?

Best regards,
Philipp

1 Like

Hi @psten

If you raise a pull request to node-red-dashboard it will certainly be appreciated and considered.

Please be explicit/detailed in the PR description and add a link back (both ways) - thanks.

2 Likes

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