|
@@ -7,15 +7,20 @@ import angular from 'angular';
|
|
|
export class AlertTabCtrl {
|
|
export class AlertTabCtrl {
|
|
|
panel: any;
|
|
panel: any;
|
|
|
panelCtrl: any;
|
|
panelCtrl: any;
|
|
|
|
|
+ alerting: any;
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
/** @ngInject */
|
|
|
constructor($scope) {
|
|
constructor($scope) {
|
|
|
$scope.alertTab = this;
|
|
$scope.alertTab = this;
|
|
|
this.panelCtrl = $scope.ctrl;
|
|
this.panelCtrl = $scope.ctrl;
|
|
|
this.panel = this.panelCtrl.panel;
|
|
this.panel = this.panelCtrl.panel;
|
|
|
|
|
+ this.alerting = this.alerting || {};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ this.convertThresholdsToAlertThresholds();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- convertThresholdsToAlerts() {
|
|
|
|
|
|
|
+ convertThresholdsToAlertThresholds() {
|
|
|
if (this.panel.grid && this.panel.grid.threshold1) {
|
|
if (this.panel.grid && this.panel.grid.threshold1) {
|
|
|
this.panel.alerting.warnLevel = '< ' + this.panel.grid.threshold1;
|
|
this.panel.alerting.warnLevel = '< ' + this.panel.grid.threshold1;
|
|
|
}
|
|
}
|
|
@@ -34,7 +39,5 @@ export function graphAlertEditor() {
|
|
|
scope: true,
|
|
scope: true,
|
|
|
templateUrl: 'public/app/plugins/panel/graph/partials/tab_alerting.html',
|
|
templateUrl: 'public/app/plugins/panel/graph/partials/tab_alerting.html',
|
|
|
controller: AlertTabCtrl,
|
|
controller: AlertTabCtrl,
|
|
|
- //bindToController: true,
|
|
|
|
|
- //controllerAs: 'ctrl',
|
|
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|