[feat](trx-client): add bandplan display config to client settings

Add bandplan_enabled (default: true) and bandplan_region (default:
"iaru_r1") fields to [frontends.http] config section, allowing the
operator to control the initial bandplan display setting from the
server config rather than requiring each browser session to configure
it manually. The server-provided default is applied on first connect
only when the user has no existing localStorage override.

https://claude.ai/code/session_01H7427hzbJepJzkoUJzoDmH
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-29 22:27:21 +00:00
committed by Stan Grams
parent 6000c30d9c
commit 8c5706f6c3
5 changed files with 77 additions and 0 deletions
@@ -3177,6 +3177,22 @@ function render(update) {
if (typeof update.show_sdr_gain_control === "boolean") {
if (sdrSettingsRowEl) sdrSettingsRowEl.style.display = update.show_sdr_gain_control ? "" : "none";
}
// Apply server-configured bandplan defaults once, only when the user has not
// previously overridden the setting via the UI (localStorage).
if (!_bandplanServerDefaultApplied && typeof update.bandplan_enabled === "boolean"
&& typeof update.bandplan_region === "string") {
_bandplanServerDefaultApplied = true;
const hasUserOverride = localStorage.getItem(STORAGE_PREFIX + "bandplanRegion") !== null;
if (!hasUserOverride) {
const region = update.bandplan_enabled ? update.bandplan_region : "off";
bandplanRegion = region;
saveSetting("bandplanRegion", region);
if (bandplanRegionSelect) bandplanRegionSelect.value = region;
bandplanSegmentsCache = null;
bandplanCacheKey = "";
if (lastSpectrumData) scheduleSpectrumDraw();
}
}
if (update.filter && sdrAgcEl && typeof update.filter.sdr_agc_enabled === "boolean") {
sdrAgcEl.checked = update.filter.sdr_agc_enabled;
updateSdrGainInputState();
@@ -11279,6 +11295,7 @@ if (spectrumCenterRightBtn) {
let bandplanData = null;
let bandplanRegion = loadSetting("bandplanRegion", "off");
let bandplanShowLabels = loadSetting("bandplanLabels", true);
let _bandplanServerDefaultApplied = false;
let bandplanSegmentsCache = null;
let bandplanCacheKey = "";