From c5e90b1801a7319b18ca1d7947296fd7d77ea22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 31 Jul 2016 21:58:12 +0200 Subject: [PATCH] feat(alerting): more polish on alerting tab UI --- .../app/features/alerting/alert_tab_ctrl.ts | 11 +- .../features/alerting/partials/alert_tab.html | 143 +++++++++--------- 2 files changed, 85 insertions(+), 69 deletions(-) diff --git a/public/app/features/alerting/alert_tab_ctrl.ts b/public/app/features/alerting/alert_tab_ctrl.ts index 9f9b7f2b70e..8b3a757d92e 100644 --- a/public/app/features/alerting/alert_tab_ctrl.ts +++ b/public/app/features/alerting/alert_tab_ctrl.ts @@ -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 diff --git a/public/app/features/alerting/partials/alert_tab.html b/public/app/features/alerting/partials/alert_tab.html index 870eb220811..87ce81f69e9 100644 --- a/public/app/features/alerting/partials/alert_tab.html +++ b/public/app/features/alerting/partials/alert_tab.html @@ -16,78 +16,88 @@
-
-
Alert Rule
-
- Name - -
-
+
+
+
Alert Config
- Evaluate every - + Name +
-
- Severity -
- +
+
+ Evaluate every + +
+
+ Severity +
+ +
-
-
-
Conditions
-
-
- AND - WHEN +
+
Conditions
+
+
+ AND + WHEN +
+
+ + +
+
+ Reducer + + +
+
+ Value + + +
+
+ +
+
- - -
-
- Reducer - - -
-
- Value - - -
-
-
+ +
+ + + +
-
- +
+ Evaluating rule
-
- - - +
+
@@ -95,23 +105,20 @@
Notifications
- - {{nc.name}} - + Send to + +  {{nc.name}}  +
+
+ Message + +
- -
- Evaluating rule -
- -
- -