Intermediate reload of map data if QRZ/HamQTH credentials are supplied

This commit is contained in:
Ian Renton
2026-07-25 14:43:16 +01:00
parent 4a9ff2c636
commit 4353c9ebf9
9 changed files with 37 additions and 17 deletions
+1 -1
View File
@@ -76,7 +76,7 @@
</div>
<script src="/js/add-spot.js?v=1784983394"></script>
<script src="/js/add-spot.js?v=1784986996"></script>
<script>$(document).ready(function () {
$("#nav-link-add-spot").addClass("active");
}); <!-- highlight active page in nav --></script>
+1 -1
View File
@@ -75,7 +75,7 @@
</div>
<script src="/js/alerts.js?v=1784983394"></script>
<script src="/js/alerts.js?v=1784986996"></script>
<script>$(document).ready(function () {
$("#nav-link-alerts").addClass("active");
}); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -75,8 +75,8 @@
<script>
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
</script>
<script src="/js/spotsbandsandmap.js?v=1784983394"></script>
<script src="/js/bands.js?v=1784983394"></script>
<script src="/js/spotsbandsandmap.js?v=1784986996"></script>
<script src="/js/bands.js?v=1784986996"></script>
<script>$(document).ready(function () {
$("#nav-link-bands").addClass("active");
}); <!-- highlight active page in nav --></script>
+5 -5
View File
@@ -1,6 +1,6 @@
{% extends "skeleton.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/css/style.css?v=1784983394" type="text/css">
<link rel="stylesheet" href="/css/style.css?v=1784986996" type="text/css">
<link href="/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
<link href="/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
<link href="/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
@@ -10,10 +10,10 @@
<script src="/vendor/js/bootstrap-5.3.8.bundle.min.js"></script>
<script src="/vendor/js/tinycolor2-1.6.0.min.js"></script>
<script src="/js/utils.js?v=1784983394"></script>
<script src="/js/ui-ham.js?v=1784983394"></script>
<script src="/js/geo.js?v=1784983394"></script>
<script src="/js/common.js?v=1784983394"></script>
<script src="/js/utils.js?v=1784986996"></script>
<script src="/js/ui-ham.js?v=1784986996"></script>
<script src="/js/geo.js?v=1784986996"></script>
<script src="/js/common.js?v=1784986996"></script>
{% end %}
{% block body %}
<div class="container">
+1 -1
View File
@@ -284,7 +284,7 @@
</div>
<script src="/vendor/js/chart-4.4.9.umd.min.js"></script>
<script src="/js/conditions.js?v=1784983394"></script>
<script src="/js/conditions.js?v=1784986996"></script>
<script>$(document).ready(function () {
$("#nav-link-conditions").addClass("active");
}); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -95,8 +95,8 @@
<script>
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
</script>
<script src="/js/spotsbandsandmap.js?v=1784983393"></script>
<script src="/js/map.js?v=1784983393"></script>
<script src="/js/spotsbandsandmap.js?v=1784986996"></script>
<script src="/js/map.js?v=1784986996"></script>
<script>$(document).ready(function () {
$("#nav-link-map").addClass("active");
}); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -116,8 +116,8 @@
<script>
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
</script>
<script src="/js/spotsbandsandmap.js?v=1784983393"></script>
<script src="/js/spots.js?v=1784983393"></script>
<script src="/js/spotsbandsandmap.js?v=1784986996"></script>
<script src="/js/spots.js?v=1784986996"></script>
<script>$(document).ready(function () {
$("#nav-link-spots").addClass("active");
}); <!-- highlight active page in nav --></script>
+1 -1
View File
@@ -59,7 +59,7 @@
</div>
</div>
<script src="/js/status.js?v=1784983394"></script>
<script src="/js/status.js?v=1784986996"></script>
<script>
$(document).ready(function () {
$("#nav-link-status").addClass("active");
+22 -2
View File
@@ -38,8 +38,13 @@ function loadSpots() {
if (evtSource != null) {
evtSource.close();
}
// On first fetch, don't include QRZ/HamQTH credentials. This will cause some inaccurate
// marker positions but avoids having to wait a minute or more for all the lookups to fire.
// Including QRZ/HamQTH lookups to improve positions causes the load to be really slow, so on first load
// the user would be waiting ages without data and will think it's broken. We therefore load in several
// stages:
// 1) Load without any credentials
// 2) (If we have credentials) reload with them, replacing what's already there,
// 3) Subscribe to the SSE endpoint (with credentials if we have them) so that updates come with augmented
// data if they can.
$.getJSON('/api/v1/spots' + buildQueryString(false), function (jsonData) {
// Store data
spots = jsonData;
@@ -48,6 +53,21 @@ function loadSpots() {
if ($("#showTerminator")[0].checked) {
terminator.setTime();
}
// Check if we have any credentials to use
if (getCredentialQueryString() !== "") {
// OK, we have credentials and have loaded once without them so the user has a basic map. Now reload
// with the credentials and replace what's on the map, so we can improve the data.
$.getJSON('/api/v1/spots' + buildQueryString(true), function (jsonData2) {
spots = jsonData2;
updateMap();
// Now start the ongoing SSE connection
startSSEConnection();
});
} else {
// We had no credentials with which to augment the data anyway, so just start the SSE connection
// now
startSSEConnection();
}
// Start the ongoing SSE connection
startSSEConnection();
});