feat(alerting): include default notifications in alert tab

This commit is contained in:
bergquist
2016-09-07 15:13:24 +02:00
parent c769148701
commit f56d45ac56
2 changed files with 11 additions and 3 deletions

View File

@@ -76,6 +76,14 @@ export class AlertTabCtrl {
this.alertNotifications.push(model);
}
});
_.each(this.notifications, item => {
if (item.isDefault) {
item.iconClass = this.getNotificationIcon(item.type);
item.bgColor = "#00678b";
this.alertNotifications.push(item);
}
});
});
}

View File

@@ -6,7 +6,7 @@
</li>
<li ng-class="{active: ctrl.subTabIndex === 1}">
<a ng-click="ctrl.changeTabIndex(1)">
Notifications <span class="muted">({{ctrl.alert.notifications.length}})</span>
Notifications <span class="muted">({{ctrl.alertNotifications.length}})</span>
</a>
</li>
<li ng-class="{active: ctrl.subTabIndex === 2}">
@@ -122,9 +122,9 @@
<div class="gf-form-inline">
<div class="gf-form max-width-30">
<span class="gf-form-label width-8">Send to</span>
<span class="gf-form-label query-part" ng-repeat="nc in ctrl.alertNotifications">
<span class="gf-form-label" ng-repeat="nc in ctrl.alertNotifications" ng-style="{'background-color': nc.bgColor }">
<i class="{{nc.iconClass}}"></i>&nbsp;{{nc.name}}&nbsp;
<i class="fa fa-remove pointer muted" ng-click="ctrl.removeNotification($index)"></i>
<i class="fa fa-remove pointer muted" ng-click="ctrl.removeNotification($index)" ng-if="nc.isDefault === false"></i>
</span>
<metric-segment segment="ctrl.addNotificationSegment" get-options="ctrl.getNotifications()" on-change="ctrl.notificationAdded()"></metric-segment>
</div>