Просмотр исходного кода

fix(influxdb): fix for using template variables in side alias field in influxdb 0.9 editor, fixes #2446

Torkel Ödegaard 10 лет назад
Родитель
Сommit
41e13fab55
2 измененных файлов с 4 добавлено и 0 удалено
  1. 1 0
      CHANGELOG.md
  2. 3 0
      public/app/plugins/datasource/influxdb/datasource.js

+ 1 - 0
CHANGELOG.md

@@ -3,6 +3,7 @@
 **Fixes**
 - [Issue #2443](https://github.com/grafana/grafana/issues/2443). Templating: Fix for buggy repeat row behavior when combined with with repeat panel due to recent change before 2.1 release
 - [Issue #2442](https://github.com/grafana/grafana/issues/2442). Templating: Fix text panel when using template variables in text in in repeated panel
+- [Issue #2446](https://github.com/grafana/grafana/issues/2446). InfluxDB: Fix for using template vars inside alias field (InfluxDB 0.9)
 
 # 2.1.0 (2015-08-04)
 

+ 3 - 0
public/app/plugins/datasource/influxdb/datasource.js

@@ -61,6 +61,9 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
           if (!result || !result.series) { continue; }
 
           var alias = (options.targets[i] || {}).alias;
+          if (alias) {
+            alias = templateSrv.replace(alias, options.scopedVars);
+          }
           var targetSeries = new InfluxSeries({ series: data.results[i].series, alias: alias }).getTimeSeries();
           for (y = 0; y < targetSeries.length; y++) {
             seriesList.push(targetSeries[y]);