graphite-tags: refactor, improve performance - remove unnecessary parseTarget() calls

This commit is contained in:
Alexander Zobnin
2017-10-05 16:30:20 +03:00
parent 055f21f1e8
commit 2f1c14fc98

View File

@@ -417,8 +417,8 @@ export class GraphiteQueryCtrl extends QueryCtrl {
let newTagParam = renderTagString(tag); let newTagParam = renderTagString(tag);
this.getSeriesByTagFunc().params[tagIndex] = newTagParam; this.getSeriesByTagFunc().params[tagIndex] = newTagParam;
this.tags[tagIndex] = tag;
this.targetChanged(); this.targetChanged();
this.parseTarget();
} }
getSeriesByTagFuncIndex() { getSeriesByTagFuncIndex() {
@@ -439,15 +439,15 @@ export class GraphiteQueryCtrl extends QueryCtrl {
let newTag = {key: newTagKey, operator: '=', value: 'select tag value'}; let newTag = {key: newTagKey, operator: '=', value: 'select tag value'};
let newTagParam = renderTagString(newTag); let newTagParam = renderTagString(newTag);
this.getSeriesByTagFunc().params.push(newTagParam); this.getSeriesByTagFunc().params.push(newTagParam);
this.tags.push(newTag);
this.targetChanged(); this.targetChanged();
this.parseTarget(); this.fixTagSegments();
} }
removeTag(index) { removeTag(index) {
this.getSeriesByTagFunc().params.splice(index, 1); this.getSeriesByTagFunc().params.splice(index, 1);
this.tags.splice(index, 1);
this.targetChanged(); this.targetChanged();
this.parseTarget();
} }
fixTagSegments() { fixTagSegments() {