* Edit credentials for a target (loads into form)
(targetHost)
| 20838 | if (interfaces.length === 0) { |
| 20839 | summaryEl.textContent = 'Waiting for eligible adapters...'; |
| 20840 | listEl.innerHTML = '<div class="text-xs text-gray-400 bg-slate-900/60 border border-dashed border-slate-700 rounded-lg p-3">Connect adapters to begin multi-interface scanning.</div>'; |
| 20841 | updateMultiInterfaceModeControls(state); |
| 20842 | return; |
| 20843 | } |
| 20844 | |
| 20845 | const activeCount = interfaces.filter(entry => entry.scan_enabled && entry.connected && entry.connected_ssid).length; |
| 20846 | if (scanMode === 'single') { |
| 20847 | const focusLabel = focusInterface ? escapeHtml(focusInterface) : 'Select an adapter to focus on'; |
| 20848 | const ssidTag = focusSsid ? `<span class="text-emerald-300 ml-2">${escapeHtml(focusSsid)}</span>` : ''; |
| 20849 | summaryEl.innerHTML = `Single-adapter focus: <span class="text-white font-semibold">${focusLabel}</span>${ssidTag}`; |
| 20850 | } else { |
| 20851 | summaryEl.textContent = activeCount > 0 |
| 20852 | ? `Actively scanning ${activeCount} adapter${activeCount === 1 ? '' : 's'}.` |
| 20853 | : 'All adapters are currently paused.'; |
| 20854 | } |
| 20855 | |
| 20856 | listEl.innerHTML = interfaces.map(entry => { |
| 20857 | const scanning = Boolean(entry.scan_enabled && entry.connected && entry.connected_ssid); |
| 20858 | const buttonLabel = scanning ? 'Pause Scans' : 'Resume Scans'; |
| 20859 | const buttonClasses = scanning |
| 20860 | ? 'text-xs px-3 py-1 rounded bg-yellow-600 hover:bg-yellow-500 text-white transition-colors' |
| 20861 | : 'text-xs px-3 py-1 rounded bg-green-600 hover:bg-green-500 text-white transition-colors'; |
| 20862 | const connectionLabel = entry.connected |
| 20863 | ? (entry.connected_ssid ? `SSID: ${escapeHtml(entry.connected_ssid)}` : 'Connected') |
| 20864 | : escapeHtml(entry.state || 'Disconnected'); |
| 20865 | const scanNote = scanning ? 'Scanning' : (entry.reason ? `Paused • ${formatInterfaceReason(entry.reason)}` : 'Paused'); |
| 20866 | const scanClass = scanning ? 'text-green-300' : 'text-gray-400'; |
| 20867 | const ipLabel = entry.ip_address ? ` • ${escapeHtml(entry.ip_address)}` : ''; |
| 20868 | const roleClass = entry.role === 'external' ? 'bg-indigo-900 text-indigo-200' : 'bg-slate-800 text-slate-200'; |
| 20869 | const focusChip = entry.focus_selected |
| 20870 | ? '<span class="text-[10px] px-2 py-0.5 rounded bg-amber-700/60 text-amber-200">Focus</span>' |
| 20871 | : ''; |
| 20872 | return ` |
| 20873 | <div class="border border-slate-700 rounded-lg p-3 bg-slate-900/50 flex flex-col gap-3"> |
| 20874 | <div class="flex items-center justify-between gap-3"> |
| 20875 | <div> |
| 20876 | <div class="flex items-center gap-2 text-sm font-semibold text-white"> |
nothing calls this directly
no test coverage detected