fix(singletat): Support repeated template variables in prefix/postfix, fixes #6595

This commit is contained in:
Torkel Ödegaard 2016-11-16 18:44:39 +01:00
parent e6776f71d9
commit 4581bb4a7a
3 changed files with 8 additions and 6 deletions

View File

@ -6,6 +6,9 @@
* **UI/Browser**: Fixed issue with page/view header gradient border not showing in Safari, [#6530](https://github.com/grafana/grafana/issues/6530)
* **UX**: Panel Drop zone visible after duplicating panel, and when entering fullscreen/edit view, [#6598](https://github.com/grafana/grafana/issues/6598)
### Enhancements
* **Singlestat**: Support repeated template variables in prefix/postfix [#6595](https://github.com/grafana/grafana/issues/6595)
# 4.0-beta1 (2016-11-09)
### Enhancements

View File

@ -64,6 +64,8 @@ export class DynamicDashboardSrv {
j = j - 1;
}
}
row.panelSpanChanged();
}
}

View File

@ -208,11 +208,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
}
// Add $__name variable for using in prefix or postfix
data.scopedVars = {
__name: {
value: this.series[0].label
}
};
data.scopedVars = _.extend({}, this.panel.scopedVars);
data.scopedVars["__name"] = {value: this.series[0].label};
}
// check value to text mappings if its enabled
@ -526,7 +523,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
elem.toggleClass('pointer', panel.links.length > 0);
if (panel.links.length > 0) {
linkInfo = linkSrv.getPanelLinkAnchorInfo(panel.links[0], panel.scopedVars);
linkInfo = linkSrv.getPanelLinkAnchorInfo(panel.links[0], data.scopedVars);
} else {
linkInfo = null;
}