dashboard: support multiple checktype badges
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user