From aa28237f92b836f175b65369087d114a5d1791b7 Mon Sep 17 00:00:00 2001 From: smit95tpatel Date: Mon, 20 Dec 2021 19:10:39 +0530 Subject: [PATCH] prefilled duration filter with past 30 days --- .../components/Dashboard/DashboardDowntimes.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Dashboard/DashboardDowntimes.vue b/frontend/src/components/Dashboard/DashboardDowntimes.vue index a2e9de16..3e86abbd 100644 --- a/frontend/src/components/Dashboard/DashboardDowntimes.vue +++ b/frontend/src/components/Dashboard/DashboardDowntimes.vue @@ -88,7 +88,18 @@ export default { computed: { ...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); }, methods: { @@ -151,9 +162,9 @@ export default { this.filterErrors = Object.assign({}, errors); }, handleFilterChange: function (e) { - // reset all the errors const { name } = e.target; + // reset error according to edit input delete this.filterErrors[name]; } }