From d8f2a207750535f3f61f68b33cc738c058465424 Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Wed, 27 Dec 2017 12:31:44 -0500 Subject: [PATCH] add button to trigger evaluation of tag queries --- .../graphite/partials/query.editor.html | 19 ++++++++++++++----- .../plugins/datasource/graphite/query_ctrl.ts | 14 +++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/public/app/plugins/datasource/graphite/partials/query.editor.html b/public/app/plugins/datasource/graphite/partials/query.editor.html index df32353644d..18511ca8d24 100755 --- a/public/app/plugins/datasource/graphite/partials/query.editor.html +++ b/public/app/plugins/datasource/graphite/partials/query.editor.html @@ -10,7 +10,7 @@ -
+
AND
- - + + +
+ +
+ +
diff --git a/public/app/plugins/datasource/graphite/query_ctrl.ts b/public/app/plugins/datasource/graphite/query_ctrl.ts index d8cc6c4c16b..f37cc8e8a6d 100644 --- a/public/app/plugins/datasource/graphite/query_ctrl.ts +++ b/public/app/plugins/datasource/graphite/query_ctrl.ts @@ -17,11 +17,13 @@ export class GraphiteQueryCtrl extends QueryCtrl { addTagSegments: any[]; removeTagValue: string; supportsTags: boolean; + paused: boolean; /** @ngInject **/ constructor($scope, $injector, private uiSegmentSrv, private templateSrv) { super($scope, $injector); this.supportsTags = this.datasource.supportsTags; + this.paused = false; if (this.target) { this.target.target = this.target.target || ''; @@ -191,6 +193,7 @@ export class GraphiteQueryCtrl extends QueryCtrl { if (segment.type === 'tag') { let tag = removeTagPrefix(segment.value); + this.pause(); this.addSeriesByTagFunc(tag); return; } @@ -235,7 +238,7 @@ export class GraphiteQueryCtrl extends QueryCtrl { var oldTarget = this.queryModel.target.target; this.updateModelTarget(); - if (this.queryModel.target !== oldTarget) { + if (this.queryModel.target !== oldTarget && !this.paused) { this.panelCtrl.refresh(); } } @@ -372,6 +375,15 @@ export class GraphiteQueryCtrl extends QueryCtrl { showDelimiter(index) { return index !== this.queryModel.tags.length - 1; } + + pause() { + this.paused = true; + } + + unpause() { + this.paused = false; + this.panelCtrl.refresh(); + } } function mapToDropdownOptions(results) {