set default for timeGroup in query builder to $__interval

This commit is contained in:
Sven Klemm 2018-08-30 14:16:42 +02:00
parent 483f6cc5e1
commit 015909dbff

View File

@ -481,7 +481,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
addGroup(partType, value) { addGroup(partType, value) {
let params = [value]; let params = [value];
if (partType === 'time') { if (partType === 'time') {
params = ['1m', 'none']; params = ['$__interval', 'none'];
} }
let partModel = sqlPart.create({ type: partType, params: params }); let partModel = sqlPart.create({ type: partType, params: params });
@ -618,7 +618,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
.then(tags => { .then(tags => {
var options = []; var options = [];
if (!this.queryModel.hasTimeGroup()) { if (!this.queryModel.hasTimeGroup()) {
options.push(this.uiSegmentSrv.newSegment({ type: 'time', value: 'time(1m,none)' })); options.push(this.uiSegmentSrv.newSegment({ type: 'time', value: 'time($__interval,none)' }));
} }
for (let tag of tags) { for (let tag of tags) {
options.push(this.uiSegmentSrv.newSegment({ type: 'column', value: tag.text })); options.push(this.uiSegmentSrv.newSegment({ type: 'column', value: tag.text }));