(status)
| 18045 | // Show interface list |
| 18046 | if (listEl && data.interfaces && data.interfaces.length > 0) { |
| 18047 | listEl.innerHTML = data.interfaces.map(iface => { |
| 18048 | const statusColor = iface.connected ? 'text-green-400' : iface.has_carrier ? 'text-yellow-400' : 'text-gray-500'; |
| 18049 | const statusText = iface.connected ? 'Connected' : iface.has_carrier ? 'Link Up' : 'No Link'; |
| 18050 | const ip = iface.ip_address || '—'; |
| 18051 | return `<div class="flex justify-between"><span>${iface.name}</span><span>${ip}</span><span class="${statusColor}">${statusText}</span></div>`; |
| 18052 | }).join(''); |
| 18053 | listEl.classList.remove('hidden'); |
| 18054 | } |
| 18055 | } catch (e) { |
| 18056 | if (indicator) { |
| 18057 | indicator.className = 'text-sm px-2 py-1 rounded bg-red-900/50 text-red-400'; |
| 18058 | indicator.textContent = 'Error'; |
| 18059 | } |
| 18060 | if (info) info.textContent = 'Failed to check Ethernet status'; |
| 18061 | } |
| 18062 | } |
| 18063 | |
| 18064 | function updateWifiStatus(message, type = '') { |
| 18065 | // This function can be enhanced to show status messages in a notification area |
no test coverage detected