mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): more polish on alerting tab UI
This commit is contained in:
@@ -80,12 +80,21 @@ export class AlertTabCtrl {
|
||||
_.each(this.alert.notifications, item => {
|
||||
var model = _.findWhere(this.notifications, {id: item.id});
|
||||
if (model) {
|
||||
model.iconClass = this.getNotificationIcon(model.type);
|
||||
this.alertNotifications.push(model);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getNotificationIcon(type) {
|
||||
switch (type) {
|
||||
case "email": return "fa fa-envelope";
|
||||
case "slack": return "fa fa-slack";
|
||||
case "webhook": return "fa fa-cubes";
|
||||
}
|
||||
}
|
||||
|
||||
getNotifications() {
|
||||
return Promise.resolve(this.notifications.map(item => {
|
||||
return this.uiSegmentSrv.newSegment(item.name);
|
||||
@@ -98,7 +107,7 @@ export class AlertTabCtrl {
|
||||
return;
|
||||
}
|
||||
|
||||
this.alertNotifications.push({name: model.name});
|
||||
this.alertNotifications.push({name: model.name, iconClass: this.getNotificationIcon(model.type)});
|
||||
this.alert.notifications.push({id: model.id});
|
||||
|
||||
// reset plus button
|
||||
|
||||
Reference in New Issue
Block a user