[Perl] DAQ system for the FAPG.
fix hide status pill on quick cards unless error
Only show the status pill text for actual errors (probe-error). For healthy, stale, or unreachable states the pill is hidden entirely — the card greying is sufficient visual feedback.
roles/dashboard/public/js/dashboard/status.js
@@ -87,10 +87,10 @@
87
87
88
88
function quickCardLabel(state) {
89
89
return {
90
Removed:
healthy: "OK",
91
Removed:
stale: "Stale",
90
Added:
healthy: "",
91
Added:
stale: "",
92
92
"probe-error": "Error",
93
Removed:
unreachable: "Stale",
93
Added:
unreachable: "",
94
94
unknown: ""
95
95
}[state] || "";
96
96
}
@@ -102,10 +102,11 @@
102
102
pills.forEach(pill => {
103
103
const probe = pill.dataset.readingQuickStatus;
104
104
const state = stateForNodeStatus(statuses[probe] || null);
105
Removed:
// Use 'stale' styling for unreachable on quick cards (less alarming)
106
105
const displayState = state === "unreachable" ? "stale" : state;
106
Added:
const label = quickCardLabel(state);
107
107
pill.className = `status-pill is-${displayState}`;
108
Removed:
pill.textContent = quickCardLabel(state);
108
Added:
pill.textContent = label;
109
Added:
pill.hidden = !label;
109
110
});
110
111
}
111
112