From 706bcee2fdc7e86362ae189048a1dbb899eee7df Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Tue, 25 Oct 2022 23:14:21 +0200 Subject: [PATCH] ignore paused Uptime Kuma services --- src/components/services/UptimeKuma.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/services/UptimeKuma.vue b/src/components/services/UptimeKuma.vue index 55232af..80de6de 100644 --- a/src/components/services/UptimeKuma.vue +++ b/src/components/services/UptimeKuma.vue @@ -51,7 +51,9 @@ export default { for (let id in this.heartbeat.heartbeatList) { let index = this.heartbeat.heartbeatList[id].length - 1; - result[id] = this.heartbeat.heartbeatList[id][index]; + if (index >= 0) { + result[id] = this.heartbeat.heartbeatList[id][index]; + } } return result; @@ -106,7 +108,10 @@ export default { if (!this.heartbeat) { return 0; } - const data = Object.values(this.heartbeat.uptimeList); + let data = []; + for (let id in this.lastHeartBeatList) { + data.push(this.heartbeat.uptimeList[id + "_24"]); + } const percent = data.reduce((a, b) => a + b, 0) / data.length || 0; return (percent * 100).toFixed(1); },