Skip to content

Commit

Permalink
Merge pull request #83 from sreemukha/master
Browse files Browse the repository at this point in the history
Fixing threshold color picker, updating to v1.1.2
  • Loading branch information
sreemukha authored Apr 29, 2019
2 parents c4e1f0e + c7c8962 commit e4834bd
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## GlobalNOC Networkmap Panel v1.1.2 - Wed Apr 29 2019

* Fixed issue with `<color-picker>` in threshold legend mode

## GlobalNOC Networkmap Panel v1.1.1 - Wed Apr 24 2019

* Updated `<spectrum-picker>` to `<color-picker>` to fix issues in Grafana v6
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = grnoc-grafana-worldview
VERSION = 1.1.1
VERSION = 1.1.2

rpm: dist
rpmbuild -ta dist/$(NAME)-$(VERSION).tar.gz
Expand Down
2 changes: 1 addition & 1 deletion grnoc-grafana-worldview.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: grnoc-grafana-worldview
Version: 1.1.1
Version: 1.1.2
Release: 1%{?dist}
Summary: GRNOC Worldview Grafana Plugin
Group: GRNOC
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Network-Map" ,
"version": "1.1.1",
"version": "1.1.2",
"description": "GlobalNOC Networkmap Panel for Grafana",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 13 additions & 1 deletion src/atlas3.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const panelDefaults = {
legendTypes: ['opacity','spectrum','threshold'],
opacityScales: ['linear', 'sqrt'],
colorScheme : 'interpolateRdYlGn',
threshold_colors: []
threshold_colors: ['#37872D', '#C4162A']
};

var tempArray=[];
Expand Down Expand Up @@ -407,6 +407,18 @@ export class Atlas3 extends MetricsPanelCtrl {
this.render();
}

updateThresholdDefaults() {
console.log(this.panel.legend.thresholds);
if(!this.panel.threshold_colors[0]) {
this.panel.threshold_colors[0] = "rgb(200,200,200)";
}
this.panel.legend.thresholds.forEach((threshold,idx) => {
if(!this.panel.threshold_colors[idx+1]) {
this.panel.threshold_colors[idx+1] = "rgb(200,200,200)";
}
});
}

jsonModal(){
var modalScope = this.$scope.$new(false);
modalScope.panel = this.panel;
Expand Down
2 changes: 1 addition & 1 deletion src/partials/display_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h5 class="section-heading">Colors</h5>
<label class="gf-form-label width-8">Thresholds
<tip>Comma separated values in increasing order between (0,100)</tip>
</label>
<input type="text" class="gf-form-input width-10" ng-model="ctrl.panel.legend.thresholds" placeholder="50,80" ng-blur="ctrl.render()" array-join>
<input type="text" class="gf-form-input width-10" ng-model="ctrl.panel.legend.thresholds" placeholder="50,80" ng-blur="ctrl.updateThresholdDefaults()" array-join>
</div>
<div class="gf-form">
<label class="gf-form-label width-8">Colors</label>
Expand Down
4 changes: 2 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{"name": "Github", "url": "https://github.com/GlobalNOC/globalnoc-networkmap-panel"},
{"name": "Apache License", "url": "https://raw.githubusercontent.com/globalnoc/globalnoc-networkmap-panel/master/LICENSE"}
],
"version": "1.1.1",
"updated": "2019-04-24"
"version": "1.1.2",
"updated": "2019-04-29"
},

"dependencies": {
Expand Down

0 comments on commit e4834bd

Please sign in to comment.