From 59ee8f5760d8137b72f8f96064334988fe6ad781 Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Fri, 13 Feb 2026 08:39:31 +0100 Subject: [PATCH] [feat](trx-frontend-http): grey out TX controls for rx-authenticated users When a user is authenticated as 'rx' role (read-only), disable all TX/PTT control buttons and frequency/mode inputs to prevent accidental attempts to transmit. This provides clear visual feedback that these controls are not available. Controls disabled for rx role: - PTT button - Power button - Lock button - TX Audio button - Frequency input - Mode select - TX Limit input/button - Jog up/down buttons - Jog step buttons Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stanislaw Grams --- .../trx-frontend-http/assets/web/app.js | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) 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 4e48520..73a5fa9 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 @@ -94,17 +94,40 @@ function updateAuthUI() { function applyAuthRestrictions() { if (!authRole) return; - // Hide TX/PTT controls for rx role + // Disable TX/PTT/frequency/mode controls for rx role if (authRole === "rx") { const pttBtn = document.getElementById("ptt-btn"); const powerBtn = document.getElementById("power-btn"); - const txLimitRow = document.getElementById("tx-limit-row"); + const lockBtn = document.getElementById("lock-btn"); + const freqInput = document.getElementById("freq"); + const modeSelect = document.getElementById("mode"); + const txLimitInput = document.getElementById("tx-limit"); + const txLimitBtn = document.getElementById("tx-limit-btn"); const txAudioBtn = document.getElementById("tx-audio-btn"); + const txLimitRow = document.getElementById("tx-limit-row"); + const jogUp = document.getElementById("jog-up"); + const jogDown = document.getElementById("jog-down"); + const jogButtons = document.querySelectorAll(".jog-step button"); - if (pttBtn) pttBtn.style.display = "none"; + // Disable TX buttons + if (pttBtn) pttBtn.disabled = true; if (powerBtn) powerBtn.disabled = true; - if (txLimitRow) txLimitRow.style.display = "none"; - if (txAudioBtn) txAudioBtn.style.display = "none"; + if (lockBtn) lockBtn.disabled = true; + if (txAudioBtn) txAudioBtn.disabled = true; + if (txLimitBtn) txLimitBtn.disabled = true; + + // Disable frequency/mode inputs + if (freqInput) freqInput.disabled = true; + if (modeSelect) modeSelect.disabled = true; + if (txLimitInput) txLimitInput.disabled = true; + + // Disable jog controls + if (jogUp) jogUp.disabled = true; + if (jogDown) jogDown.disabled = true; + jogButtons.forEach(btn => btn.disabled = true); + + // Hide TX-specific UI but keep controls visible (disabled) + if (txLimitRow) txLimitRow.style.opacity = "0.5"; } }