fix(alertlist): remove timerange checkbox option

This commit is contained in:
bergquist 2016-09-19 10:07:53 +02:00
parent 0984edd8b2
commit 0bde2ae689
2 changed files with 5 additions and 15 deletions

View File

@ -22,15 +22,8 @@
</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">Time options</h5> <!-- <h5 class="section-heading">Current state</h5> -->
<gf-form-switch </div>
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 class="section gf-form-group" ng-if="ctrl.panel.show == 'current'"> <div class="section gf-form-group" ng-if="ctrl.panel.show == 'current'">
<!-- <h5 class="section-heading">Current state</h5> --> <!-- <h5 class="section-heading">Current state</h5> -->

View File

@ -24,8 +24,7 @@ class AlertListPanel extends PanelCtrl {
panelDefaults = { panelDefaults = {
show: 'current', show: 'current',
limit: 10, limit: 10,
stateFilter: [], stateFilter: []
useTimeRange: false
}; };
/** @ngInject */ /** @ngInject */
@ -72,10 +71,8 @@ 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.from = dateMath.parse(this.dashboard.time.from).unix() * 1000; params.to = dateMath.parse(this.dashboard.time.to).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 => {