algenty / grafana-flowcharting

Flowcharting, plugin for Grafana to create complexe visio's draws style like technical architectures, floorplan, diagrams, hierarchical schema based on draw.io
Apache License 2.0
953 stars 144 forks source link

relative links not working with sub_path configured in root_url #237

Open bijwaard opened 3 years ago

bijwaard commented 3 years ago

With increasing number of grafana instances, I am now using a web-proxy to make them all available via a single https URL. However, using sub_paths in the URL (i.e. by changing the root_url in grafana.ini) breaks relative links in flowcharting that assume the URL starts at / instead of the sub_path.

I found that dashboard links already support the sub-paths, the links contain the sub-path. image

I could not find a global variable in the grafana documentation that makes the sub_path available, it would be great if such a (template) variable would be available in the flowcharting plugin. Alternatively, the sub-path can be pre-pended/prefixed by the flowchariting plugin when the user enters a relative URL.

I think automatically prefixing the sub_path is the most intuitive for the user, so he/she doesn't have to meddle with variables to link to another dashboard on the same grafana server.

Kind regards, Dennis

algenty commented 3 years ago

added in roadmap

bijwaard commented 3 years ago

Hi Arnoud, Thanks for adding it, I guess in javacript this sub_path would be available, since the dashboard links are already using it. Kind regards, Dennis

bijwaard commented 3 years ago

Hi Arnaud, After some experimentation, I noticed that the relative URL works a bit different:

This way it already works perfectly for me, I can start the URL with a / when linking to another grafana instance on the same web proxy. I can start the URL without a / to link to another dashboard in the same grafana instance.

So if we add a small explanation to the URL mapping help page, this issue can be closed. Kind regards, Dennis