[fix](trx-frontend-http): show auth gate after logout and disable jog/VFO for rx
Fix logout flow to properly show auth gate and clear form. Also disable additional controls for rx role: - Jog wheel (faded out) - Jog up/down buttons - VFO selector buttons For rx-authenticated users, all frequency/mode adjustment controls are now properly disabled to prevent accidental changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -51,6 +51,8 @@ async function authLogout() {
|
|||||||
// Disconnect and show auth gate without page reload
|
// Disconnect and show auth gate without page reload
|
||||||
disconnect();
|
disconnect();
|
||||||
document.getElementById("content").style.display = "none";
|
document.getElementById("content").style.display = "none";
|
||||||
|
document.getElementById("loading").style.display = "none";
|
||||||
|
document.getElementById("auth-passphrase").value = "";
|
||||||
updateAuthUI();
|
updateAuthUI();
|
||||||
showAuthGate(false);
|
showAuthGate(false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -114,7 +116,7 @@ function updateAuthUI() {
|
|||||||
function applyAuthRestrictions() {
|
function applyAuthRestrictions() {
|
||||||
if (!authRole) return;
|
if (!authRole) return;
|
||||||
|
|
||||||
// Disable TX/PTT/frequency/mode controls for rx role
|
// Disable TX/PTT/frequency/mode/VFO controls for rx role
|
||||||
if (authRole === "rx") {
|
if (authRole === "rx") {
|
||||||
const pttBtn = document.getElementById("ptt-btn");
|
const pttBtn = document.getElementById("ptt-btn");
|
||||||
const powerBtn = document.getElementById("power-btn");
|
const powerBtn = document.getElementById("power-btn");
|
||||||
@@ -125,9 +127,11 @@ function applyAuthRestrictions() {
|
|||||||
const txLimitBtn = document.getElementById("tx-limit-btn");
|
const txLimitBtn = document.getElementById("tx-limit-btn");
|
||||||
const txAudioBtn = document.getElementById("tx-audio-btn");
|
const txAudioBtn = document.getElementById("tx-audio-btn");
|
||||||
const txLimitRow = document.getElementById("tx-limit-row");
|
const txLimitRow = document.getElementById("tx-limit-row");
|
||||||
|
const vfoPicker = document.getElementById("vfo-picker");
|
||||||
const jogUp = document.getElementById("jog-up");
|
const jogUp = document.getElementById("jog-up");
|
||||||
const jogDown = document.getElementById("jog-down");
|
const jogDown = document.getElementById("jog-down");
|
||||||
const jogButtons = document.querySelectorAll(".jog-step button");
|
const jogButtons = document.querySelectorAll(".jog-step button");
|
||||||
|
const vfoButtons = document.querySelectorAll("#vfo-picker button");
|
||||||
|
|
||||||
// Disable TX buttons
|
// Disable TX buttons
|
||||||
if (pttBtn) pttBtn.disabled = true;
|
if (pttBtn) pttBtn.disabled = true;
|
||||||
@@ -141,9 +145,14 @@ function applyAuthRestrictions() {
|
|||||||
if (modeSelect) modeSelect.disabled = true;
|
if (modeSelect) modeSelect.disabled = true;
|
||||||
if (txLimitInput) txLimitInput.disabled = true;
|
if (txLimitInput) txLimitInput.disabled = true;
|
||||||
|
|
||||||
|
// Disable VFO selector
|
||||||
|
vfoButtons.forEach(btn => btn.disabled = true);
|
||||||
|
|
||||||
// Disable jog controls
|
// Disable jog controls
|
||||||
|
const jogWheel = document.getElementById("jog-wheel");
|
||||||
if (jogUp) jogUp.disabled = true;
|
if (jogUp) jogUp.disabled = true;
|
||||||
if (jogDown) jogDown.disabled = true;
|
if (jogDown) jogDown.disabled = true;
|
||||||
|
if (jogWheel) jogWheel.style.opacity = "0.5";
|
||||||
jogButtons.forEach(btn => btn.disabled = true);
|
jogButtons.forEach(btn => btn.disabled = true);
|
||||||
|
|
||||||
// Hide TX-specific UI but keep controls visible (disabled)
|
// Hide TX-specific UI but keep controls visible (disabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user