From 9c5b4e6f25df0077f1696f2309e6e3c9b0bf4aa1 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 2 May 2016 14:41:29 +0200 Subject: [PATCH] feat(alerting): auto convert thresholds if existing --- public/app/plugins/panel/graph/alert_tab_ctrl.ts | 9 ++++++--- .../app/plugins/panel/graph/partials/tab_alerting.html | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/panel/graph/alert_tab_ctrl.ts b/public/app/plugins/panel/graph/alert_tab_ctrl.ts index aeb371e2f19..0db461a9b3b 100644 --- a/public/app/plugins/panel/graph/alert_tab_ctrl.ts +++ b/public/app/plugins/panel/graph/alert_tab_ctrl.ts @@ -7,15 +7,20 @@ import angular from 'angular'; export class AlertTabCtrl { panel: any; panelCtrl: any; + alerting: any; /** @ngInject */ constructor($scope) { $scope.alertTab = this; this.panelCtrl = $scope.ctrl; this.panel = this.panelCtrl.panel; + this.alerting = this.alerting || {}; + + + this.convertThresholdsToAlertThresholds(); } - convertThresholdsToAlerts() { + convertThresholdsToAlertThresholds() { if (this.panel.grid && this.panel.grid.threshold1) { this.panel.alerting.warnLevel = '< ' + this.panel.grid.threshold1; } @@ -34,7 +39,5 @@ export function graphAlertEditor() { scope: true, templateUrl: 'public/app/plugins/panel/graph/partials/tab_alerting.html', controller: AlertTabCtrl, - //bindToController: true, - //controllerAs: 'ctrl', }; } diff --git a/public/app/plugins/panel/graph/partials/tab_alerting.html b/public/app/plugins/panel/graph/partials/tab_alerting.html index a48dafa453d..d5cb725c9cb 100644 --- a/public/app/plugins/panel/graph/partials/tab_alerting.html +++ b/public/app/plugins/panel/graph/partials/tab_alerting.html @@ -14,7 +14,6 @@
Thresholds
-

We noticed you have existing threshholds.Convert them

Warn level