[feat](trx-rs): expose rigctl metadata in HTTP about tab

Add rigctl frontend visibility in HTTP status/about UI and refine frequency controls layout.\n\n- track rigctl listen endpoint and active rigctl client count in frontend runtime context\n- inject rigctl metadata into HTTP /events payload\n- show rigctl endpoint and rigctl client count in About tab\n- remove frequency Set button from UI\n- move MHz/kHz/Hz selector beside frequency input and enlarge it\n- center jog wheel row and keep Enter-to-set frequency behavior\n\nCo-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
2026-02-13 01:33:54 +01:00
parent 86ca1a60fb
commit 55c70f0fb7
7 changed files with 98 additions and 33 deletions
@@ -19,7 +19,6 @@ const vfoPicker = document.getElementById("vfo-picker");
const signalBar = document.getElementById("signal-bar");
const signalValue = document.getElementById("signal-value");
const pttBtn = document.getElementById("ptt-btn");
const freqBtn = document.getElementById("freq-apply");
const modeBtn = document.getElementById("mode-apply");
const txLimitInput = document.getElementById("tx-limit");
const txLimitBtn = document.getElementById("tx-limit-btn");
@@ -229,7 +228,7 @@ function formatSignal(sUnits) {
}
function setDisabled(disabled) {
[freqEl, modeEl, freqBtn, modeBtn, pttBtn, powerBtn, txLimitInput, txLimitBtn, lockBtn].forEach((el) => {
[freqEl, modeEl, modeBtn, pttBtn, powerBtn, txLimitInput, txLimitBtn, lockBtn].forEach((el) => {
if (el) el.disabled = disabled;
});
}
@@ -494,6 +493,12 @@ function render(update) {
if (typeof update.clients === "number") {
document.getElementById("about-clients").textContent = update.clients;
}
if (typeof update.rigctl_clients === "number") {
document.getElementById("about-rigctl-clients").textContent = update.rigctl_clients;
}
if (typeof update.rigctl_addr === "string" && update.rigctl_addr.length > 0) {
document.getElementById("about-rigctl-endpoint").textContent = update.rigctl_addr;
}
powerHint.textContent = readyText();
lastLocked = update.status && update.status.lock === true;
lockBtn.textContent = lastLocked ? "Unlock" : "Lock";
@@ -621,7 +626,7 @@ pttBtn.addEventListener("click", async () => {
}
});
freqBtn.addEventListener("click", async () => {
async function applyFreqFromInput() {
const parsedRaw = parseFreqInput(freqEl.value, jogStep);
const parsed = alignFreqToRigStep(parsedRaw);
if (parsed === null) {
@@ -633,7 +638,7 @@ freqBtn.addEventListener("click", async () => {
return;
}
freqDirty = false;
freqBtn.disabled = true;
freqEl.disabled = true;
showHint("Setting frequency…");
try {
await postPath(`/set_freq?hz=${parsed}`);
@@ -642,14 +647,15 @@ freqBtn.addEventListener("click", async () => {
showHint("Set freq failed", 2000);
console.error(err);
} finally {
freqBtn.disabled = false;
freqEl.disabled = false;
}
});
}
freqEl.addEventListener("keydown", (e) => {
freqDirty = true;
if (e.key === "Enter") {
e.preventDefault();
freqBtn.click();
applyFreqFromInput();
}
});
@@ -33,9 +33,13 @@
<div class="status">
<div class="full-row">
<div class="label">Frequency<span class="band-tag" id="band-label">--</span></div>
<div class="inline">
<div class="inline freq-inline">
<input class="status-input" id="freq" type="text" value="--" />
<button id="freq-apply" type="button">Set</button>
<div class="jog-step" id="jog-step">
<button type="button" data-step="1000000">MHz</button>
<button type="button" data-step="1000" class="active">kHz</button>
<button type="button" data-step="1">Hz</button>
</div>
</div>
<div class="jog-container">
<button id="jog-down" type="button" class="jog-btn">&minus;</button>
@@ -43,11 +47,6 @@
<div class="jog-indicator" id="jog-indicator"></div>
</div>
<button id="jog-up" type="button" class="jog-btn">+</button>
<div class="jog-step" id="jog-step">
<button type="button" data-step="1000000">MHz</button>
<button type="button" data-step="1000" class="active">kHz</button>
<button type="button" data-step="1">Hz</button>
</div>
</div>
</div>
<div class="controls-row full-row">
@@ -224,6 +223,8 @@
<tr><td>Rig connection</td><td id="about-rig-access">--</td></tr>
<tr><td>Supported modes</td><td id="about-modes">--</td></tr>
<tr><td>VFOs</td><td id="about-vfos">--</td></tr>
<tr><td>Rigctl endpoint</td><td id="about-rigctl-endpoint">--</td></tr>
<tr><td>Rigctl clients</td><td id="about-rigctl-clients">--</td></tr>
<tr><td>PSK Reporter</td><td id="about-pskreporter">--</td></tr>
<tr><td>Client</td><td>{pkg} v{ver}</td></tr>
<tr><td>Connected clients</td><td id="about-clients">--</td></tr>
@@ -35,6 +35,7 @@ input.status-input, select.status-input { width: 100%; padding: 0.45rem 0.5rem;
.jog-container {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin-top: 0.6rem;
}
@@ -80,15 +81,16 @@ input.status-input, select.status-input { width: 100%; padding: 0.45rem 0.5rem;
border: 1px solid var(--border-light);
border-radius: 6px;
overflow: hidden;
margin-left: 0.3rem;
height: 3.35rem;
flex-shrink: 0;
}
.jog-step button {
border: none;
border-right: 1px solid var(--border-light);
border-radius: 0;
height: 2rem;
padding: 0 0.55rem;
font-size: 0.78rem;
height: 100%;
padding: 0 0.8rem;
font-size: 0.92rem;
background: var(--input-bg);
color: var(--text-muted);
cursor: pointer;
@@ -131,6 +133,7 @@ button { padding: 0.5rem 0.9rem; border-radius: 6px; border: 1px solid var(--btn
button:disabled { opacity: 0.6; cursor: not-allowed; }
.hint { color: var(--text-muted); font-size: 0.85rem; }
.inline { display: flex; gap: 0.5rem; align-items: center; }
.freq-inline #freq { flex: 1 1 auto; }
small { color: var(--text-muted); }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.title { font-size: 1.4rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; }