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
970 stars 147 forks source link

Wrong url for common.css #366

Open xuyungit opened 2 years ago

xuyungit commented 2 years ago

Hi,

I built the latest version using yarn archive and copy dist folder to the plugin folder of grafana, and it seems work properly. But browser tries to get common.css from URL_ROOT/mxgraph/css/common.css instead of URL_ROOT/public/plugins/agenty-flowcharting-panel/libs/drawio/mxgraph/css/common.css. Anything wrong with my build environment?

my setup: yarn: 1.22.17 node: v16.15.1 grafana: 9.0.6

Thanks.

pauljones0 commented 1 year ago

This is still valid for 1.0.0d (in my setup)

A workaround can be found by fixing/updating a line in the viewer-static.min.js in the snapshot to include the base path: The corrected line should look like this: mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css") , just grep for mxLoadStylesheets&&mxClient.link( and you should find it.

Screenshot from 2023-03-29 15-02-45 png

I'm not good enough at typescript to know what causes this error, so if someone more experienced could take a swing, that would be cool