Sfoglia il codice sorgente

Merge branch 'alerting' of github.com:grafana/grafana into alerting

Torkel Ödegaard 9 anni fa
parent
commit
2f953d75a6

+ 1 - 1
public/app/features/alerting/alert_def.ts

@@ -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']},
   ],

+ 10 - 0
public/app/features/alerting/alert_tab_ctrl.ts

@@ -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);
+      }
     }
   }