graphite: minor fix for PR #10142 the query was being sent for every segmen t you selected before you completed the metric path

This commit is contained in:
Torkel Ödegaard 2017-12-12 12:56:40 +01:00
parent bb52f3670e
commit 871b98c06b
2 changed files with 5 additions and 1 deletions

View File

@ -120,6 +120,10 @@ export default class GraphiteQuery {
this.segments.push({value: "select metric"});
}
hasSelectMetric() {
return this.segments[this.segments.length - 1].value === 'select metric';
}
addFunction(newFunc) {
this.functions.push(newFunc);
this.moveAliasFuncLast();

View File

@ -218,7 +218,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.queryModel.hasSelectMetric()) {
this.panelCtrl.refresh();
}
}