mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Updated removing notification channel by uid
This commit is contained in:
parent
c27bf6e688
commit
43c3d5b8ba
@ -140,6 +140,7 @@ export class AlertTabCtrl {
|
|||||||
name: model.name,
|
name: model.name,
|
||||||
iconClass: this.getNotificationIcon(model.type),
|
iconClass: this.getNotificationIcon(model.type),
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
|
uid: model.uid
|
||||||
});
|
});
|
||||||
if (!_.find(this.alert.notifications, { id: model.id})) {
|
if (!_.find(this.alert.notifications, { id: model.id})) {
|
||||||
this.alert.notifications.push({ uid: model.uid });
|
this.alert.notifications.push({ uid: model.uid });
|
||||||
@ -151,9 +152,9 @@ export class AlertTabCtrl {
|
|||||||
this.addNotificationSegment.fake = true;
|
this.addNotificationSegment.fake = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
removeNotification(index) {
|
removeNotification(deleteUid) {
|
||||||
this.alert.notifications.splice(index, 1);
|
_.remove(this.alert.notifications, { uid: deleteUid});
|
||||||
this.alertNotifications.splice(index, 1);
|
_.remove(this.alertNotifications, { uid: deleteUid});
|
||||||
}
|
}
|
||||||
|
|
||||||
initModel() {
|
initModel() {
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
<div class="gf-form" ng-repeat="nc in ctrl.alertNotifications">
|
<div class="gf-form" ng-repeat="nc in ctrl.alertNotifications">
|
||||||
<span class="gf-form-label" ng-style="{'background-color': nc.bgColor }">
|
<span class="gf-form-label" ng-style="{'background-color': nc.bgColor }">
|
||||||
<i class="{{nc.iconClass}}"></i> {{nc.name}}
|
<i class="{{nc.iconClass}}"></i> {{nc.name}}
|
||||||
<i class="fa fa-remove pointer muted" ng-click="ctrl.removeNotification($index)" ng-if="nc.isDefault === false"></i>
|
<i class="fa fa-remove pointer muted" ng-click="ctrl.removeNotification(nc.uid)" ng-if="nc.isDefault === false"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="gf-form">
|
<div class="gf-form">
|
||||||
|
Loading…
Reference in New Issue
Block a user