From 4a31a88294062759a0486704afd8fe9580d9fbc5 Mon Sep 17 00:00:00 2001 From: "Martin, Alexander Scott" Date: Tue, 3 Sep 2024 14:09:48 -0400 Subject: [PATCH] fix IT status when empty --- tdx-enhanced.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 75176d6..018bc34 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -844,7 +844,19 @@ let statusTime = statusLink.querySelector("#statusTime") let statusText = statusLink.querySelector("#statusText") - if (statusData && statusData.msg != "All Systems Operational") { + let operationalText = "All Systems Operational" + + if (statusData) { + if (statusData.msg.length==0) { + statusData.msg = operationalText + } + } else { + statusData = { + msg: operationalText + } + } + + if (!statusData.msg == operationalText) { statusIcon.classList = ("fa-solid fa-triangle-exclamation") } else { statusIcon.classList = ("fa-solid fa-check")