@@ -30,29 +29,29 @@
-
- -
-
-
-
-
-
-
-
{{al.alertName}}
-
- {{al.stateModel.text}}
- {{al.info}}
-
-
-
-
-
-
-
-
+
+ -
+
+
+
+
+
+
+
{{al.alertName}}
+
+ {{al.stateModel.text}}
+ {{al.info}}
+
+
+
+
+
+
+
+
diff --git a/public/app/plugins/panel/alertlist/module.ts b/public/app/plugins/panel/alertlist/module.ts
index 1109bda5677..7aeb99c9918 100644
--- a/public/app/plugins/panel/alertlist/module.ts
+++ b/public/app/plugins/panel/alertlist/module.ts
@@ -21,11 +21,10 @@ class AlertListPanel extends PanelCtrl {
{ text: 'Importance', value: 3 },
];
- panelHeight: any;
- contentHeight: string;
stateFilter: any = {};
currentAlerts: any = [];
alertHistory: any = [];
+ noAlertsMessage: string;
// Set and populate defaults
panelDefaults = {
show: 'current',
@@ -41,8 +40,7 @@ class AlertListPanel extends PanelCtrl {
_.defaults(this.panel, this.panelDefaults);
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
- this.events.on('render', this.onRender.bind(this));
- this.events.on('refresh', this.onRender.bind(this));
+ this.events.on('refresh', this.onRefresh.bind(this));
for (let key in this.panel.stateFilter) {
this.stateFilter[this.panel.stateFilter[key]] = true;
@@ -72,12 +70,10 @@ class AlertListPanel extends PanelCtrl {
}
this.panel.stateFilter = result;
- this.onRender();
+ this.onRefresh();
}
- onRender() {
- this.panelHeight = this.height - 30;
- this.contentHeight = "max-height: " + this.height + "px;";
+ onRefresh() {
if (this.panel.show === 'current') {
this.getCurrentAlertState();
}
@@ -109,6 +105,7 @@ class AlertListPanel extends PanelCtrl {
al.info = alertDef.getAlertAnnotationInfo(al);
return al;
});
+ this.noAlertsMessage = this.alertHistory.length === 0 ? 'No alerts in current time range' : '';
});
}
@@ -128,6 +125,7 @@ class AlertListPanel extends PanelCtrl {
al.newStateDateAgo = moment(al.newStateDate).locale('en').fromNow(true);
return al;
}));
+ this.noAlertsMessage = this.currentAlerts.length === 0 ? 'No alerts' : '';
});
}
diff --git a/public/sass/components/_panel_alertlist.scss b/public/sass/components/_panel_alertlist.scss
index c8e8354f4d7..f124c0c4b8c 100644
--- a/public/sass/components/_panel_alertlist.scss
+++ b/public/sass/components/_panel_alertlist.scss
@@ -1,3 +1,12 @@
.panel-alert-list {
overflow-y: auto;
}
+
+.panel-alert-list__no-alerts {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: calc(100% - 30px);
+}
+
diff --git a/public/sass/pages/_alerting.scss b/public/sass/pages/_alerting.scss
index 5ebb88f1346..6db3470f3ea 100644
--- a/public/sass/pages/_alerting.scss
+++ b/public/sass/pages/_alerting.scss
@@ -91,13 +91,6 @@
align-items: flex-end;
}
-.alert-list-no-alerts {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
-}
-
.panel-has-alert {
.panel-alert-icon:before {
content: "\e611";