mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SingleStatPanel: You can now use template variables in pre & postfix, Closes #1321
This commit is contained in:
@@ -11,7 +11,7 @@ function (angular, app, _, $) {
|
||||
var module = angular.module('grafana.panels.singlestat', []);
|
||||
app.useModule(module);
|
||||
|
||||
module.directive('singlestatPanel', function($location, linkSrv, $timeout) {
|
||||
module.directive('singlestatPanel', function($location, linkSrv, $timeout, templateSrv) {
|
||||
|
||||
return {
|
||||
link: function(scope, elem) {
|
||||
@@ -63,6 +63,7 @@ function (angular, app, _, $) {
|
||||
}
|
||||
|
||||
function getSpan(className, fontSize, value) {
|
||||
value = templateSrv.replace(value);
|
||||
return '<span class="' + className + '" style="font-size:' + fontSize + '">' +
|
||||
value + '</span>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user