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:
parent
92b6113d72
commit
3e66ae200e
2 changed files with 5 additions and 2 deletions
|
|
@ -286,11 +286,14 @@ function updateStatusDisplay(status) {
|
|||
|
||||
// Update Ethernet uplink badge
|
||||
const ethernetStatus = document.getElementById('ethernetStatus');
|
||||
const ethernetDot = ethernetStatus.querySelector('.status-dot');
|
||||
const ethernetText = ethernetStatus.querySelector('.status-text');
|
||||
if (status.ethernetStatus?.active) {
|
||||
ethernetDot.className = 'status-dot active';
|
||||
ethernetText.textContent = `Ethernet · ${status.ethernetStatus.ipv4 || status.ethernetStatus.interface}`;
|
||||
ethernetStatus.hidden = false;
|
||||
} else {
|
||||
ethernetDot.className = 'status-dot offline';
|
||||
ethernetStatus.hidden = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@
|
|||
<span class="status-text">Disconnected</span>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue