Explorar o código

Allow to show multiple tags with annotations with InfluxDB datasource

Adrian Lopez %!s(int64=9) %!d(string=hai) anos
pai
achega
9fbb1214ae
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      public/app/plugins/datasource/influxdb/influx_series.js

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

@@ -81,7 +81,7 @@ function (_, TableModel) {
     _.each(this.series, function (series) {
       var titleCol = null;
       var timeCol = null;
-      var tagsCol = null;
+      var tagsCol = [];
       var textCol = null;
 
       _.each(series.columns, function(column, index) {
@@ -89,7 +89,7 @@ function (_, TableModel) {
         if (column === 'sequence_number') { return; }
         if (!titleCol) { titleCol = index; }
         if (column === self.annotation.titleColumn) { titleCol = index; return; }
-        if (column === self.annotation.tagsColumn) { tagsCol = index; return; }
+        if (self.annotation.tagsColumn.includes(column)) { tagsCol.push(index); return; }
         if (column === self.annotation.textColumn) { textCol = index; return; }
       });
 
@@ -98,7 +98,7 @@ function (_, TableModel) {
           annotation: self.annotation,
           time: + new Date(value[timeCol]),
           title: value[titleCol],
-          tags: value[tagsCol],
+          tags: tagsCol.map(function(t) { return value[t]; }),
           text: value[textCol]
         };