Przeglądaj źródła

feat(alerting): add delete button for removing alerts

bergquist 9 lat temu
rodzic
commit
b58be91e71

+ 6 - 0
public/app/plugins/panel/graph/alert_tab_ctrl.ts

@@ -46,6 +46,12 @@ export class AlertTabCtrl {
     }
   }
 
+  markAsDeleted() {
+    if (this.panel.alerting) {
+      this.panel.alerting.queryRef = this.metricTargets[0].refId;
+    }
+  }
+
   thresholdsUpdated() {
     if (this.panel.alerting.warnLevel) {
       this.panel.grid.threshold1 = parseInt(this.panel.alerting.warnLevel);

+ 5 - 1
public/app/plugins/panel/graph/partials/tab_alerting.html

@@ -72,4 +72,8 @@
     </div>
   </div>
 </div>
-
+<div class="editor-row">
+  <div class="gf-form-button-row">
+    <button class="btn btn-warning" ng-click="alertTab.markAsDeleted()">Delete Alert</button>
+  </div>
+</div>