diff --git a/CNAME b/CNAME index a5348b07..44250516 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -git.kuma.pet \ No newline at end of file +git.kuma.pet diff --git a/public/icon.svg b/public/icon.svg index 825c344e..9c0bc6ca 100644 --- a/public/icon.svg +++ b/public/icon.svg @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/server/model/monitor.js b/server/model/monitor.js index 115f86da..23876ac7 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -212,8 +212,7 @@ class Monitor extends BeanModel { if (await Monitor.isUnderMaintenance(this.id)) { bean.msg = "Monitor under maintenance"; bean.status = MAINTENANCE; - } - else if (this.type === "http" || this.type === "keyword") { + } else if (this.type === "http" || this.type === "keyword") { // Do not do any queries/high loading things before the "bean.ping" let startTime = dayjs().valueOf(); @@ -482,8 +481,7 @@ class Monitor extends BeanModel { if (Monitor.isImportantForNotification(isFirstBeat, previousBeat?.status, bean.status)) { log.debug("monitor", `[${this.name}] sendNotification`); await Monitor.sendNotification(isFirstBeat, this, bean); - } - else { + } else { log.debug("monitor", `[${this.name}] will not sendNotification because it is (or was) under maintenance`); } @@ -950,7 +948,7 @@ class Monitor extends BeanModel { } static async isUnderMaintenance(monitorID) { - const maintenance = await R.getRow("SELECT COUNT(*) AS count FROM monitor_maintenance mm JOIN maintenance ON mm.maintenance_id = maintenance.id WHERE mm.monitor_id = ? AND datetime(maintenance.start_date) <= datetime('now') AND datetime(maintenance.end_date) >= datetime('now') LIMIT 1", [monitorID]); + const maintenance = await R.getRow("SELECT COUNT(*) AS count FROM monitor_maintenance mm JOIN maintenance ON mm.maintenance_id = maintenance.id WHERE mm.monitor_id = ? AND datetime(maintenance.start_date) <= datetime('now') AND datetime(maintenance.end_date) >= datetime('now') LIMIT 1", [ monitorID ]); return maintenance.count !== 0; } } diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue index 4e761e77..8662dfee 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -3,8 +3,8 @@
@@ -27,39 +27,55 @@ {{ $t("No Maintenance, please") }} {{ $t("add one") }}
- -
-
-
- - {{ item.title }} + - -
-
-
- - {{ item.name }} +
@@ -282,7 +298,6 @@ export default { margin-top: 5px; } - .bg-maintenance { background-color: $maintenance; } diff --git a/src/components/Uptime.vue b/src/components/Uptime.vue index 226dfae3..d663db88 100644 --- a/src/components/Uptime.vue +++ b/src/components/Uptime.vue @@ -15,7 +15,7 @@ export default { computed: { uptime() { - + if (this.type === "maintenance") { return this.$t("Maintenance"); } @@ -31,9 +31,9 @@ export default { color() { if (this.type === "maintenance" || this.monitor.maintenance) { - return "maintenance" + return "maintenance"; } - + if (this.lastHeartBeat.status === 0) { return "danger"; } diff --git a/src/mixins/datetime.js b/src/mixins/datetime.js index 3f4749af..c6461562 100644 --- a/src/mixins/datetime.js +++ b/src/mixins/datetime.js @@ -34,10 +34,11 @@ export default { const inputDate = new Date(value); const now = new Date(Date.now()); - if (inputDate.getFullYear() === now.getUTCFullYear() && inputDate.getMonth() === now.getUTCMonth() && inputDate.getDay() === now.getUTCDay()) + if (inputDate.getFullYear() === now.getUTCFullYear() && inputDate.getMonth() === now.getUTCMonth() && inputDate.getDay() === now.getUTCDay()) { return this.datetimeFormat(value, "HH:mm"); - else + } else { return this.datetimeFormat(value, "YYYY-MM-DD HH:mm"); + } }, date(value) { diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 8d419706..6d4311b1 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -464,8 +464,7 @@ export default { text: this.$t("Maintenance"), color: "maintenance", }; - } - else if (! lastHeartBeat) { + } else if (! lastHeartBeat) { result[monitorID] = unknown; } else if (lastHeartBeat.status === 1) { result[monitorID] = { @@ -505,8 +504,7 @@ export default { if (monitor && monitor.maintenance) { result.maintenance++; - } - else if (monitor && ! monitor.active) { + } else if (monitor && ! monitor.active) { result.pause++; } else if (beat) { if (beat.status === 1) { diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue index e99422a4..207e5b3a 100644 --- a/src/pages/Dashboard.vue +++ b/src/pages/Dashboard.vue @@ -8,12 +8,12 @@
@@ -78,7 +89,7 @@