mirror of https://github.com/statping/statping
prefilled duration filter with past 30 days
parent
77372b4f35
commit
aa28237f92
|
@ -88,7 +88,18 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([ 'downtimes' ]),
|
...mapState([ 'downtimes' ]),
|
||||||
},
|
},
|
||||||
async mounted () {
|
created: function () {
|
||||||
|
// Set start date
|
||||||
|
const startDate = new Date();
|
||||||
|
startDate.setDate(-10);
|
||||||
|
startDate.setHours(0,0,0,0);
|
||||||
|
this.params.start = startDate.toJSON();
|
||||||
|
|
||||||
|
// Set end date
|
||||||
|
const endDate = new Date();
|
||||||
|
endDate.setHours(0,0,0,0);
|
||||||
|
this.params.end = endDate.toJSON();
|
||||||
|
|
||||||
this.getDowntimes(this.params);
|
this.getDowntimes(this.params);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -151,9 +162,9 @@ export default {
|
||||||
this.filterErrors = Object.assign({}, errors);
|
this.filterErrors = Object.assign({}, errors);
|
||||||
},
|
},
|
||||||
handleFilterChange: function (e) {
|
handleFilterChange: function (e) {
|
||||||
// reset all the errors
|
|
||||||
const { name } = e.target;
|
const { name } = e.target;
|
||||||
|
|
||||||
|
// reset error according to edit input
|
||||||
delete this.filterErrors[name];
|
delete this.filterErrors[name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue