mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Panel Alertlist: use dashboard timezone (#8880)
* panel-alertlist: use dashboard timezone, fixes #8874 * alert state history: use dashboard timezone, issue #8874 * alert state history: minor refactor
This commit is contained in:
parent
aecc6860e3
commit
af56cc4c28
@ -79,7 +79,7 @@ export class AlertTabCtrl {
|
||||
getAlertHistory() {
|
||||
this.backendSrv.get(`/api/annotations?dashboardId=${this.panelCtrl.dashboard.id}&panelId=${this.panel.id}&limit=50`).then(res => {
|
||||
this.alertHistory = _.map(res, ah => {
|
||||
ah.time = moment(ah.time).format('MMM D, YYYY HH:mm:ss');
|
||||
ah.time = this.dashboardSrv.getCurrent().formatDate(ah.time, 'MMM D, YYYY HH:mm:ss');
|
||||
ah.stateModel = alertDef.getStateDisplayModel(ah.newState);
|
||||
ah.info = alertDef.getAlertAnnotationInfo(ah);
|
||||
return ah;
|
||||
|
@ -104,7 +104,7 @@ class AlertListPanel extends PanelCtrl {
|
||||
this.backendSrv.get(`/api/annotations`, params)
|
||||
.then(res => {
|
||||
this.alertHistory = _.map(res, al => {
|
||||
al.time = moment(al.time).format('MMM D, YYYY HH:mm:ss');
|
||||
al.time = this.dashboard.formatDate(al.time, 'MMM D, YYYY HH:mm:ss');
|
||||
al.stateModel = alertDef.getStateDisplayModel(al.newState);
|
||||
al.info = alertDef.getAlertAnnotationInfo(al);
|
||||
return al;
|
||||
|
Loading…
Reference in New Issue
Block a user