pR0Ps / grafana-trackmap-panel

A panel for Grafana that visualizes GPS points as a line on an interactive map
https://grafana.com/plugins/pr0ps-trackmap-panel
Apache License 2.0
137 stars 61 forks source link

Add handling of new DataHoverEvent #77

Closed pesintta closed 1 year ago

pesintta commented 1 year ago

New panel types in Grafana may emit DataHoverEvents instead of LegacyGraphHoverEvents.

Fixes https://github.com/pR0Ps/grafana-trackmap-panel/issues/67

pR0Ps commented 1 year ago

Looks good to me, thanks for contributing! (and thanks to @Bart-1992 for confirming it works)

CptHolzschnauz commented 1 year ago

Cool. Thx. Don't you have to bump a new release or how is this received by Grafana Labs for the Plugin?

umbm commented 1 year ago

Please release it as new version to grafana too. There only the 2.1.2 without this fixes is available. Thx

Edit @Bart-1992 or could you give us a step by step how to implement it without using grafana-library?

Bart-1992 commented 1 year ago

@umbm I managed to get it working on our linux machine with following procedure:

First off all you need to make sure you can install 'unsigned' plugins into your grafana application: Make the following changes in your grafana.ini ( settings file, for more info check : https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/ )

1) Make sure you are in developer mode, add/change the following:

app_mode = development

Plugins section needs to look like this ( if not available in grafana.ini, just add this section ).


[plugins]
;enable_alpha = false
app_tls_skip_verify_insecure = true
# Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
allow_loading_unsigned_plugins = grafana-trackmap-panel
# Enable or disable installing / uninstalling / updating plugins directly from within Grafana.
;plugin_admin_enabled = false
;plugin_admin_external_manage_enabled = false
;plugin_catalog_url = https://grafana.com/grafana/plugins/
# Enter a comma-separated list of plugin identifiers to hide in the plugin catalog.
;plugin_catalog_hidden_plugins =

Remove the old Pr0ps plugin ( using Grafana GUI ) or manually using command line

1) Download/clone @pesintta 's ( or this updates one )repository to your local machine: git clone https://github.com/pesintta/grafana-trackmap-panel.git 2) Unzip the zip file: unzip grafana-trackmap-panel 3) Move into the unzipped folder: cd /grafana-trackmap-panel/ 4) As mentioned on main page of this repository, build manually using following comands : npm install npm run build 5) Copy the build ( the created 'dist' ) folder into your grafana plugins directory: cp -a /what-ever-your-location is/grafana-trackmap-panel-master/dist /var/lib/grafana/plugins/grafana-trackmap-panel 6) Restart grafana sudo systemctl restart grafana-server

After this the plugin should be working.

CptHolzschnauz commented 1 year ago

Thx but i prefer signed plugins for prod servers. Would be nice to have it within grafana.

pR0Ps commented 1 year ago

Sorry all, I'll push an update hopefully later today. I've had issues with my setup to test this locally which I would normally like to do before pushing a release. In this case though it seems like the released version is just broken and @Bart-1992 reports that the current HEAD is not so I'll just go for it.

CptHolzschnauz commented 1 year ago

No worries, good to hear, that's the way, thank you for your work!

pR0Ps commented 1 year ago

Made a small change to the PR in 6406d787 to keep Grafana v7.x.x from breaking. Managed to test it on v8.5.13 and v9.1.7 too and it worked fine.

Plugin has been released as v2.1.3 as well as submitted to Grafana (no idea how long that process will take)