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

Function updateTrafficCaptureButton

web/scripts/ragnar_modern.js:16522–16547  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16520 currentAttackIPSearch = value.trim().toLowerCase();
16521 if (attackLogsCache) displayAttackLogs(attackLogsCache);
16522}
16523
16524function _updateAttackNetworkDropdown(networks) {
16525 const select = document.getElementById('attack-network-filter');
16526 if (!select) return;
16527 const current = select.value;
16528 // Rebuild options preserving selection
16529 select.innerHTML = '<option value="all">All Networks</option>';
16530 (networks || []).forEach(n => {
16531 const opt = document.createElement('option');
16532 opt.value = n;
16533 opt.textContent = n === 'unknown' ? 'Unknown Network' : n;
16534 if (n === current) opt.selected = true;
16535 select.appendChild(opt);
16536 });
16537}
16538
16539function _buildAttackHostBlock(ip, hostLogs) {
16540 const successCount = hostLogs.filter(l => l.status === 'success').length;
16541 const failedCount = hostLogs.filter(l => l.status === 'failed').length;
16542 const timeoutCount = hostLogs.filter(l => l.status === 'timeout').length;
16543 const safeId = ip.replace(/[^a-zA-Z0-9]/g, '-');
16544
16545 let html = `
16546 <div class="bg-slate-800 bg-opacity-50 rounded-lg border border-slate-700 overflow-hidden">
16547 <div class="px-4 py-3 bg-slate-900 bg-opacity-50 flex items-center justify-between cursor-pointer hover:bg-opacity-70 transition-colors" onclick="toggleAttackHost('${safeId}')">
16548 <div class="flex items-center space-x-3">
16549 <svg class="w-5 h-5 text-Ragnar-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
16550 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path>

Callers 2

loadTrafficAnalysisDataFunction · 0.70
toggleTrafficCaptureFunction · 0.70

Calls 1

addMethod · 0.80

Tested by

no test coverage detected