From 05d43999dc83c2adc5bda27eb8e41e0b762c35ea Mon Sep 17 00:00:00 2001 From: bergquist Date: Fri, 16 Sep 2016 15:55:38 +0200 Subject: [PATCH] feat(alertlist): add support for time range lockdown closes #5981 --- public/app/plugins/panel/alertlist/editor.html | 9 ++++++++- public/app/plugins/panel/alertlist/module.ts | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/alertlist/editor.html b/public/app/plugins/panel/alertlist/editor.html index ad946202432..7ea95c39e02 100644 --- a/public/app/plugins/panel/alertlist/editor.html +++ b/public/app/plugins/panel/alertlist/editor.html @@ -22,7 +22,14 @@
- +
Time options
+
diff --git a/public/app/plugins/panel/alertlist/module.ts b/public/app/plugins/panel/alertlist/module.ts index f5ba0c61aa8..ddfd77619b7 100644 --- a/public/app/plugins/panel/alertlist/module.ts +++ b/public/app/plugins/panel/alertlist/module.ts @@ -24,7 +24,8 @@ class AlertListPanel extends PanelCtrl { panelDefaults = { show: 'current', limit: 10, - stateFilter: [] + stateFilter: [], + useTimeRange: false }; /** @ngInject */ @@ -71,6 +72,11 @@ class AlertListPanel extends PanelCtrl { newState: this.panel.stateFilter }; + if (this.panel.useTimeRange) { + params.from = dateMath.parse(this.dashboard.time.from).unix() * 1000; + params.to = dateMath.parse(this.dashboard.time.to).unix() * 1000; + } + this.backendSrv.get(`/api/annotations`, params) .then(res => { this.alertHistory = _.map(res, al => {