Skip to content
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

Fix dashboard not working when custom httpNodeRoot path is set #167

Conversation

Steve-Mcl
Copy link
Contributor

closes #163

Description

This is a temporary* fix to get dashboard2 working when the user has set httpNodePath to move the express endpoints.

I needed to fix this to review #164 - so raised it while fresh in mind.

*temporary

There is currently no way to know (in main.js) what the base path of the Node-RED instance is but we need this to setup the socket.io.
While #23 is unresolved, this is not an issue since the dashboard is hard coded to be /dashboard so we will always be able to determine the base path by grabbing everything before /dashboard from the pages href. But when #23 is implemented, we will need a way to distinguish the following possible URLs

  • http://xxxxx:port/nr/api/v1/section1/page2 // dashboard was named section1 so base URL is http://xxxxx:port/nr/api/v1
  • http://xxxxx:port/nr/api/v1/section1/page2 // dashboard was named v1 so base URL is http://xxxxx:port/nr/api/
  • http://xxxxx:port/nr/api/v1/page/2 // dashboard was named v1 so base URL is http://xxxxx:port/nr/api/
  • http://xxxxx:port/nr/api/v1/pages/2 // dashboard was named pages so base URL is http://xxxxx:port/nr/api/v1

Related Issue(s)

#163

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on flowforge/helm to update ConfigMap Template
    • Issue/PR raised on flowforge/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl linked an issue Sep 1, 2023 that may be closed by this pull request
@joepavitt joepavitt merged commit 581df81 into main Sep 2, 2023
1 check passed
@joepavitt joepavitt deleted the 163-link-to-dashboard-from-sidebar-does-not-work-when-httpnoderoot-is-set branch September 2, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

link to dashboard from sidebar does not work when httpNodeRoot is set
2 participants