From 998b394d2cf6472c839077623cf58b60f5239328 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 26 Jun 2026 09:09:15 +0100 Subject: [PATCH] Update map and bands pages to use SSE endpoint after initial load. Closes #43. --- .idea/spothole.iml | 1 + README.md | 6 +- templates/add_spot.html | 2 +- templates/alerts.html | 2 +- templates/bands.html | 8 +-- templates/base.html | 10 +-- templates/conditions.html | 2 +- templates/map.html | 4 +- templates/spots.html | 4 +- templates/status.html | 2 +- webassets/js/alerts.js | 23 ++++++ webassets/js/bands.js | 84 +++++++++++++++++----- webassets/js/common.js | 23 ------ webassets/js/map.js | 148 +++++++++++++++++++++++++++++++------- 14 files changed, 234 insertions(+), 85 deletions(-) diff --git a/.idea/spothole.iml b/.idea/spothole.iml index 803561c..347b546 100644 --- a/.idea/spothole.iml +++ b/.idea/spothole.iml @@ -2,6 +2,7 @@ + diff --git a/README.md b/README.md index a49b3b6..40da6e2 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,9 @@ Various approaches exist to writing your own client, but in general: `https://spothole.app/api/v1/spots` once every few minutes. Apply filters if necessary. * Call the "options" API to get an idea of which bands, modes etc. the server knows about. You might want to do that first before calling the spots/alerts APIs, to allow you to populate your filters correctly. -* Refer to the provided HTML/JS interface for a reference on different approaches. For example, the "map" and "bands" - pages simply query the main spot API on a timer, whereas the main/spots page combines this approach with using the - Server-Sent Events (SSE) endpoint to update live. +* Refer to the provided HTML/JS interface for a reference on different approaches. For example, the "alerts"/"upcoming" + page simply query the main spot API on a timer, whereas the spots, map and bands pages combine this approach with + using the Server-Sent Events (SSE) endpoint to update live. * Let me know if you get stuck, I'm happy to help. Please don't hammer the API with an unnecessarily high request rate. For example, Spothole only queries the POTA API diff --git a/templates/add_spot.html b/templates/add_spot.html index 0b6bfe9..d8d0ba5 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index f3720ca..e4847ed 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 758c822..04ea125 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -3,9 +3,7 @@
-
- {% module Template("widgets/refresh-timer.html", web_ui_options=web_ui_options) %} -
+
{% module Template("widgets/filters-display-data-buttons.html", web_ui_options=web_ui_options) %} @@ -77,8 +75,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 375148b..e4145a8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 3aea838..163ec3f 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index a21d7bf..410aab1 100644 --- a/templates/map.html +++ b/templates/map.html @@ -95,8 +95,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index 4b26010..10426e6 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index 3e8cfd9..101151c 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@
- +