mirror of https://github.com/grafana/grafana.git
SingleStatPanel: You can now use template variables in pre & postfix, Closes #1321
This commit is contained in:
parent
4edf0c9768
commit
92c3d80189
|
@ -3,6 +3,7 @@
|
||||||
**Enhancements**
|
**Enhancements**
|
||||||
- [Issue #1297](https://github.com/grafana/grafana/issues/1297). Graphite: Added cumulative and minimumBelow graphite functions
|
- [Issue #1297](https://github.com/grafana/grafana/issues/1297). Graphite: Added cumulative and minimumBelow graphite functions
|
||||||
- [Issue #1296](https://github.com/grafana/grafana/issues/1296). InfluxDB: Auto escape column names with special characters. Thanks @steven-aerts
|
- [Issue #1296](https://github.com/grafana/grafana/issues/1296). InfluxDB: Auto escape column names with special characters. Thanks @steven-aerts
|
||||||
|
- [Issue #1321](https://github.com/grafana/grafana/issues/1321). SingleStatPanel: You can now use template variables in pre & postfix
|
||||||
|
|
||||||
**Fixes**
|
**Fixes**
|
||||||
- [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query
|
- [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query
|
||||||
|
|
|
@ -11,7 +11,7 @@ function (angular, app, _, $) {
|
||||||
var module = angular.module('grafana.panels.singlestat', []);
|
var module = angular.module('grafana.panels.singlestat', []);
|
||||||
app.useModule(module);
|
app.useModule(module);
|
||||||
|
|
||||||
module.directive('singlestatPanel', function($location, linkSrv, $timeout) {
|
module.directive('singlestatPanel', function($location, linkSrv, $timeout, templateSrv) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
link: function(scope, elem) {
|
link: function(scope, elem) {
|
||||||
|
@ -63,6 +63,7 @@ function (angular, app, _, $) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSpan(className, fontSize, value) {
|
function getSpan(className, fontSize, value) {
|
||||||
|
value = templateSrv.replace(value);
|
||||||
return '<span class="' + className + '" style="font-size:' + fontSize + '">' +
|
return '<span class="' + className + '" style="font-size:' + fontSize + '">' +
|
||||||
value + '</span>';
|
value + '</span>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue