[feat](trx-frontend-http): refine decoder and SDR displays
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -275,12 +275,10 @@ function applyCapabilities(caps) {
|
||||
if (vfoRow) vfoRow.style.display = caps.vfo_switch ? "" : "none";
|
||||
|
||||
// Signal meter row
|
||||
const sigRow = document.querySelector(".full-row.label-below-row");
|
||||
// Find signal row by content check rather than class (it may share classes)
|
||||
document.querySelectorAll(".full-row.label-below-row").forEach(row => {
|
||||
const label = row.querySelector(".label span");
|
||||
if (label && label.textContent === "Signal") {
|
||||
row.style.display = caps.signal_meter ? "" : "none";
|
||||
row.style.display = (caps.signal_meter && !caps.filter_controls) ? "" : "none";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -361,6 +359,7 @@ let lastClientCount = null;
|
||||
let lastLocked = false;
|
||||
let lastRigIds = [];
|
||||
let lastRigDisplayNames = {};
|
||||
let lastActiveRigId = null;
|
||||
const originalTitle = document.title;
|
||||
const savedTheme = loadSetting("theme", null);
|
||||
|
||||
@@ -409,6 +408,25 @@ function readyText() {
|
||||
return lastClientCount !== null ? `Ready \u00b7 ${lastClientCount} user${lastClientCount !== 1 ? "s" : ""}` : "Ready";
|
||||
}
|
||||
|
||||
function rigBadgeColor(rigId) {
|
||||
const text = (rigId || "rx").toString();
|
||||
let hash = 0;
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
hash = ((hash * 33) + text.charCodeAt(i)) >>> 0;
|
||||
}
|
||||
const hue = hash % 360;
|
||||
return `hsl(${hue}, 62%, 52%)`;
|
||||
}
|
||||
|
||||
window.getDecodeRigMeta = function() {
|
||||
const rigId = lastActiveRigId || "local";
|
||||
return {
|
||||
rigId,
|
||||
label: lastRigDisplayNames[rigId] || rigId,
|
||||
color: rigBadgeColor(rigId),
|
||||
};
|
||||
};
|
||||
|
||||
function populateRigPicker(selectEl, rigIds, activeRigId, disabled) {
|
||||
if (!selectEl) return;
|
||||
const selectedBefore = selectEl.value;
|
||||
@@ -445,6 +463,7 @@ function applyRigList(activeRigId, rigIds, displayNames) {
|
||||
aboutList.textContent = lastRigIds.length ? lastRigIds.join(", ") : "--";
|
||||
}
|
||||
if (typeof activeRigId === "string" && activeRigId.length > 0) {
|
||||
lastActiveRigId = activeRigId;
|
||||
const aboutActive = document.getElementById("about-active-rig");
|
||||
if (aboutActive) aboutActive.textContent = activeRigId;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</div>
|
||||
<div class="freq-field frequency-col center-frequency-col" id="center-freq-field" style="display:none;">
|
||||
<input class="status-input" id="center-freq" type="text" value="--" />
|
||||
<div class="label"><span>Central Frequency</span></div>
|
||||
<div class="label"><span>Center Frequency</span></div>
|
||||
</div>
|
||||
<div class="freq-field unit-col">
|
||||
<div class="jog-step" id="jog-step">
|
||||
|
||||
@@ -68,7 +68,11 @@ function renderAprsRow(pkt) {
|
||||
const osmUrl = `https://www.openstreetmap.org/?mlat=${pkt.lat}&mlon=${pkt.lon}#map=15/${pkt.lat}/${pkt.lon}`;
|
||||
posHtml = ` <a class="aprs-pos" href="${osmUrl}" target="_blank">${pkt.lat.toFixed(4)}, ${pkt.lon.toFixed(4)}</a>`;
|
||||
}
|
||||
const receiverHtml = pkt.receiver
|
||||
? `<span class="decode-rig-badge" style="--decode-rig-color:${pkt.receiver.color};">${pkt.receiver.label}</span> `
|
||||
: "";
|
||||
row.dataset.filterText = [
|
||||
pkt.receiver ? pkt.receiver.label : "",
|
||||
pkt.srcCall,
|
||||
pkt.destCall,
|
||||
pkt.path,
|
||||
@@ -80,7 +84,7 @@ function renderAprsRow(pkt) {
|
||||
.filter(Boolean)
|
||||
.join(" ")
|
||||
.toUpperCase();
|
||||
row.innerHTML = `<span class="aprs-time">${ts}</span>${symbolHtml}<span class="aprs-call">${pkt.srcCall}</span>>${pkt.destCall}${pkt.path ? "," + pkt.path : ""}: <span title="${pkt.type}">${renderAprsInfo(pkt)}</span>${posHtml}${crcTag}`;
|
||||
row.innerHTML = `<span class="aprs-time">${ts}</span>${receiverHtml}${symbolHtml}<span class="aprs-call">${pkt.srcCall}</span>>${pkt.destCall}${pkt.path ? "," + pkt.path : ""}: <span title="${pkt.type}">${renderAprsInfo(pkt)}</span>${posHtml}${crcTag}`;
|
||||
applyAprsFilterToRow(row);
|
||||
return row;
|
||||
}
|
||||
@@ -148,6 +152,7 @@ if (aprsFilterInput) {
|
||||
window.onServerAprs = function(pkt) {
|
||||
aprsStatus.textContent = "Receiving";
|
||||
addAprsPacket({
|
||||
receiver: window.getDecodeRigMeta ? window.getDecodeRigMeta() : null,
|
||||
srcCall: pkt.src_call,
|
||||
destCall: pkt.dest_call,
|
||||
path: pkt.path,
|
||||
|
||||
@@ -34,7 +34,10 @@ function renderFt8Row(msg) {
|
||||
const rfHz = Number.isFinite(msg.freq_hz) && Number.isFinite(baseHz) ? (baseHz + msg.freq_hz) : null;
|
||||
const freq = Number.isFinite(rfHz) ? rfHz.toFixed(0) : "--";
|
||||
const renderedMessage = renderFt8Message(rawMessage);
|
||||
row.innerHTML = `<span class="ft8-time">${fmtTime(msg.ts_ms)}</span><span class="ft8-snr">${snr}</span><span class="ft8-dt">${dt}</span><span class="ft8-freq">${freq}</span><span class="ft8-msg">${renderedMessage}</span>`;
|
||||
const receiverHtml = msg.receiver
|
||||
? `<span class="decode-rig-badge" style="--decode-rig-color:${msg.receiver.color};">${msg.receiver.label}</span>`
|
||||
: "";
|
||||
row.innerHTML = `<span class="ft8-time">${fmtTime(msg.ts_ms)}</span>${receiverHtml}<span class="ft8-snr">${snr}</span><span class="ft8-dt">${dt}</span><span class="ft8-freq">${freq}</span><span class="ft8-msg">${renderedMessage}</span>`;
|
||||
applyFt8FilterToRow(row);
|
||||
return row;
|
||||
}
|
||||
@@ -173,6 +176,7 @@ window.onServerFt8 = function(msg) {
|
||||
window.ft8MapAddLocator(raw, grids, "ft8", station);
|
||||
}
|
||||
addFt8Message({
|
||||
receiver: window.getDecodeRigMeta ? window.getDecodeRigMeta() : null,
|
||||
ts_ms: msg.ts_ms,
|
||||
snr_db: msg.snr_db,
|
||||
dt_s: msg.dt_s,
|
||||
|
||||
@@ -34,7 +34,10 @@ function renderWsprRow(msg) {
|
||||
const freq = Number.isFinite(rfHz) ? rfHz.toFixed(0) : "--";
|
||||
const message = (msg.message || "").toString();
|
||||
row.dataset.message = message.toUpperCase();
|
||||
row.innerHTML = `<span class="ft8-time">${fmtWsprTime(msg.ts_ms)}</span><span class="ft8-snr">${snr}</span><span class="ft8-dt">${dt}</span><span class="ft8-freq">${freq}</span><span class="ft8-msg">${escapeWsprHtml(message)}</span>`;
|
||||
const receiverHtml = msg.receiver
|
||||
? `<span class="decode-rig-badge" style="--decode-rig-color:${msg.receiver.color};">${msg.receiver.label}</span>`
|
||||
: "";
|
||||
row.innerHTML = `<span class="ft8-time">${fmtWsprTime(msg.ts_ms)}</span>${receiverHtml}<span class="ft8-snr">${snr}</span><span class="ft8-dt">${dt}</span><span class="ft8-freq">${freq}</span><span class="ft8-msg">${escapeWsprHtml(message)}</span>`;
|
||||
applyWsprFilterToRow(row);
|
||||
return row;
|
||||
}
|
||||
@@ -119,6 +122,7 @@ window.onServerWspr = function(msg) {
|
||||
window.ft8MapAddLocator(raw, grids, "wspr", station);
|
||||
}
|
||||
addWsprMessage({
|
||||
receiver: window.getDecodeRigMeta ? window.getDecodeRigMeta() : null,
|
||||
ts_ms: msg.ts_ms,
|
||||
snr_db: msg.snr_db,
|
||||
dt_s: msg.dt_s,
|
||||
|
||||
Reference in New Issue
Block a user