diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js index 6901d16..03bf7cb 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js @@ -18,12 +18,50 @@ window.onDecoderRegistryReady = function (fn) { window.decoderRegistry = decoderRegistry; for (const fn of _decoderRegistryReadyCallbacks) fn(); _decoderRegistryReadyCallbacks.length = 0; + hideUnsupportedDecoderTabs(); } } catch (e) { console.error("Failed to fetch decoder registry:", e); } })(); +/** Hide decoder sub-tabs, panels, about rows, and settings buttons + * for decoders not present in the server's registry. */ +function hideUnsupportedDecoderTabs() { + const knownIds = new Set(decoderRegistry.map(function (d) { return d.id; })); + // Sub-tabs that are not decoders and should always be visible. + const alwaysShow = new Set(["overview", "rds", "sat"]); + document.querySelectorAll("#tab-digital-modes > .sub-tab-bar > .sub-tab[data-subtab]").forEach(function (btn) { + const id = btn.dataset.subtab; + if (alwaysShow.has(id) || knownIds.has(id)) return; + btn.style.display = "none"; + var panel = document.getElementById("subtab-" + id); + if (panel) panel.style.display = "none"; + }); + // About-tab decoder status rows: LABEL + document.querySelectorAll('[id^="about-dec-"]').forEach(function (el) { + var id = el.id.replace("about-dec-", ""); + if (!alwaysShow.has(id) && !knownIds.has(id)) { + var row = el.closest("tr"); + if (row) row.style.display = "none"; + } + }); + // Settings clear-history buttons + document.querySelectorAll('[id^="settings-clear-"][id$="-history"]').forEach(function (el) { + var m = el.id.match(/^settings-clear-(.+)-history$/); + if (m && !alwaysShow.has(m[1]) && !knownIds.has(m[1])) { + el.style.display = "none"; + } + }); + // Overview decoder descriptions + document.querySelectorAll("#subtab-overview .plugin-item[data-decoder]").forEach(function (el) { + var id = el.dataset.decoder; + if (!alwaysShow.has(id) && !knownIds.has(id)) { + el.style.display = "none"; + } + }); +} + // --- Persistent settings (localStorage) --- const STORAGE_PREFIX = "trx_"; function saveSetting(key, value) { diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html index 452dce9..a6badcc 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html @@ -539,61 +539,61 @@
-
+
AIS Decoder
Decodes dual-channel AIS traffic from RX audio using 9.6 kbit/s GMSK and HDLC.
-
+
VDES Decoder
Decodes single-channel 100 kHz VDES bursts from SDR IQ using the dedicated VDES path.
-
+
APRS Decoder
Decodes APRS packets from RX audio using Bell 202 AFSK (1200 baud).
-
+
CW Decoder
Decodes CW (Morse code) from RX audio.
-
+
FT8 Decoder
Decodes FT8 messages from RX audio (DIG/USB only, toggle required).
-
+
FT4 Decoder
Decodes FT4 messages from RX audio (DIG/USB only, toggle required). 7.5-second slots.
-
+
FT2 Decoder
Decodes FT2 messages from RX audio (DIG/USB only, toggle required). 3.75-second slots.
-
+
WSPR Decoder
Decodes WSPR messages from RX audio (DIG/USB only, toggle required).
-
+
RDS Decoder
Decodes Radio Data System (RDS) metadata from WFM broadcasts (57 kHz subcarrier).
-
+
Weather Satellite Decoder
Decodes Meteor-M LRPT (137 MHz QPSK) weather satellite imagery.