From 10a696c1498464450895686bb61ff49c94582f6b Mon Sep 17 00:00:00 2001 From: Mickey Slaven Date: Thu, 27 Aug 2026 05:08:17 -0400 Subject: [PATCH] Add ADS-B status to map displays --- html/display/map/index.html | 3 ++- html/display/maxhold/index.html | 3 ++- html/index.html | 6 +----- html/js/plot_map.js | 10 ++++++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/html/display/map/index.html b/html/display/map/index.html index 7b10e4a7..55785eef 100644 --- a/html/display/map/index.html +++ b/html/display/map/index.html @@ -16,7 +16,8 @@
-
+
● ADS-B unavailable
+
diff --git a/html/display/maxhold/index.html b/html/display/maxhold/index.html index 46d0f56c..68db3b63 100644 --- a/html/display/maxhold/index.html +++ b/html/display/maxhold/index.html @@ -16,7 +16,8 @@
-
+
● ADS-B unavailable
+
diff --git a/html/index.html b/html/index.html index 62f2fcfd..d015ea9d 100644 --- a/html/index.html +++ b/html/index.html @@ -32,11 +32,7 @@ -
-

-

-
-
+ ● ADS-B unavailable
diff --git a/html/js/plot_map.js b/html/js/plot_map.js index 2135ad24..7961a482 100644 --- a/html/js/plot_map.js +++ b/html/js/plot_map.js @@ -5,6 +5,10 @@ var isLocalHost = is_localhost(host); var range_x = []; var range_y = []; +function updateAdsbStatus(status, colour) { + $('#adsb-status').removeClass('text-success text-danger text-secondary').addClass(colour).text('● ADS-B ' + status); +} + // setup API var urlTimestamp; var urlDetection; @@ -50,6 +54,8 @@ $.getJSON(urlConfig, function () { }) urlAdsb = urlAdsb.replace(/^http:/, 'https:'); } }) + } else { + updateAdsbStatus('disabled', 'text-secondary'); } }); @@ -133,6 +139,7 @@ var intervalId = window.setInterval(function () { if (isTruth) { $.getJSON(urlAdsb, function () { }) .done(function (data_adsb) { + updateAdsbStatus('live', 'text-success'); adsb['delay'] = []; adsb['doppler'] = []; adsb['flight'] = []; @@ -143,6 +150,9 @@ var intervalId = window.setInterval(function () { adsb['flight'].push(data_adsb[aircraft]['flight']) } } + }) + .fail(function () { + updateAdsbStatus('unavailable', 'text-danger'); }); }