From dd325cefc36412c0cfb2bcf834529abccc2f4477 Mon Sep 17 00:00:00 2001 From: smit95tpatel Date: Wed, 15 Dec 2021 17:20:24 +0530 Subject: [PATCH] refactored code for naming convention and fixed some style --- .vscode/settings.json | 3 +- frontend/src/API.js | 6 +- .../Dashboard/DashboardDowntimes.vue | 73 +++---- .../components/Dashboard/DowntimesList.vue | 1 + .../src/components/Dashboard/EditDowntime.vue | 57 +++++ .../src/components/Elements/Pagination.vue | 1 + frontend/src/forms/Downtime.vue | 10 + frontend/src/forms/DowntimeFilters.vue | 199 +++++++++--------- frontend/src/languages/english.js | 1 + frontend/src/routes.js | 10 +- frontend/src/store.js | 2 +- 11 files changed, 221 insertions(+), 142 deletions(-) create mode 100644 frontend/src/components/Dashboard/EditDowntime.vue create mode 100644 frontend/src/forms/Downtime.vue diff --git a/.vscode/settings.json b/.vscode/settings.json index d9986436..a6cdf116 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,6 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, - "editor.defaultFormatter": null + "editor.defaultFormatter": null, + "eslint.validate": ["javascript"] } diff --git a/frontend/src/API.js b/frontend/src/API.js index 608a6188..640bc10f 100644 --- a/frontend/src/API.js +++ b/frontend/src/API.js @@ -387,11 +387,15 @@ class Api { await axios.all([ all ]); } - async getDowntimes ({ serviceId, start, end, skip, count, subStatus }) { + async downtimes ({ serviceId, start, end, skip, count, subStatus }) { return axios.get('api/downtimes', { params: { service_id: serviceId, start, end, skip, count, sub_status: subStatus } }).then((response) => response.data); } + + async downtime (id) { + return axios.get(`api/downtimes/${id}`).then((response) => response.data); + } } const api = new Api(); export default api; diff --git a/frontend/src/components/Dashboard/DashboardDowntimes.vue b/frontend/src/components/Dashboard/DashboardDowntimes.vue index 08ce6efa..c75cebc9 100644 --- a/frontend/src/components/Dashboard/DashboardDowntimes.vue +++ b/frontend/src/components/Dashboard/DashboardDowntimes.vue @@ -1,46 +1,49 @@