feat(dashboard): show Pi IP banner when connected to phone hotspot

- Banner appears on dashboard only when uplink mode is 'phone'
- Shows the Pi's current IP so you can reach it from your phone's browser
- Polls every 15s, hides automatically when not on phone hotspot

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 03:06:39 -04:00
co-authored by Copilot
parent 9f9974e197
commit a6c6cddf30
2 changed files with 26 additions and 0 deletions
+21
View File
@@ -326,3 +326,24 @@ window.setInterval(function () {
message.hidden = false;
});
}, 30000);
// ── Phone hotspot banner ───────────────────────────────────────────────────
(function () {
const banner = document.getElementById('phone-hotspot-banner');
const ipEl = document.getElementById('phone-hotspot-ip');
function checkUplink() {
fetch('/api/uplink/status')
.then(r => r.ok ? r.json() : null)
.then(s => {
if (s && s.mode === 'phone' && s.ip_address) {
ipEl.textContent = `http://${s.ip_address}/`;
banner.hidden = false;
} else {
banner.hidden = true;
}
})
.catch(() => { banner.hidden = true; });
}
checkUplink();
window.setInterval(checkUplink, 15000);
})();