mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): add warn/crit filter
This commit is contained in:
parent
b5a29b6246
commit
7952723b71
@ -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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user