From 53a9dec407b86eb3b2e22803bf97513cefd9581a Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 31 Aug 2016 09:48:58 +0200 Subject: [PATCH] feat(alerting): move timestamp to new row ref #5850 --- public/app/features/alerting/alert_tab_ctrl.ts | 4 ++-- public/app/features/alerting/partials/alert_tab.html | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/public/app/features/alerting/alert_tab_ctrl.ts b/public/app/features/alerting/alert_tab_ctrl.ts index 546aee776a7..c5ed6187f35 100644 --- a/public/app/features/alerting/alert_tab_ctrl.ts +++ b/public/app/features/alerting/alert_tab_ctrl.ts @@ -76,11 +76,11 @@ export class AlertTabCtrl { }); }).then(() => { this.backendSrv.get(`/api/alert-history?dashboardId=${this.panelCtrl.dashboard.id}&panelId=${this.panel.id}`).then(res => { - this.alertHistory = _.map(res, (ah) => { + this.alertHistory = _.map(res, ah => { ah.time = moment(ah.timestamp).format('MMM D, YYYY HH:mm:ss'); ah.stateModel = alertDef.getStateDisplayModel(ah.newState); - ah.metrics = _.map(ah.data, (ev) => { + ah.metrics = _.map(ah.data, ev=> { return ev.Metric + "=" + ev.Value; }).join(', '); diff --git a/public/app/features/alerting/partials/alert_tab.html b/public/app/features/alerting/partials/alert_tab.html index 7a98cf38a31..497027203bc 100644 --- a/public/app/features/alerting/partials/alert_tab.html +++ b/public/app/features/alerting/partials/alert_tab.html @@ -134,8 +134,11 @@
- {{ah.text}} - at {{ah.time}} {{ah.metrics}} + {{ah.stateModel.text}} + {{ah.metrics}} +
+
+ {{ah.time}}