dashboard: support multiple checktype badges
All checks were successful
CI / syntax-check (push) Successful in 2s
CI / memory-leak-check (push) Successful in 10s

This commit is contained in:
Username
2025-12-26 19:34:23 +01:00
parent adbe20dae3
commit 59fe2c4a14
2 changed files with 13 additions and 7 deletions

View File

@@ -267,12 +267,18 @@ function update(d) {
if (sslBadge) {
sslBadge.style.display = d.use_ssl ? 'inline-block' : 'none';
}
// Check type badge (fallback/secondary indicator)
var ct = d.checktype || 'unknown';
var ctBadge = $('checktypeBadge');
if (ctBadge) {
ctBadge.textContent = ct.toUpperCase();
ctBadge.className = 'mode-badge mode-' + ct;
// Check type badges (multiple supported)
var ctContainer = $('checktypeBadges');
if (ctContainer) {
var checktypes = (d.checktype || 'unknown').split(',');
var badgeColors = {judges: 'blu', head: 'grn', ssl: 'cyn', irc: 'pur', unknown: 'dim'};
var html = '';
checktypes.forEach(function(ct) {
ct = ct.trim();
var color = badgeColors[ct] || 'dim';
html += '<span class="mode-badge mode-' + ct + '" style="background:var(--' + color + ');margin-right:4px">' + ct.toUpperCase() + '</span>';
});
ctContainer.innerHTML = html;
}
// Profiling badge
var profBadge = $('profileBadge');