-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
link to dashboard from sidebar does not work when httpNodeRoot
is set
#163
Comments
I have the fix for this as I needed to get it working to review #164 Main.js/**
* Configure SocketIO Client to Interact with Node-RED
*/
// inspect the current URL to determine the correct path to use
const url = new URL(window.location.href)
// determine the base path to use (everything before the first /dashboard) // TODO: determine what to do when /dashboard is called something else (support multiple dashboards github #1 )
const basePath = url.pathname.split('/dashboard')[0]
const path = basePath + '/dashboard/socket.io'
const socket = io({
path
}) ui_base.html function uiLink (name, path) {
const base = RED.settings.httpNodeRoot || '/'
const basePart = base.endsWith('/') ? base : `${base}/`
const dashPart = path.startsWith('/') ? path.slice(1) : path
const fullPath = `${basePart}${dashPart}`
return `<div class="red-ui-sidebar-header"><label>${name}</label><a id="open-dashboard" href="${fullPath}" target="nr-dashboard" class="editor-button editor-button-small nr-db-sb-list-header-button">Open Dashboard<i style="margin-left: 3px;" class="fa fa-external-link"></i></a></div>`
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported on forum: https://discourse.nodered.org/t/dashboard-2-0-pre-alpha-available/80142/86?u=steve-mcl
The text was updated successfully, but these errors were encountered: