mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
77783c02cd
commit
05d43999dc
@ -22,7 +22,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section gf-form-group" ng-if="ctrl.panel.show == 'changes'">
|
<div class="section gf-form-group" ng-if="ctrl.panel.show == 'changes'">
|
||||||
<!-- <h5 class="section-heading">Search options</h5> -->
|
<h5 class="section-heading">Time options</h5>
|
||||||
|
<gf-form-switch
|
||||||
|
class="gf-form"
|
||||||
|
label="Within time range"
|
||||||
|
label-class="width-11"
|
||||||
|
tooltip="Show alert changes within the dashboard time range"
|
||||||
|
checked="ctrl.panel.useTimeRange"
|
||||||
|
on-change="ctrl.onRender()"></gf-form-switch>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section gf-form-group" ng-if="ctrl.panel.show == 'current'">
|
<div class="section gf-form-group" ng-if="ctrl.panel.show == 'current'">
|
||||||
|
@ -24,7 +24,8 @@ class AlertListPanel extends PanelCtrl {
|
|||||||
panelDefaults = {
|
panelDefaults = {
|
||||||
show: 'current',
|
show: 'current',
|
||||||
limit: 10,
|
limit: 10,
|
||||||
stateFilter: []
|
stateFilter: [],
|
||||||
|
useTimeRange: false
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
@ -71,6 +72,11 @@ class AlertListPanel extends PanelCtrl {
|
|||||||
newState: this.panel.stateFilter
|
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)
|
this.backendSrv.get(`/api/annotations`, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.alertHistory = _.map(res, al => {
|
this.alertHistory = _.map(res, al => {
|
||||||
|
Loading…
Reference in New Issue
Block a user