[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:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user