grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
311 stars 199 forks source link

Add a feature of addLink in worldMap #121

Open DashboardPackage opened 6 years ago

DashboardPackage commented 6 years ago

It can be achieved dynamically to add and delete hostname and httpUrl, in order to achieve the worldmap corresponding point in the circle can jump to the corresponding httpUrl.As shown below image

Related code :

AddLink

worldMap-ctrl.js { key: 'addLinked', value: function addLinked() { var newLinkData = { cityName: "", httpUrl: "" }; this.panel.linkData.push(newLinkData); this.refresh(); } },{ key: 'removeLink', value: function removeLink($index) { this.panel.linkData.splice($index, 1); this.refresh(); } },{ key: 'getCityNameOptions', value: function getCityNameOptions(arr) { return this.mapToTextValue(cityNameList); } }

But I encountered a problem when i add the feature,which is the AddLink value of the previously created panel will be the value of the Addlink panel created the second time.

DashboardPackage commented 6 years ago

As shown in the figure below: 1、Set up the first worldmap panel and configure the AddLink item image 2、Save the worldmap panel and add another panel image 3、When you open the new panel, you will find that the AddLink item shows the value set when the panel was first built image