From 7410cf4d72106f1ab1c0f109ffac16e9cedbb4b9 Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 6 Apr 2026 22:05:08 -0400 Subject: [PATCH] Click gps tile to open map --- client/public/notification-bar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/public/notification-bar.js b/client/public/notification-bar.js index 662ef51..beb146c 100644 --- a/client/public/notification-bar.js +++ b/client/public/notification-bar.js @@ -32,9 +32,7 @@ class DashboardHeader extends HTMLElement { const requestStart = performance.now(); const response = await fetch('/api/status'); const requestEnd = performance.now(); - if (!response.ok) throw new Error('Status fetch failed'); - const status = await response.json(); this.statusCache = status; this.updateUI(status, requestStart, requestEnd); @@ -289,11 +287,17 @@ class DashboardHeader extends HTMLElement { const expandToggle = this.shadowRoot.getElementById('expand-toggle'); const expandIcon = this.shadowRoot.getElementById('expand-icon'); const expandedStatus = this.shadowRoot.getElementById('expanded-status'); + const gpsTile = this.shadowRoot.getElementById('gps-tile'); expandToggle.addEventListener('click', () => { expandIcon.classList.toggle('expanded'); expandedStatus.classList.toggle('visible'); }); + + gpsTile.addEventListener('click', () => { + if(this.statusCache.gps?.latitude != null) + window.open(`//${location.host}:1500/styles/dark/#14/${this.statusCache.gps.latitude}/${this.statusCache.gps.longitude}`); + }); } render() {