Commit 525ae4fd by Dan Cech

support metric trees of varying depth, never send '.select metric' to graphite

parent 8dcfa187
......@@ -152,7 +152,7 @@ export default class GraphiteQuery {
updateModelTarget(targets) {
// render query
if (!this.target.textEditor) {
var metricPath = this.getSegmentPathUpTo(this.segments.length);
var metricPath = this.getSegmentPathUpTo(this.segments.length).replace(/\.select metric$/, '');
this.target.target = _.reduce(this.functions, wrapFunction, metricPath);
}
......
......@@ -219,10 +219,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
this.updateModelTarget();
if (this.queryModel.target !== oldTarget) {
var lastSegment = this.segments.length > 0 ? this.segments[this.segments.length - 1] : {};
if (lastSegment.value !== 'select metric') {
this.panelCtrl.refresh();
}
this.panelCtrl.refresh();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment