app: Sync status dots with Ethernet uplink state

Default the Ethernet and hotspot badges to the offline dot and update
the Ethernet dot to active when the uplink is up, so its colour tracks
the actual connection state instead of the initial markup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-06-10 18:05:54 +09:00
commit 3e66ae200e
2 changed files with 5 additions and 2 deletions

View file

@ -286,11 +286,14 @@ function updateStatusDisplay(status) {
// Update Ethernet uplink badge // Update Ethernet uplink badge
const ethernetStatus = document.getElementById('ethernetStatus'); const ethernetStatus = document.getElementById('ethernetStatus');
const ethernetDot = ethernetStatus.querySelector('.status-dot');
const ethernetText = ethernetStatus.querySelector('.status-text'); const ethernetText = ethernetStatus.querySelector('.status-text');
if (status.ethernetStatus?.active) { if (status.ethernetStatus?.active) {
ethernetDot.className = 'status-dot active';
ethernetText.textContent = `Ethernet · ${status.ethernetStatus.ipv4 || status.ethernetStatus.interface}`; ethernetText.textContent = `Ethernet · ${status.ethernetStatus.ipv4 || status.ethernetStatus.interface}`;
ethernetStatus.hidden = false; ethernetStatus.hidden = false;
} else { } else {
ethernetDot.className = 'status-dot offline';
ethernetStatus.hidden = true; ethernetStatus.hidden = true;
} }

View file

@ -26,11 +26,11 @@
<span class="status-text">Disconnected</span> <span class="status-text">Disconnected</span>
</div> </div>
<div class="status-badge" id="ethernetStatus" hidden> <div class="status-badge" id="ethernetStatus" hidden>
<span class="status-dot active"></span> <span class="status-dot offline"></span>
<span class="status-text">Ethernet</span> <span class="status-text">Ethernet</span>
</div> </div>
<div class="status-badge" id="hotspotStatus"> <div class="status-badge" id="hotspotStatus">
<span class="status-dot active"></span> <span class="status-dot offline"></span>
<span class="status-text">Hotspot actif</span> <span class="status-text">Hotspot actif</span>
</div> </div>
</div> </div>