From 015909dbff0e95185dd7e6643ce884a6f1ad6e77 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Thu, 30 Aug 2018 14:16:42 +0200 Subject: [PATCH] set default for timeGroup in query builder to $__interval --- public/app/plugins/datasource/postgres/query_ctrl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/postgres/query_ctrl.ts b/public/app/plugins/datasource/postgres/query_ctrl.ts index e2fd89898c1..24ed083ec21 100644 --- a/public/app/plugins/datasource/postgres/query_ctrl.ts +++ b/public/app/plugins/datasource/postgres/query_ctrl.ts @@ -481,7 +481,7 @@ export class PostgresQueryCtrl extends QueryCtrl { addGroup(partType, value) { let params = [value]; if (partType === 'time') { - params = ['1m', 'none']; + params = ['$__interval', 'none']; } let partModel = sqlPart.create({ type: partType, params: params }); @@ -618,7 +618,7 @@ export class PostgresQueryCtrl extends QueryCtrl { .then(tags => { var options = []; 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) { options.push(this.uiSegmentSrv.newSegment({ type: 'column', value: tag.text }));