Преглед изворни кода

fix(influxdb): Fixed issue when using the eye to disable queries in the query editor and when applying aliases, #2651

Torkel Ödegaard пре 10 година
родитељ
комит
745a7b4461
2 измењених фајлова са 5 додато и 1 уклоњено
  1. 1 0
      CHANGELOG.md
  2. 4 1
      public/app/plugins/datasource/influxdb/datasource.js

+ 1 - 0
CHANGELOG.md

@@ -25,6 +25,7 @@ it allows you to add queries of differnet data source types & instances to the s
 - [Issue #2564](https://github.com/grafana/grafana/issues/2564). Templating: Another atempt at fixing #2534 (Init multi value template var used in repeat panel from url)
 - [Issue #2620](https://github.com/grafana/grafana/issues/2620). Graph: multi series tooltip did no highlight correct point when stacking was enabled and series were of different resolution
 - [Issue #2636](https://github.com/grafana/grafana/issues/2636). InfluxDB: Do no show template vars in dropdown for tag keys and group by keys
+- [Issue #2651](https://github.com/grafana/grafana/issues/2651). InfluxDB: Fixed issue when using the eye to disable queries in the query editor and when applying aliases
 
 **Breaking Changes**
 - Notice to makers/users of custom data sources, there is a minor breaking change in 2.2 that

+ 4 - 1
public/app/plugins/datasource/influxdb/datasource.js

@@ -33,11 +33,14 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
 
     InfluxDatasource.prototype.query = function(options) {
       var timeFilter = getTimeFilter(options);
+      var queryTargets = [];
       var i, y;
 
       var allQueries = _.map(options.targets, function(target) {
         if (target.hide) { return []; }
 
+        queryTargets.push(target);
+
         // build query
         var queryBuilder = new InfluxQueryBuilder(target);
         var query =  queryBuilder.build();
@@ -61,7 +64,7 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
           var result = data.results[i];
           if (!result || !result.series) { continue; }
 
-          var alias = (options.targets[i] || {}).alias;
+          var alias = (queryTargets[i] || {}).alias;
           if (alias) {
             alias = templateSrv.replace(alias, options.scopedVars);
           }