Commit adaf9cbc by Torkel Ödegaard

merge PR #390

parents e4799401 c9df61c4
...@@ -62,16 +62,10 @@ function (angular, _, kbn) { ...@@ -62,16 +62,10 @@ function (angular, _, kbn) {
query = queryElements.join(" "); query = queryElements.join(" ");
} }
else { else {
var template = "select [[func]]([[column]]) as [[column]]_[[func]] from [[series]] " + var template = "select [[func]](\"[[column]]\") as \"[[column]]_[[func]]\" from \"[[series]]\" " +
"where [[timeFilter]] [[condition_add]] [[condition_key]] [[condition_op]] [[condition_value]] " + "where [[timeFilter]] [[condition_add]] [[condition_key]] [[condition_op]] [[condition_value]] " +
"group by time([[interval]]) order asc"; "group by time([[interval]]) order asc";
if (target.column.indexOf('-') !== -1 || target.column.indexOf('.') !== -1) {
template = "select [[func]](\"[[column]]\") as \"[[column]]_[[func]]\" from [[series]] " +
"where [[timeFilter]] [[condition_add]] [[condition_key]] [[condition_op]] [[condition_value]] " +
"group by time([[interval]]) order asc";
}
var templateData = { var templateData = {
series: target.series, series: target.series,
column: target.column, column: target.column,
...@@ -99,7 +93,7 @@ function (angular, _, kbn) { ...@@ -99,7 +93,7 @@ function (angular, _, kbn) {
}; };
InfluxDatasource.prototype.listColumns = function(seriesName) { InfluxDatasource.prototype.listColumns = function(seriesName) {
return this.doInfluxRequest('select * from ' + seriesName + ' limit 1').then(function(data) { return this.doInfluxRequest('select * from "' + seriesName + '" limit 1').then(function(data) {
if (!data) { if (!data) {
return []; return [];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment