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

Function startOrchestrator

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

Source from the content-addressed store, hash-verified

11308 hostArray.forEach(host => {
11309 const row = document.createElement('tr');
11310 row.className = 'border-b border-slate-700 hover:bg-slate-700/50 transition-colors';
11311
11312 // Determine status indicator
11313 const statusIcon = host.status === 'up' ?
11314 '<span class="flex items-center"><div class="w-2 h-2 bg-green-500 rounded-full mr-2"></div>Online</span>' :
11315 '<span class="flex items-center"><div class="w-2 h-2 bg-red-500 rounded-full mr-2"></div>Offline</span>';
11316
11317 // Format MAC address with vendor info
11318 let macDisplay = host.mac || 'Unknown';
11319 if (host.vendor) {
11320 macDisplay += `<br><span class="text-xs text-gray-400">${host.vendor}</span>`;
11321 }
11322
11323 // Get source indicator
11324 const sourceIcon = {
11325 'arp': '<span class="text-xs px-2 py-1 bg-blue-600 rounded">ARP</span>',
11326 'nmap': '<span class="text-xs px-2 py-1 bg-purple-600 rounded">NMAP</span>',
11327 'arp+nmap': '<span class="text-xs px-2 py-1 bg-green-600 rounded">ARP+NMAP</span>'
11328 }[host.source] || '';
11329
11330 row.innerHTML = `
11331 <td class="py-3 px-4">${statusIcon}</td>
11332 <td class="py-3 px-4 font-mono text-sm">${host.ip}</td>
11333 <td class="py-3 px-4">${host.hostname || 'Unknown'}</td>
11334 <td class="py-3 px-4 font-mono text-xs">${macDisplay}</td>
11335 <td class="py-3 px-4">
11336 <span class="text-xs px-2 py-1 bg-gray-600 rounded">Scanning...</span>
11337 </td>
11338 <td class="py-3 px-4">
11339 <span class="text-xs px-2 py-1 bg-gray-600 rounded">Checking...</span>
11340 </td>
11341 <td class="py-3 px-4 text-sm text-gray-400">${new Date().toLocaleTimeString()}</td>
11342 <td class="py-3 px-4">
11343 <div class="flex space-x-2">
11344 ${sourceIcon}
11345 <button onclick="scanSingleHostEnhanced('${host.ip}')"
11346 class="text-xs px-2 py-1 bg-Ragnar-600 hover:bg-Ragnar-700 rounded transition-colors">
11347 Scan
11348 </button>
11349 </div>
11350 </td>
11351 `;
11352
11353 tableBody.appendChild(row);
11354 });
11355
11356 // Update host count
11357 if (hostCountSpan) {
11358 hostCountSpan.textContent = `${hostArray.length} hosts`;
11359 }
11360}

Callers 1

handleAutomationToggleFunction · 0.70

Calls 4

addMethod · 0.80
addConsoleMessageFunction · 0.70
postAPIFunction · 0.70
updateElementFunction · 0.70

Tested by

no test coverage detected