From a07c1bc231eca07b19770c82b3b38cd47ccd8a5d Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Thu, 28 Apr 2022 23:17:00 +0200 Subject: [PATCH] webapp: show uptime in days as well --- webapp/src/components/partials/FirmwareInfo.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/src/components/partials/FirmwareInfo.vue b/webapp/src/components/partials/FirmwareInfo.vue index 8661ede..3467a90 100644 --- a/webapp/src/components/partials/FirmwareInfo.vue +++ b/webapp/src/components/partials/FirmwareInfo.vue @@ -55,7 +55,8 @@ export default { computed: { timeInHours() { return (value) => { - let hours = parseInt(Math.floor(value / 3600)); + let days = parseInt(Math.floor(value / 3600 / 24)); + let hours = parseInt(Math.floor((value - days * 3600 * 24) / 3600)); let minutes = parseInt(Math.floor((value - hours * 3600) / 60)); let seconds = parseInt((value - (hours * 3600 + minutes * 60)) % 60); @@ -63,7 +64,7 @@ export default { let dMins = minutes > 9 ? minutes : "0" + minutes; let dSecs = seconds > 9 ? seconds : "0" + seconds; - return dHours + ":" + dMins + ":" + dSecs; + return days + " days " + dHours + ":" + dMins + ":" + dSecs; }; }, },