small change to influxdb template to support older versions of influxdb

This commit is contained in:
Torkel Ödegaard 2014-05-10 01:40:08 +02:00
parent f4568ef589
commit 07610a5f92
1 changed files with 7 additions and 1 deletions

View File

@ -62,10 +62,16 @@ function (angular, _, kbn) {
query = queryElements.join(" ");
}
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]] " +
"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 = {
series: target.series,
column: target.column,