feat(alerting): only show available queries in alert query

This commit is contained in:
bergquist 2016-08-18 10:01:56 +02:00
parent 9b5a7b5ef6
commit 631acc2bf9
2 changed files with 11 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import {
var alertQueryDef = new QueryPartDef({
type: 'query',
params: [
{name: "queryRefId", type: 'string', options: ['A', 'B', 'C', 'D', 'E', 'F']},
{name: "queryRefId", type: 'string', dynamicLookup: true},
{name: "from", type: "string", options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h']},
{name: "to", type: "string", options: ['now']},
],

View File

@ -215,6 +215,16 @@ export class AlertTabCtrl {
case "get-part-actions": {
return this.$q.when([]);
}
case "part-param-changed": {
this.validateModel();
}
case "get-param-options": {
var result = this.panel.targets.map(target => {
return this.uiSegmentSrv.newSegment({ value: target.refId });
});
return this.$q.when(result);
}
}
}