mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Corrected missing annotations: true tag from the influxdb9 plugin json and fixed influxseries data handling
This commit is contained in:
parent
8a986ec340
commit
e5844afb0f
@ -5,7 +5,8 @@ function (_) {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function InfluxSeries(options) {
|
function InfluxSeries(options) {
|
||||||
this.seriesList = options.seriesList;
|
this.seriesList = options.seriesList && options.seriesList.results && options.seriesList.results.length > 0
|
||||||
|
? options.seriesList.results[0].series || [] : [];
|
||||||
this.alias = options.alias;
|
this.alias = options.alias;
|
||||||
this.annotation = options.annotation;
|
this.annotation = options.annotation;
|
||||||
}
|
}
|
||||||
@ -17,12 +18,10 @@ function (_) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
console.log(self.seriesList);
|
console.log(self.seriesList);
|
||||||
if (!self.seriesList || !self.seriesList.results || !self.seriesList.results[0]) {
|
if (self.seriesList.length === 0) {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.seriesList = self.seriesList.results[0].series;
|
|
||||||
|
|
||||||
_.each(self.seriesList, function(series) {
|
_.each(self.seriesList, function(series) {
|
||||||
var datapoints = [];
|
var datapoints = [];
|
||||||
for (var i = 0; i < series.values.length; i++) {
|
for (var i = 0; i < series.values.length; i++) {
|
||||||
@ -63,19 +62,15 @@ function (_) {
|
|||||||
if (column === self.annotation.textColumn) { textCol = index; return; }
|
if (column === self.annotation.textColumn) { textCol = index; return; }
|
||||||
});
|
});
|
||||||
|
|
||||||
_.each(series.points, function (point) {
|
_.each(series.values, function (value) {
|
||||||
var data = {
|
var data = {
|
||||||
annotation: self.annotation,
|
annotation: self.annotation,
|
||||||
time: point[timeCol],
|
time: + new Date(value[timeCol]),
|
||||||
title: point[titleCol],
|
title: value[titleCol],
|
||||||
tags: point[tagsCol],
|
tags: value[tagsCol],
|
||||||
text: point[textCol]
|
text: value[textCol]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tagsCol) {
|
|
||||||
data.tags = point[tagsCol];
|
|
||||||
}
|
|
||||||
|
|
||||||
list.push(data);
|
list.push(data);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -13,5 +13,6 @@
|
|||||||
"annotations": "app/plugins/datasource/influxdb/partials/annotations.editor.html"
|
"annotations": "app/plugins/datasource/influxdb/partials/annotations.editor.html"
|
||||||
},
|
},
|
||||||
|
|
||||||
"metrics": true
|
"metrics": true,
|
||||||
|
"annotations": true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user