dashboard: support multiple checktype badges
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<h1>PPF Dashboard <a href="/map" style="font-size:12px;font-weight:normal;color:var(--dim);margin-left:12px">Map</a> <a href="/mitm" style="font-size:12px;font-weight:normal;color:var(--dim);margin-left:8px">MITM Search</a></h1>
|
||||
<div class="status">
|
||||
<span class="mode-badge mode-ssl" id="sslBadge" style="display:none">SSL</span>
|
||||
<span class="mode-badge mode-judges" id="checktypeBadge">-</span>
|
||||
<span id="checktypeBadges"></span>
|
||||
<span class="mode-badge mode-profile" id="profileBadge" style="display:none">PROFILING</span>
|
||||
<div class="status-item"><div class="dot" id="dot"></div><span id="statusTxt">Connecting</span></div>
|
||||
<div class="status-item">Updated: <span id="lastUpdate">-</span></div>
|
||||
|
||||
@@ -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