Преглед изворни кода

add None to metric column suggestions

Sven Klemm пре 7 година
родитељ
комит
5b5dcabd22
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      public/app/plugins/datasource/postgres/query_ctrl.ts

+ 5 - 1
public/app/plugins/datasource/postgres/query_ctrl.ts

@@ -111,7 +111,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
   getMetricColumnSegments() {
     return this.datasource
       .metricFindQuery(this.queryBuilder.buildColumnQuery('metric'))
-      .then(this.transformToSegments({}))
+      .then(this.transformToSegments({ addNone: true }))
       .catch(this.handleQueryError.bind(this));
   }
 
@@ -182,6 +182,10 @@ export class PostgresQueryCtrl extends QueryCtrl {
         }
       }
 
+      if (config.addNone) {
+        segments.unshift(this.uiSegmentSrv.newSegment({ type: 'template', value: 'None', expandable: true }));
+      }
+
       return segments;
     };
   }