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

Function checkServerCapabilities

web/scripts/ragnar_modern.js:15478–15525  ·  view source on GitHub ↗

* Check server capabilities and enable advanced features if available

()

Source from the content-addressed store, hash-verified

15476
15477 if (enhancedNetworkScanInterval) {
15478 clearInterval(enhancedNetworkScanInterval);
15479 enhancedNetworkScanInterval = null;
15480 }
15481
15482 isEnhancedRealTimeScanning = false;
15483
15484 if (stopBtn && startBtn) {
15485 addConsoleMessage('Stopping enhanced network scan...', 'info');
15486 resetEnhancedScanButtons();
15487 }
15488}
15489
15490function resetEnhancedScanButtons() {
15491 const startBtn = document.getElementById('start-network-scan');
15492 const stopBtn = document.getElementById('stop-network-scan');
15493
15494 if (startBtn && stopBtn) {
15495 startBtn.disabled = false;
15496 stopBtn.disabled = true;
15497 isEnhancedRealTimeScanning = false;
15498 document.getElementById('scan-progress').classList.add('hidden');
15499 }
15500}
15501
15502async function performCombinedNetworkScan() {
15503 try {
15504 const data = await fetchAPI('/api/scan/combined-network');
15505
15506 if (data.success) {
15507 updateNetworkTableWithScanData(data);
15508 addConsoleMessage(`Network scan found ${data.count} hosts (ARP: ${data.arp_count}, Nmap: ${data.nmap_count})`, 'success');
15509 } else {
15510 addConsoleMessage(`Network scan failed: ${data.error}`, 'error');
15511 }
15512 } catch (error) {
15513 console.error('Error performing network scan:', error);
15514 addConsoleMessage(`Network scan error: ${error.message}`, 'error');
15515 }
15516}
15517
15518function updateNetworkTableWithScanData(data) {
15519 const tableBody = document.getElementById('network-hosts-table');
15520 const hostCountSpan = document.getElementById('host-count');
15521
15522 if (!tableBody) return;
15523
15524 tableBody.innerHTML = '';
15525
15526 if (!data.hosts || Object.keys(data.hosts).length === 0) {
15527 tableBody.innerHTML = `
15528 <tr>

Callers 1

ragnar_modern.jsFile · 0.70

Calls 3

addMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected