MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / setButtonState

Function setButtonState

web/scripts/ragnar_modern.js:7776–7785  ·  view source on GitHub ↗
(busy, label)

Source from the content-addressed store, hash-verified

7774 const [cls, label] = _CDP_VERDICT_STYLE[d.verdict] || _CDP_VERDICT_STYLE.unknown;
7775 let html = `<div class="mb-2 px-3 py-2 rounded border ${cls} text-sm">${label}</div>`;
7776 html += `<p class="text-xs text-gray-500 mb-2">Interface: ${escapeHtml(d.interface || '—')} · ${d.seconds}s · ${d.packet_count} CDP frame(s), ${d.speaker_count} speaker(s)${d.learned ? ' · <span class="text-gray-400">baseline learned now</span>' : ''}</p>`;
7777 if ((d.speakers || []).length) {
7778 html += '<table class="min-w-full text-xs text-gray-300 whitespace-nowrap"><thead>' +
7779 '<tr class="text-left text-gray-500"><th class="px-2 py-1">Device-ID</th><th class="px-2 py-1">Platform</th><th class="px-2 py-1">IOS / version</th><th class="px-2 py-1">Mgmt IP</th><th class="px-2 py-1">Native VLAN</th><th class="px-2 py-1">Voice VLAN</th><th class="px-2 py-1">Port</th><th class="px-2 py-1">Trust</th></tr>' +
7780 '</thead><tbody>' +
7781 d.speakers.map(sp => {
7782 const badge = sp.baseline ? '<span class="text-green-400">✓ known</span>' : '<span class="text-red-300">? new</span>';
7783 return `<tr class="border-t border-slate-800">
7784 <td class="px-2 py-1 font-mono ${sp.baseline ? 'text-gray-200' : 'text-red-300'}">${escapeHtml(sp.device_id || sp.src)}</td>
7785 <td class="px-2 py-1 text-gray-400">${escapeHtml(sp.platform || '—')}</td>
7786 <td class="px-2 py-1 text-gray-400" title="${escapeHtml(sp.sw_version || '')}">${escapeHtml((sp.sw_version || '—').slice(0, 46))}</td>
7787 <td class="px-2 py-1 font-mono text-amber-300/90">${escapeHtml(sp.mgmt_addr || '—')}</td>
7788 <td class="px-2 py-1 text-amber-300/90">${sp.native_vlan == null ? '—' : sp.native_vlan}</td>

Callers 2

autoStashAndUpdateFunction · 0.85
executeManualAttackFunction · 0.85

Calls 2

addMethod · 0.80
updateElementFunction · 0.70

Tested by

no test coverage detected