소스 검색

set default for timeGroup in query builder to $__interval

Sven Klemm 7 년 전
부모
커밋
015909dbff
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      public/app/plugins/datasource/postgres/query_ctrl.ts

+ 2 - 2
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 }));