소스 검색

feat(alerting): add delete button for removing alerts

bergquist 9 년 전
부모
커밋
b58be91e71
2개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 0
      public/app/plugins/panel/graph/alert_tab_ctrl.ts
  2. 5 1
      public/app/plugins/panel/graph/partials/tab_alerting.html

+ 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() {
   thresholdsUpdated() {
     if (this.panel.alerting.warnLevel) {
     if (this.panel.alerting.warnLevel) {
       this.panel.grid.threshold1 = parseInt(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>
 </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>