diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 98d6854..0a499db 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1034,7 +1034,10 @@ let statusTime = statusLink.querySelector("#statusTime") let statusText = statusLink.querySelector("#statusText") - let operationalText = "All Systems Operational" + let operationalText = "All systems operational." + //check the first 5 words. do they contain operational or green? + //since the default message can vary sometimes + let operationalRegex = /^(?=(?:\w+\s){0,5}?(?:operational|green)\b(?!-))(\w+(?:\s\w+){0,5})/gm if (statusData) { if (statusData.msg.length==0) { @@ -1046,7 +1049,7 @@ } } - if (statusData.msg != operationalText) { + if (!operationalRegex.test(statusData.msg)) { statusIcon.classList = ("fa-solid fa-triangle-exclamation") } else { statusIcon.classList = ("fa-solid fa-check")