feat(alerting): more polish on alerting tab UI

This commit is contained in:
Torkel Ödegaard
2016-07-31 21:58:12 +02:00
parent 3b69c8f687
commit c5e90b1801
2 changed files with 85 additions and 69 deletions

View File

@@ -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