From 9fbb1214aec88e37caaf0330273fd0737c176ff6 Mon Sep 17 00:00:00 2001 From: Adrian Lopez Date: Mon, 4 Apr 2016 16:57:34 +0200 Subject: [PATCH] Allow to show multiple tags with annotations with InfluxDB datasource --- public/app/plugins/datasource/influxdb/influx_series.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/influxdb/influx_series.js b/public/app/plugins/datasource/influxdb/influx_series.js index 19e20390fd2..deb37b9dc0a 100644 --- a/public/app/plugins/datasource/influxdb/influx_series.js +++ b/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] };