diff --git a/app/public/dashboard-settings.html b/app/public/dashboard-settings.html
index a7d0b98..3ce3365 100644
--- a/app/public/dashboard-settings.html
+++ b/app/public/dashboard-settings.html
@@ -162,6 +162,18 @@ button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
+
+
Data
@@ -423,6 +435,35 @@ checkKeyStatus();
loadThresholds();
loadStationName();
loadLocation();
+
+// ── NWS reference station ──────────────────────────────────────────────
+async function loadNwsInfo() {
+ try {
+ const r = await fetch('/api/nws/config');
+ if (!r.ok) return;
+ const c = await r.json();
+ const zipEl = document.getElementById('nwsZip');
+ if (zipEl && !zipEl.value) zipEl.value = c.zip || '';
+ const res = c.resolved;
+ const when = (t) => t ? new Date(t).toLocaleString([], { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : '—';
+ document.getElementById('nwsInfo').innerHTML = res
+ ? `Station
${res.stationId} — ${res.stationName} · ${res.distanceMi ?? '?'} mi from ZIP ${res.zip}${res.place ? ' (' + res.place + ')' : ''}${res.approx ? ' ·
approximate ZIP location' : ''}
${c.observations.toLocaleString()} observations logged · first ${when(c.firstObservation)} · latest ${when(c.lastObservation)}${c.lastError ? '
Last error: ' + c.lastError + '' : ''}`
+ : (c.lastError ? `
${c.lastError}` : 'Looking up the station for this ZIP…');
+ } catch {}
+}
+document.getElementById('saveNwsBtn')?.addEventListener('click', async () => {
+ const msg = document.getElementById('nwsMsg'), zip = document.getElementById('nwsZip').value.trim();
+ msg.textContent = 'Looking up…'; msg.className = 'save-msg';
+ try {
+ const r = await fetch('/api/nws/config', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ zip }) });
+ const d = await r.json();
+ if (!r.ok) throw new Error(d.error || 'Failed');
+ msg.textContent = 'Saved — logging has started'; await loadNwsInfo();
+ setTimeout(loadNwsInfo, 4000);
+ } catch (e) { msg.textContent = e.message; msg.className = 'save-msg err'; }
+ setTimeout(() => { msg.textContent = ''; }, 6000);
+});
+loadNwsInfo();