feat(alerting): move timestamp to new row

ref #5850
This commit is contained in:
bergquist 2016-08-31 09:48:58 +02:00
parent a5d49c9820
commit 53a9dec407
2 changed files with 7 additions and 4 deletions

View File

@ -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(', ');

View File

@ -134,8 +134,11 @@
<div class="card-item-sub-name">
<span class="alert-list-item-state {{ah.stateModel.stateClass}}">
<i class="{{ah.stateModel.iconClass}}"></i>
{{ah.text}}
</span> at {{ah.time}} {{ah.metrics}}
{{ah.stateModel.text}}
</span> {{ah.metrics}}
</div>
<div class="card-item-sub-name">
{{ah.time}}
</div>
</div>
</div>