* Toggle scan form auth fields based on selected auth type
()
| 20571 | const ip = iface.ip_address || '—'; |
| 20572 | return `<div class="flex justify-between"><span>${iface.name}</span><span>${ip}</span><span class="${statusColor}">${statusText}</span></div>`; |
| 20573 | }).join(''); |
| 20574 | listEl.classList.remove('hidden'); |
| 20575 | } |
| 20576 | } catch (e) { |
| 20577 | if (indicator) { |
| 20578 | indicator.className = 'text-sm px-2 py-1 rounded bg-red-900/50 text-red-400'; |
| 20579 | indicator.textContent = 'Error'; |
| 20580 | } |
| 20581 | if (info) info.textContent = 'Failed to check Ethernet status'; |
| 20582 | } |
| 20583 | } |
| 20584 | |
| 20585 | function updateWifiStatus(message, type = '') { |
| 20586 | // This function can be enhanced to show status messages in a notification area |
| 20587 | // For now, we'll use console messages and update the UI elements |
| 20588 | addConsoleMessage(message, type === 'error' ? 'error' : type === 'ap-mode' ? 'warning' : 'info'); |
| 20589 | } |
| 20590 | |
| 20591 | // ============================================================================ |
| 20592 | // WI-FI MANAGEMENT FUNCTIONS |
| 20593 | // ============================================================================ |
| 20594 | |
| 20595 | let currentWifiNetworks = []; |
| 20596 | let selectedWifiNetwork = null; |
| 20597 | const WIFI_INTERFACE_STORAGE_KEY = 'wifi-selected-interface'; |
| 20598 | let selectedWifiInterface = null; |
| 20599 | let wifiInterfaceMetadata = []; |
| 20600 | const WIFI_NETWORK_CACHE_KEY_DEFAULT = '__default__'; |
| 20601 | const wifiNetworkResultCache = new Map(); |
| 20602 | let wifiMultiInterfaceState = null; |
| 20603 | const DASHBOARD_STATS_CACHE_TTL = 4000; |
| 20604 | let dashboardStatsCache = { key: null, timestamp: 0, data: null }; |
| 20605 | let dashboardStatsRequestState = null; |
| 20606 | |
| 20607 | function slugifyNetworkIdentifier(value) { |
| 20608 | if (!value) { |
| 20609 | return null; |
| 20610 | } |
| 20611 | let normalized = value; |
| 20612 | if (typeof normalized.normalize === 'function') { |
| 20613 | normalized = normalized.normalize('NFKD'); |
| 20614 | } |
| 20615 | normalized = normalized.replace(/[\u0300-\u036f]/g, ''); |
| 20616 | normalized = normalized.replace(/[^A-Za-z0-9]+/g, '_'); |
| 20617 | normalized = normalized.replace(/^_+|_+$/g, ''); |
| 20618 | normalized = normalized.toLowerCase(); |
| 20619 | return normalized || null; |
| 20620 | } |
| 20621 | |
| 20622 | function normalizeInterfaceMetadata(entries) { |
| 20623 | if (!Array.isArray(entries)) { |
| 20624 | return []; |
| 20625 | } |
| 20626 | return entries.map(entry => { |
| 20627 | if (!entry || typeof entry !== 'object') { |
| 20628 | return entry; |
| 20629 | } |
| 20630 | if (entry.network_slug) { |