feat(alerting): add warn/crit filter

This commit is contained in:
bergquist 2016-06-22 08:09:45 +02:00
parent b5a29b6246
commit 7952723b71
3 changed files with 15 additions and 2 deletions

View File

@ -151,8 +151,8 @@ func NewNotificationFromDBModel(model *m.AlertNotification) (*Notification, erro
Name: model.Name,
Type: model.Type,
Notifierr: notifier,
SendCritical: !model.Settings.Get("ignoreCrit").MustBool(),
SendWarning: !model.Settings.Get("ignoreWarn").MustBool(),
SendCritical: model.Settings.Get("sendCrit").MustBool(),
SendWarning: model.Settings.Get("sendWarn").MustBool(),
}, nil
}

View File

@ -13,6 +13,13 @@ export class AlertNotificationEditCtrl {
constructor(private $routeParams, private backendSrv, private $scope) {
if ($routeParams.notificationId) {
this.loadNotification($routeParams.notificationId);
} else {
this.notification = {
settings: {
sendCrit: true,
sendWarn: true,
}
};
}
}

View File

@ -24,6 +24,12 @@
<div class="gf-form">
<gf-form-switch class="gf-form" label-class="width-8" label="Always execute" checked="ctrl.notification.alwaysExecute" on-change=""></gf-form-switch>
</div>
<div class="gf-form">
<gf-form-switch class="gf-form" label-class="width-8" label="Send Warning" checked="ctrl.notification.settings.sendWarn" on-change=""></gf-form-switch>
</div>
<div class="gf-form">
<gf-form-switch class="gf-form" label-class="width-8" label="Send Critical" checked="ctrl.notification.settings.sendCrit" on-change=""></gf-form-switch>
</div>
</div>
<div class="gf-form-group section" ng-show="ctrl.notification.type === 'webhook'">
<div class="gf-form">