From 190e50e2f307b2a24f8add1a4f43baa69fac2fbf Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Mon, 11 Aug 2025 22:15:16 -0500 Subject: [PATCH] add debugging information to forecast info box --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- server/scripts/index.mjs | 2 ++ server/scripts/modules/navigation.mjs | 6 ++++-- views/index.ejs | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3666fce..26af634 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,4 +11,4 @@ Please do not report issues with api.weather.gov being down. It's a new service Please include: * Web browser and OS -* Location for which you are viewing a forecast +* Forecast Information text block from the very bottom of the web page diff --git a/server/scripts/index.mjs b/server/scripts/index.mjs index 2ec7fb3..448aa7e 100644 --- a/server/scripts/index.mjs +++ b/server/scripts/index.mjs @@ -145,6 +145,8 @@ const init = async () => { document.querySelector('#spanStationId').innerHTML = ''; document.querySelector('#spanRadarId').innerHTML = ''; document.querySelector('#spanZoneId').innerHTML = ''; + document.querySelector('#spanOfficeId').innerHTML = ''; + document.querySelector('#spanGridPoint').innerHTML = ''; localStorage.removeItem('play'); postMessage('navButton', 'play'); diff --git a/server/scripts/modules/navigation.mjs b/server/scripts/modules/navigation.mjs index 1fe9e9c..8a2b5ea 100644 --- a/server/scripts/modules/navigation.mjs +++ b/server/scripts/modules/navigation.mjs @@ -111,7 +111,7 @@ const getWeather = async (latLon, haveDataCallback) => { weatherParameters.stations = stations.features; // update the main process for display purposes - populateWeatherParameters(weatherParameters); + populateWeatherParameters(weatherParameters, point.properties); // reset the scroll postMessage({ type: 'current-weather-scroll', method: 'reload' }); @@ -753,12 +753,14 @@ const registerProgress = (_progress) => { progress = _progress; }; -const populateWeatherParameters = (params) => { +const populateWeatherParameters = (params, point) => { document.querySelector('#spanCity').innerHTML = `${params.city}, `; document.querySelector('#spanState').innerHTML = params.state; document.querySelector('#spanStationId').innerHTML = params.stationId; document.querySelector('#spanRadarId').innerHTML = params.radarId; document.querySelector('#spanZoneId').innerHTML = params.zoneId; + document.querySelector('#spanOfficeId').innerHTML = point.cwa; + document.querySelector('#spanGridPoint').innerHTML = `${point.gridX},${point.gridY}`; }; const latLonReceived = (data, haveDataCallback) => { diff --git a/views/index.ejs b/views/index.ejs index bb66069..5b39f21 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -191,6 +191,8 @@ Station Id:
Radar Id:
Zone Id:
+ Office Id:
+ Grid X,Y:
Music: Not playing
Ws4kp Version: <%- version %> @@ -198,4 +200,4 @@ - + \ No newline at end of file