--
This commit is contained in:
@@ -7,24 +7,15 @@
|
||||
const logEl = document.getElementById("tls-log");
|
||||
const verbEl = document.getElementById("tls-status-verb");
|
||||
|
||||
// Colors for the severity label tag. Order Good→Bad maps to
|
||||
// bright-{green,blue,yellow,red,purple}. Matches SEVERITY_COLORS in
|
||||
// schemas.py so the live log and results page render identically.
|
||||
const SEV_COLOR = {
|
||||
good: "bright-green",
|
||||
normal: "bright-blue",
|
||||
notgood: "bright-yellow",
|
||||
bad: "bright-red",
|
||||
serious: "bright-purple",
|
||||
info: "light-grey-alt",
|
||||
};
|
||||
const SEV_LABEL = {
|
||||
good: "GOOD",
|
||||
normal: "NORMAL",
|
||||
notgood: "NOT GOOD",
|
||||
bad: "BAD",
|
||||
serious: "SERIOUS",
|
||||
info: "INFO",
|
||||
// Severity label tag. Matches SEVERITY_COLORS in schemas.py so the live
|
||||
// log and results page render identically.
|
||||
const SEV = {
|
||||
good: { color: "bright-green", label: "GOOD" },
|
||||
normal: { color: "bright-blue", label: "NORMAL" },
|
||||
notgood: { color: "bright-yellow", label: "NOT GOOD" },
|
||||
bad: { color: "bright-red", label: "BAD" },
|
||||
serious: { color: "bright-purple", label: "SERIOUS" },
|
||||
info: { color: "light-grey-alt", label: "INFO" },
|
||||
};
|
||||
|
||||
let reconnectAttempts = 0;
|
||||
@@ -50,10 +41,10 @@
|
||||
|
||||
const msg = document.createElement("span");
|
||||
msg.className = "tls-log-msg";
|
||||
if (severity && SEV_LABEL[severity] && severity !== "info") {
|
||||
if (severity && SEV[severity] && severity !== "info") {
|
||||
const sev = document.createElement("span");
|
||||
sev.className = "text-" + (SEV_COLOR[severity] || "light-grey") + " font-bold";
|
||||
sev.textContent = SEV_LABEL[severity];
|
||||
sev.className = "text-" + SEV[severity].color + " font-bold";
|
||||
sev.textContent = SEV[severity].label;
|
||||
msg.appendChild(sev);
|
||||
msg.appendChild(document.createTextNode(" "));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user