Преглед изворни кода

Add decode button and result in UI

master
Jan Svabenik пре 3 дана
родитељ
комит
7dd0fd5e3b
2 измењених фајлова са 24 додато и 0 уклоњено
  1. +20
    -0
      web/app.js
  2. +4
    -0
      web/index.html

+ 20
- 0
web/app.js Прегледај датотеку

@@ -1133,6 +1133,26 @@ if (liveListenEventBtn) {
audio.play();
});
}
if (decodeEventBtn) {
decodeEventBtn.addEventListener('click', async () => {
const ev = eventsById.get(selectedEventId);
if (!ev) return;
if (!recordingMetaEl) return;
const rec = recordings.find(r => r.center_hz === ev.center_hz);
if (!rec) {
decodeResultEl.textContent = 'Decode: no recording';
return;
}
const mode = ev.class?.mod_type || 'FT8';
const res = await fetch(`/api/recordings/${rec.id}/decode?mode=${mode}`);
if (!res.ok) {
decodeResultEl.textContent = 'Decode: failed';
return;
}
const data = await res.json();
decodeResultEl.textContent = `Decode: ${String(data.stdout || '').slice(0, 80)}`;
});
}
jumpToEventBtn.addEventListener('click', () => {
const ev = eventsById.get(selectedEventId);
if (!ev) return;


+ 4
- 0
web/index.html Прегледај датотеку

@@ -262,6 +262,7 @@
</div>
<div class="insp-note">Ready for: IQ snippets, clip playback, bookmarks, annotations.</div>
<div class="insp-note" id="recordingMeta">Recording: -</div>
<div class="insp-note" id="decodeResult">Decode: -</div>
<div class="insp-note">
<a id="recordingMetaLink" href="#" target="_blank">meta.json</a> ·
<a id="recordingIQLink" href="#" target="_blank">IQ</a> ·
@@ -305,3 +306,6 @@
</script>
</body>
</html>
t>
</body>
</html>

Loading…
Откажи
Сачувај