* Update the traffic direction mini chart
(bytesIn, bytesOut)
| 15837 | // Show interface list |
| 15838 | if (listEl && data.interfaces && data.interfaces.length > 0) { |
| 15839 | listEl.innerHTML = data.interfaces.map(iface => { |
| 15840 | const statusColor = iface.connected ? 'text-green-400' : iface.has_carrier ? 'text-yellow-400' : 'text-gray-500'; |
| 15841 | const statusText = iface.connected ? 'Connected' : iface.has_carrier ? 'Link Up' : 'No Link'; |
| 15842 | const ip = iface.ip_address || '—'; |
| 15843 | return `<div class="flex justify-between"><span>${iface.name}</span><span>${ip}</span><span class="${statusColor}">${statusText}</span></div>`; |
| 15844 | }).join(''); |
| 15845 | listEl.classList.remove('hidden'); |
| 15846 | } |
| 15847 | } catch (e) { |
| 15848 | if (indicator) { |
| 15849 | indicator.className = 'text-sm px-2 py-1 rounded bg-red-900/50 text-red-400'; |
| 15850 | indicator.textContent = 'Error'; |
| 15851 | } |
| 15852 | if (info) info.textContent = 'Failed to check Ethernet status'; |
| 15853 | } |
| 15854 | } |
| 15855 | |
| 15856 | function updateWifiStatus(message, type = '') { |
| 15857 | // This function can be enhanced to show status messages in a notification area |
| 15858 | // For now, we'll use console messages and update the UI elements |
| 15859 | addConsoleMessage(message, type === 'error' ? 'error' : type === 'ap-mode' ? 'warning' : 'info'); |
| 15860 | } |
| 15861 | |
| 15862 | // ============================================================================ |