소스 검색

fix variable interpolation

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

+ 3 - 0
public/app/plugins/datasource/postgres/postgres_query.ts

@@ -239,6 +239,9 @@ export default class PostgresQuery {
 
     query += ' ORDER BY time';
 
+    if (interpolate) {
+      query = this.templateSrv.replace(query, this.scopedVars, this.interpolateQueryStr);
+    }
     return query;
   }
 

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

@@ -207,7 +207,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
           segments.unshift(
             this.uiSegmentSrv.newSegment({
               type: 'template',
-              value: '/^$' + variable.name + '$/',
+              value: '$' + variable.name,
               expandable: true,
             })
           );