diff --git a/api/index.js b/api/index.js index 82232ed..eea0d59 100644 --- a/api/index.js +++ b/api/index.js @@ -6267,11 +6267,16 @@ function handleIpBansResponse(responseData) { document.getElementById('ip-bans-active').textContent = currentlyBanned; document.getElementById('ip-bans-issued').textContent = totalBans; + // Get whitelist for display + const whitelistStr = (currentConfig && currentConfig.idle_ban_whitelist) || ''; + const whitelistedIPs = new Set(whitelistStr.split(',').map(s => s.trim()).filter(s => s.length > 0)); + // Render table const tbody = document.getElementById('ip-bans-tbody'); tbody.innerHTML = filteredResults.map(row => { const isBanned = row.banned_until > now; - const status = isBanned ? '🔴 Banned' : (row.ban_count > 0 ? '🟡 Expired' : '🟢 Clean'); + const isWhitelisted = whitelistedIPs.has(row.ip); + const status = isWhitelisted ? '⭐ Whitelisted' : (isBanned ? '🔴 Banned' : (row.ban_count > 0 ? '🟡 Expired' : '🟢 Clean')); const bannedUntil = row.banned_until > 0 ? new Date(row.banned_until * 1000).toLocaleString() : '-'; const failures = row.total_failures || 0; const authedSuccessfully = row.has_authed_successfully ? '✅ Yes' : '❌ No'; @@ -6285,7 +6290,7 @@ function handleIpBansResponse(responseData) {