sync från dev (svx-web): lastheard paginering + separat live-feed, listen-vy, UI-uppdateringar

- lastheard 24h: client-side paginering (lib/pager.js), dynamisk sidstorlek
- lastheard: separat live-feed (lastheard_live_view.js), 24h loggar varje key-up
- listen_view.js + auth/admin_listen.*: Listen Live
- genomgående UI/auth-uppdateringar synkade från dev
Inga hårdkodade secrets/IP/login — endast hostnamn.
This commit is contained in:
bjorne committed 2026-11-18 22:07:16 +01:00
1 parent d1ed13c04d
commit cb8b9af20e
86 files changed
+852 -855

No files matched your search

+35 -37
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
let lastNodes = {};
@@ -29,6 +20,7 @@ function setActive(panel){
const trkP = document.getElementById('trunksPanel');
const topP = document.getElementById('topologyPanel');
const lhP = document.getElementById('lastheardPanel');
const lhLiveP = document.getElementById('lastheardLivePanel');
const ctcP = document.getElementById('ctcssPanel');
const chgP = document.getElementById('changelogPanel');
const tgmP = document.getElementById('tgmonPanel');
@@ -39,6 +31,7 @@ function setActive(panel){
if(trkP) trkP.style.display = (panel === 'trunks') ? 'block' : 'none';
if(topP) topP.style.display = (panel === 'topology') ? 'block' : 'none';
if(lhP) lhP.style.display = (panel === 'lastheard') ? 'block' : 'none';
if(lhLiveP) lhLiveP.style.display = (panel === 'lastheardLive') ? 'block' : 'none';
if(ctcP) ctcP.style.display = (panel === 'ctcss') ? 'block' : 'none';
if(chgP) chgP.style.display = (panel === 'changelog') ? 'block' : 'none';
if(tgmP) tgmP.style.display = (panel === 'tgmon') ? 'block' : 'none';
@@ -70,6 +63,7 @@ function render(status){
if (document.getElementById('trunksPanel')?.style.display !== 'none') window.renderTrunks?.(lastStatus);
if (document.getElementById('topologyPanel')?.style.display !== 'none') window.renderTopology?.(lastStatus);
if (document.getElementById('lastheardPanel')?.style.display !== 'none') window.refreshLastheard?.();
if (document.getElementById('lastheardLivePanel')?.style.display !== 'none') window.refreshLastheardLive?.();
if (document.getElementById('ctcssPanel')?.style.display !== 'none') window.renderCTCSS?.(lastStatus);
if (document.getElementById('tgmonPanel')?.style.display !== 'none') window.renderTgMon?.();
}
@@ -79,33 +73,6 @@ async function refresh(){
if(!j) return;
lastUpdated = Date.now();
render(j);
applyFederationExtra(j);
}
// On the AlabamaLink box fold the AlabamaLink line INTO the existing
// federation marquee so both scroll together in the one bar — same style, no
// second banner. Every other box keeps just the federation line. Gated on the
// local reflector identity from the status (KT4ROY / alabama.reflector-network.com),
// so it's a no-op everywhere else.
let _fedExtraDone = false;
function applyFederationExtra(status){
if(_fedExtraDone) return;
const track = document.querySelector('#federationBanner .fed-track');
if(!track) return;
const refs = (status && status.network && Array.isArray(status.network.reflectors)) ? status.network.reflectors : [];
const isAlabama = refs.some(r => r && r.self && (
String(r.name || '').toUpperCase() === 'KT4ROY' ||
/alabama\.reflector-network\.com/i.test(String(r.hostname || '') + ' ' + String(r.name || ''))
));
if(!isAlabama) return;
_fedExtraDone = true;
const fed = 'Part of the reflector-network.com federation — a growing mesh of independent networks.';
const ala = 'Powered by Executor — a multi-mode digital voice server, part of the AlabamaLink network.';
const sep = '  •  ';
const unit = fed + sep + ala;
const inner = document.createElement('span');
inner.textContent = unit + sep + unit; // doubled so the loop stays seamless
track.replaceChildren(inner);
}
/* ===== Monitor submenu ===== */
@@ -123,6 +90,21 @@ document.addEventListener('click', (e) => {
if(item && !item.contains(e.target)) closeMonitorSubMenu();
});
/* ===== Last heard submenu ===== */
function closeLastheardSubMenu(){
const m = document.getElementById('lastheardSubMenu');
if(m) m.style.display = 'none';
}
function toggleLastheardSubMenu(){
const m = document.getElementById('lastheardSubMenu');
if(!m) return;
m.style.display = (m.style.display === 'none' || !m.style.display) ? 'block' : 'none';
}
document.addEventListener('click', (e) => {
const item = document.getElementById('lastheardMenuItem');
if(item && !item.contains(e.target)) closeLastheardSubMenu();
});
/* ===== Wire UI ===== */
document.getElementById('navList')?.addEventListener('click', (e) => {
e.preventDefault();
@@ -172,6 +154,20 @@ document.getElementById('navMonitorTopology')?.addEventListener('click', (e) =>
document.getElementById('navLastheard')?.addEventListener('click', (e) => {
e.preventDefault();
closeMonitorSubMenu();
toggleLastheardSubMenu();
});
document.getElementById('navLastheardLive')?.addEventListener('click', (e) => {
e.preventDefault();
closeLastheardSubMenu();
setNavActive('navLastheard');
setActive('lastheardLive');
window.refreshLastheardLive?.();
});
document.getElementById('navLastheard24h')?.addEventListener('click', (e) => {
e.preventDefault();
closeLastheardSubMenu();
setNavActive('navLastheard');
setActive('lastheard');
window.refreshLastheard?.();
@@ -202,7 +198,7 @@ document.getElementById('navTgmon')?.addEventListener('click', (e) => {
});
/* ===== Remember the last view across reloads (Ctrl+Shift+R) ===== */
const RESTORE_NAVS = ['navList','navClients','navMonitorNodes','navMonitorTrunks','navMonitorTopology','navTgmon','navLastheard','navCTCSS','navChangelog'];
const RESTORE_NAVS = ['navList','navClients','navMonitorNodes','navMonitorTrunks','navMonitorTopology','navTgmon','navLastheardLive','navLastheard24h','navCTCSS','navChangelog'];
for (const id of RESTORE_NAVS) {
document.getElementById(id)?.addEventListener('click', () => { try { localStorage.setItem('svxLastNav', id); } catch (_) {} });
}
@@ -229,6 +225,8 @@ setInterval(() => { // keep Age ticking even without updates
const sseTxt = document.getElementById('sseTxt');
function setSSE(state){
window.__svxSSE = state; // read by the Live lastheard dot
window.updateLhLiveDot?.();
if(!sseTxt) return;
sseTxt.textContent = "SSE: " + state;
}
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
var LEVEL_LABELS = {1:'Normal', 2:'Admin', 3:'SuperAdmin'};
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Global Bans — callsign-only, styled like the DMR site's bans page.
var $ = function(id) { return document.getElementById(id); };
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
var $ = function(id){ return document.getElementById(id); };
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
var $ = function(id) { return document.getElementById(id); };
function setMsg(el, txt, err) {
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
var $ = function(id) { return document.getElementById(id); };
function setMsg(el, txt, err) {
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
+81
View File
@@ -0,0 +1,81 @@
'use strict';
// Admin · Listen Live permissions — set who may hear each TG in the browser.
// Backed by tglist_api.php (the per-TG 'listen' field: free | members | off).
(function () {
var LEVELS = [
['free', 'Free — anyone'],
['members', 'Members — logged in only'],
['off', 'Off — hidden'],
];
var rows = [];
function api(body) {
return fetch('/auth/tglist_api.php', {
method: 'POST', credentials: 'same-origin',
headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': window._csrfToken || '' },
body: JSON.stringify(body),
}).then(function (r) { return r.json(); });
}
function msg(t) { var m = document.getElementById('lpMsg'); if (m) m.textContent = t; }
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) {
return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); }
function render(filter) {
var tb = document.querySelector('#lpTable tbody'); if (!tb) return;
filter = (filter || '').toLowerCase().trim();
tb.innerHTML = '';
rows.forEach(function (tg) {
if (filter && (tg.tg + ' ' + (tg.name || '')).toLowerCase().indexOf(filter) < 0) return;
var cur = tg.listen || 'free';
var opts = LEVELS.map(function (l) {
return '<option value="' + l[0] + '"' + (l[0] === cur ? ' selected' : '') + '>' + l[1] + '</option>';
}).join('');
var tr = document.createElement('tr');
tr.innerHTML = '<td class="mono">' + tg.tg + '</td>'
+ '<td>' + esc(tg.name || '') + '</td>'
+ '<td><select class="form-select form-select-sm" data-tg="' + tg.tg + '" style="max-width:230px;">' + opts + '</select></td>';
tb.appendChild(tr);
});
tb.querySelectorAll('select[data-tg]').forEach(function (s) {
s.addEventListener('change', function () { saveOne(parseInt(s.getAttribute('data-tg'), 10), s.value, s); });
});
}
async function saveOne(tg, listen, selEl) {
selEl.disabled = true;
var res = null;
try { res = await api({ action: 'save', tg: tg, listen: listen }); } catch (_) {}
selEl.disabled = false;
if (res && res.ok) {
var r = rows.find(function (x) { return x.tg === tg; }); if (r) r.listen = listen;
msg('Saved TG ' + tg + ' → ' + listen);
} else {
msg('Save failed for TG ' + tg + (res && res.error ? ' (' + res.error + ')' : ''));
}
}
async function load() {
var res = null;
try { res = await api({ action: 'list' }); } catch (_) {}
if (!res || !res.ok) { msg('Failed to load TG list'); return; }
if (res.can_admin === false) { msg('Admin access required.'); return; }
rows = (res.tgs || []).map(function (t) { return { tg: t.tg, name: t.name, listen: t.listen || 'free' }; });
rows.sort(function (a, b) { return a.tg - b.tg; });
render('');
msg(rows.length + ' talkgroups.');
}
function init() {
var s = document.getElementById('lpSearch');
s && s.addEventListener('input', function () { render(s.value); });
// Grab the CSRF token (needed for save) from me.php, then load.
fetch('/auth/me.php', { credentials: 'same-origin' })
.then(function (r) { return r.json(); })
.then(function (j) { if (j && j.csrf_token) window._csrfToken = j.csrf_token; load(); })
.catch(function () { load(); });
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init);
else init();
})();
+39
View File
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
$uuid = $_SESSION['uid'] ?? null;
if (!is_string($uuid) || $uuid === '') { header('Location: /'); exit; }
$lvl = acct_admin_level($uuid);
if ($lvl < 2) { header('Location: /'); exit; }
$page_title = 'Admin · Listen Live — Reflector Dashboard';
require __DIR__ . '/header.php';
?>
<div class="container py-4" style="max-width:760px;">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Listen Live — TG permissions</h5>
<input type="text" class="form-control form-control-sm" id="lpSearch" placeholder="Search…" style="max-width:200px;">
</div>
<div class="panel">
<div class="small text-secondary mb-3">
Who may listen to each talkgroup in the browser (the “Listen Live” page).
<b>Free</b> = anyone · <b>Members</b> = logged-in accounts only (every account is a
callsign-verified ham) · <b>Off</b> = hidden from Listen Live. Default is <b>Free</b>.
Changes take effect immediately.
</div>
<div style="max-height:70vh; overflow:auto;">
<table class="data-table" id="lpTable">
<thead><tr><th>TG</th><th>Name</th><th>Access</th></tr></thead>
<tbody></tbody>
</table>
</div>
<div id="lpMsg" class="small text-secondary mt-2">Loading…</div>
</div>
</div>
<?php
$extra_scripts = '<script src="/auth/admin_listen.js?v=' . @filemtime(__DIR__ . '/admin_listen.js') . '"></script>';
require __DIR__ . '/footer.php';
?>
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
var $ = function(id){ return document.getElementById(id); };
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// TG List editor — canonical TG -> name/system list (served publicly by
// /tglist.php). Mirrors the Global Bans admin pattern. Add/delete are admin-only;
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-1
View File
@@ -1,4 +1,3 @@
<!-- Reflector Dashboard — Copyright (C) 2026 SA7AUX (Björn) — SPDX-License-Identifier: AGPL-3.0-or-later — see LICENSE -->
</main>
<footer style="text-align:center; padding:16px; color:rgba(0,255,255,.4); font-size:.75rem; border-top:1px solid rgba(0,255,255,.15);">
&copy; 2026 SA7AUX. All rights reserved.
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
+1 -10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
// Shared header — include on all pages
if (!function_exists('cfg')) require __DIR__ . '/lib.php';
if (session_status() !== PHP_SESSION_ACTIVE) start_session();
@@ -93,6 +83,7 @@ header('Cache-Control: no-store');
<ul class="navbar-nav me-auto">
<li class="nav-item"><a class="nav-link" href="/#clients">Reflector clients</a></li>
<li class="nav-item"><a class="nav-link" href="/#monitor">Monitor</a></li>
<li class="nav-item"><a class="nav-link" href="/#listen">Listen Live</a></li>
<li class="nav-item"><a class="nav-link" href="/#lastheard">Lastheard</a></li>
<li class="nav-item"><a class="nav-link" href="/#ctcss">CTCSS Table</a></li>
<li class="nav-item"><a class="nav-link" href="/#map">Map</a></li>
+1 -11
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
function cfg(): array {
@@ -19,7 +9,7 @@ function cfg(): array {
}
// redis() / redis_connect() / redis_scan_mget() come from auth/lib/redis.php
// (copy of <dmr-portal>/auth/lib/redis.php).
// (copy of callmgr2/www-mumien/auth/lib/redis.php).
require __DIR__ . '/lib/redis.php';
// json_in/json_out, CSRF and rate limiting come from auth/lib/http.php (copy of
// callmgr2's); the rate-limit keys keep this site's namespace.
+1 -11
View File
@@ -1,17 +1,7 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// acl.php — shared PHP helper for every web (dmr-web, svx-web).
// Canonical copy: <dmr-portal>/auth/lib/acl.php; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/auth/lib/acl.php; other repos carry a COPY.
// Admin-on-admin checks. Needs acct_admin_level() and json_out() from the site.
// An admin may change another account only when their own level is strictly
+1 -11
View File
@@ -1,17 +1,7 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// html.php — shared PHP helper for every web (dmr-web, svx-web, svxlink-web).
// Canonical copy: <dmr-portal>/auth/lib/html.php; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/auth/lib/html.php; other repos carry a COPY.
// HTML escaping for server-rendered pages.
// Escape for HTML text and attribute context (quotes included, invalid UTF-8 replaced).
+1 -11
View File
@@ -1,17 +1,7 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// http.php — shared PHP helper for every web (dmr-web, svx-web).
// Canonical copy: <dmr-portal>/auth/lib/http.php; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/auth/lib/http.php; other repos carry a COPY.
// JSON request/response, CSRF check, Redis-backed rate limiting.
// Loaded by auth/lib.php; needs cfg() from the page's own lib.php.
+1 -11
View File
@@ -1,17 +1,7 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// redis.php — shared PHP helper for every web (dmr-web, svx-web).
// Canonical copy: <dmr-portal>/auth/lib/redis.php; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/auth/lib/redis.php; other repos carry a COPY.
// Redis connections (main + aux) and the batched SCAN+MGET read — the only way to read many keys.
// Loaded by auth/lib.php; needs cfg() from the page's own lib.php.
+1 -11
View File
@@ -1,17 +1,7 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// shell.php — shared PHP helper for every web (dmr-web, svx-web, svxlink-web).
// Canonical copy: <dmr-portal>/auth/lib/shell.php; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/auth/lib/shell.php; other repos carry a COPY.
// Shell-argument quoting for the few pages that run local helpers.
function sh_arg($v): string { return escapeshellarg((string)$v); }
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// Manage a node's admin list (Redis set node_admins:<CALL>). The node's sysop is
// always the implicit default admin; this stores ADDITIONAL admins.
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// Reflector node authentication: manage login/password nodes ([USERS]/[PASSWORDS]
// in svxreflector.conf, edited only via the scoped sudo helper svxreflector-users)
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
// Remote-control a SvxLink node over MQTT, manage the portal's publish settings, and
// provision per-node broker credentials (stored in the node profile).
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
const $ = id => document.getElementById(id);
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
function switchProfileTab(tab) {
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Admin TG editor (List B) — mirrors the DMR sysconfig SVX-satellite editor:
// list (data-table) -> per-row Edit -> grouped-field detail form -> an
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
+16 -12
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
@@ -66,6 +56,15 @@ function tglist_store(array $d): bool {
return @file_put_contents($f, $json, LOCK_EX) !== false;
}
// Listen Live access level for a TG: who may hear it in the browser.
// 'free' — anyone (default, open like the ECR page)
// 'members' — only logged-in accounts (every account is a callsign-verified ham)
// 'off' — nobody (hidden from Listen Live)
function tg_listen_norm($v): string {
$v = strtolower(trim((string)$v));
return in_array($v, ['free', 'members', 'off'], true) ? $v : 'free';
}
function tg_norm(array $o): array {
$admins = [];
if (isset($o['admins']) && is_array($o['admins'])) {
@@ -79,6 +78,7 @@ function tg_norm(array $o): array {
'mode' => (string)($o['mode'] ?? ''),
'owner' => strtoupper((string)($o['owner'] ?? '')),
'admins' => $admins,
'listen' => tg_listen_norm($o['listen'] ?? 'free'),
];
}
@@ -158,7 +158,7 @@ if ($action === 'approve') {
$data['requests'] = array_values(array_filter($data['requests'], fn($rq) => (string)($rq['uuid'] ?? '') !== $ru));
if (tg_find($data['tgs'], $tg) >= 0) { tglist_store($data); json_out(['ok' => false, 'error' => 'tg_taken_during_review'], 409); }
$data['tgs'][] = ['tg' => $tg, 'name' => (string)($req['name'] ?? ''), 'system' => (string)($req['system'] ?? ''),
'allstar' => (string)($req['allstar'] ?? ''), 'mode' => (string)($req['mode'] ?? ''), 'owner' => strtoupper((string)($req['callsign'] ?? '')), 'admins' => []];
'allstar' => (string)($req['allstar'] ?? ''), 'mode' => (string)($req['mode'] ?? ''), 'owner' => strtoupper((string)($req['callsign'] ?? '')), 'admins' => [], 'listen' => 'free'];
if (!tglist_store($data)) tglist_fail();
json_out(['ok' => true, 'tg' => $tg]);
}
@@ -190,7 +190,11 @@ if ($action === 'save') {
// owner set only via approve; admins via admin_set. Preserve both here.
$owner = $existing ? $existing['owner'] : '';
$admins = $existing ? $existing['admins'] : [];
$entry = ['tg' => $tg, 'name' => $name, 'system' => $system, 'allstar' => $allstar, 'mode' => $mode, 'owner' => $owner, 'admins' => $admins];
// Listen Live access level is an access-control decision — only a site admin may
// change it (owners/co-admins editing name/mode must not silently flip access).
$listen = $existing ? $existing['listen'] : 'free';
if ($isAdmin && isset($j['listen'])) $listen = tg_listen_norm($j['listen']);
$entry = ['tg' => $tg, 'name' => $name, 'system' => $system, 'allstar' => $allstar, 'mode' => $mode, 'owner' => $owner, 'admins' => $admins, 'listen' => $listen];
if ($idx >= 0) $data['tgs'][$idx] = $entry; else $data['tgs'][] = $entry;
if (!tglist_store($data)) tglist_fail();
json_out(['ok' => true, 'entry' => $entry]);
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Request a TG — mirrors the DMR tgrequest flow. Submit -> pending -> an admin
// approves (in the admin TG editor) -> you become owner. One open request/user.
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
-10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
+1 -9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
(function(){
@@ -574,6 +565,7 @@
+ '<li><a class="dropdown-item" href="/auth/admin_nodeauth.php">Node Auth</a></li>'
+ '<li><a class="dropdown-item" href="/auth/admin_bans.php">Global Bans</a></li>'
+ '<li><a class="dropdown-item" href="/auth/tgadmin.php">TG List (admin)</a></li>'
+ '<li><a class="dropdown-item" href="/auth/admin_listen.php">Listen</a></li>'
+ (j.admin_level >= 3 ? '<li><a class="dropdown-item" href="/auth/admin_config.php">Config</a></li>' : '')
+ '</ul>'
+ '</li>'
+14 -14
View File
@@ -25,7 +25,7 @@
"repo": "svxdr",
"hash": "tglist-sole-source",
"type": "change",
"summary": "FROZEN: the tglist is now the SOLE source of TG name/Location in Lastheard — all fallback removed (locForTG/systemForTG/bridgeIdentity no longer read live astmeta gateway location or nodes[].system). Every talker on a TG shows exactly the tglist name for that TG (blank if absent), so Lastheard is identical on every box. The master list is edited on the hub box and every box syncs it."
"summary": "FROZEN: the tglist is now the SOLE source of TG name/Location in Lastheard — all fallback removed (locForTG/systemForTG/bridgeIdentity no longer read live astmeta gateway location or nodes[].system). Every talker on a TG shows exactly the tglist name for that TG (blank if absent), so Lastheard is identical on every box. The master list is edited on speed and every box syncs it."
},
{
"date": "2026-08-27",
@@ -137,21 +137,21 @@
"repo": "svx-web",
"hash": "svxdr-monitor-nodes-uniform",
"type": "fix",
"summary": "svxdr Monitor->Nodes: make it behave IDENTICALLY on every box, no per-conf-dialect special case. Bug: the Local-vs-trunk split only happened when the master trunk name could be derived from svxreflector.conf ([ReflectorTrunk] Peers), which only the hub box s dialect has — so the bridge box (dialect [TRUNK_*]) never split and dumped the whole SE hub s 18 nodes into LOCAL. Now the split is decided purely by is the monitored master remote (reflectorURL != monitor_status_url), and the master-section label is derived from the DATA (the Reflector field the master s nodes report, masterReflectorName) instead of the local conf. Both boxes now show LOCAL = only their own nodes and the master s nodes under one identical, data-driven section. Removed dead/special code: the whole trunk_status.go topology-feed dead end, masterTrunkName and uplinkTrunkName (conf-dialect helpers), and the trunk_status config field."
"summary": "svxdr Monitor->Nodes: make it behave IDENTICALLY on every box, no per-conf-dialect special case. Bug: the Local-vs-trunk split only happened when the master trunk name could be derived from svxreflector.conf ([ReflectorTrunk] Peers), which only speed s dialect has — so aldmr (dialect [TRUNK_*]) never split and dumped the whole SE hub s 18 nodes into LOCAL. Now the split is decided purely by is the monitored master remote (reflectorURL != monitor_status_url), and the master-section label is derived from the DATA (the Reflector field the master s nodes report, masterReflectorName) instead of the local conf. Both boxes now show LOCAL = only their own nodes and the master s nodes under one identical, data-driven section. Removed dead/special code: the whole trunk_status.go topology-feed dead end, masterTrunkName and uplinkTrunkName (conf-dialect helpers), and the trunk_status config field."
},
{
"date": "2026-08-07",
"repo": "svx-web",
"hash": "svxdr-topology-crawl-restored",
"type": "fix",
"summary": "svxdr topology: restore the network crawl (go externalPuller) so the graph shows the connection LINES again, not just nodes. An aggregated hub status (sm2ampr/geu) carries empty trunk host fields, so it can never draw the server-to-server edges; only crawling each reflector s OWN /status yields the real peer hosts topology_view.js resolves into links. The crawl seeds from the local reflector s trunk hosts + the network topology file and BFS-reads each reflector; interval bumped to 60s (EXTERNAL_PULL_INTERVAL) with last-good retention so it is spread out and gentle. the bridge box 17 reflectors/34 trunk-links, the hub box 18/42, local reflector self=true anchored at centre. The per-trunk trunk_status feed added earlier stays dormant (could not produce edges)."
"summary": "svxdr topology: restore the network crawl (go externalPuller) so the graph shows the connection LINES again, not just nodes. An aggregated hub status (sm2ampr/geu) carries empty trunk host fields, so it can never draw the server-to-server edges; only crawling each reflector s OWN /status yields the real peer hosts topology_view.js resolves into links. The crawl seeds from the local reflector s trunk hosts + the network topology file and BFS-reads each reflector; interval bumped to 60s (EXTERNAL_PULL_INTERVAL) with last-good retention so it is spread out and gentle. aldmr 17 reflectors/34 trunk-links, speed 18/42, local reflector self=true anchored at centre. The per-trunk trunk_status feed added earlier stays dormant (could not produce edges)."
},
{
"date": "2026-08-07",
"repo": "svx-web",
"hash": "svxdr-topology-full-net",
"type": "fix",
"summary": "svxdr topology: show the WHOLE network again, local reflector centred. readTrunkStatuses now reads ALL uplink trunks from svxreflector.conf (default address = the trunk s conf Host; nodelist.trunk_status json is only the exception, e.g. SE hub -> sm2ampr), and unfolds each hub response: every sub-trunk that carries nodes becomes its own reflector entity, so one hub read yields the full aggregated net (no crawl, no recursion beyond parsing the single response). the bridge box 19 reflectors/1357 nodes, the hub box 9/661, each with type=local self=true so topology_view.js anchors it at centre. Read cadence stays local-fast / remote-1-per-min."
"summary": "svxdr topology: show the WHOLE network again, local reflector centred. readTrunkStatuses now reads ALL uplink trunks from svxreflector.conf (default address = the trunk s conf Host; nodelist.trunk_status json is only the exception, e.g. SE hub -> sm2ampr), and unfolds each hub response: every sub-trunk that carries nodes becomes its own reflector entity, so one hub read yields the full aggregated net (no crawl, no recursion beyond parsing the single response). aldmr 19 reflectors/1357 nodes, speed 9/661, each with type=local self=true so topology_view.js anchors it at centre. Read cadence stays local-fast / remote-1-per-min."
},
{
"date": "2026-08-07",
@@ -172,14 +172,14 @@
"repo": "svx-web",
"hash": "svxdr-merge-phase1-scaffold",
"type": "feat",
"summary": "svxdr: start merging astmeta + nodelist + proxy + xlink into ONE process (fewer daemons to track). Phase 1 scaffold: one config /etc/svxlink/svxdr.json (sectioned per subsystem + shared redis/nodes/trunk/lastheard), per-box module toggles so the same binary runs all subsystems on the hub box/the bridge box and only astmeta on the allstar box, and a start/SIGHUP-reload/graceful-stop lifecycle. Subsystems are stubs for now and are folded in one at a time; the existing standalone binaries keep running until cutover (no regression). Builds + vets; verified it parses the example and toggles modules."
"summary": "svxdr: start merging astmeta + nodelist + proxy + xlink into ONE process (fewer daemons to track). Phase 1 scaffold: one config /etc/svxlink/svxdr.json (sectioned per subsystem + shared redis/nodes/trunk/lastheard), per-box module toggles so the same binary runs all subsystems on speed/aldmr and only astmeta on the allstar box, and a start/SIGHUP-reload/graceful-stop lifecycle. Subsystems are stubs for now and are folded in one at a time; the existing standalone binaries keep running until cutover (no regression). Builds + vets; verified it parses the example and toggles modules."
},
{
"date": "2026-08-06",
"repo": "svx-web",
"hash": "the bridge box-nodes-json-deploy",
"hash": "aldmr-nodes-json-deploy",
"type": "fix",
"summary": "the bridge box: deployed the nodes.json bridge map (deploy-the bridge box/etc/nodes.json) and the new astmeta/nodelist. Fixes the Location regression on TG 3149050: it was mapped in astmeta to the dead node 403872 while the live carrier 1971 was unwatched (also ended a per-second 'no RPT_ALINKS for 403872' reconnect storm). 1971 is a fan-out endpoint whose only keyed alink is our own 48305, so the allstar remap reports the real far node 45225. Verified live: TG 3109050 and 3149050 now pair on node 45225 / East Coast Reflector. callsign KT4ROY-ASL uniform for all; reflector name lives in nodeLocation."
"summary": "aldmr: deployed the nodes.json bridge map (deploy-aldmr/etc/nodes.json) and the new astmeta/nodelist. Fixes the Location regression on TG 3149050: it was mapped in astmeta to the dead node 403872 while the live carrier 1971 was unwatched (also ended a per-second 'no RPT_ALINKS for 403872' reconnect storm). 1971 is a fan-out endpoint whose only keyed alink is our own 48305, so the allstar remap reports the real far node 45225. Verified live: TG 3109050 and 3149050 now pair on node 45225 / East Coast Reflector. callsign KT4ROY-ASL uniform for all; reflector name lives in nodeLocation."
},
{
"date": "2026-08-06",
@@ -193,7 +193,7 @@
"repo": "svx-web",
"hash": "nodes-json-single-source",
"type": "feat",
"summary": "nodes.json: one source-of-truth bridge map that astmeta and nodelist both read directly (svx_node/tg/allstar/system/via/callsign per node). astmeta derives watch_nodes/[node.*]/[names] from it; nodelist derives the Location column's reflector_names + format from it -- ending the multi-file drift that broke the Location column. Additive: absent file = old config, no regression. proxy is a pure relay and stays untouched. Tooling: deploy-the bridge box/import-live.py bootstraps nodes.json from the live config (derives the AllStar link from rpt startup_macro, flags what it cannot derive instead of guessing); deploy-the bridge box/gen-asterisk.py renders the svx_sat.conf node blocks as a managed #include."
"summary": "nodes.json: one source-of-truth bridge map that astmeta and nodelist both read directly (svx_node/tg/allstar/system/via/callsign per node). astmeta derives watch_nodes/[node.*]/[names] from it; nodelist derives the Location column's reflector_names + format from it -- ending the multi-file drift that broke the Location column. Additive: absent file = old config, no regression. proxy is a pure relay and stays untouched. Tooling: deploy-aldmr/import-live.py bootstraps nodes.json from the live config (derives the AllStar link from rpt startup_macro, flags what it cannot derive instead of guessing); deploy-aldmr/gen-asterisk.py renders the svx_sat.conf node blocks as a managed #include."
},
{
"date": "2026-08-06",
@@ -214,7 +214,7 @@
"repo": "svx-web",
"hash": "monitor-local-vs-trunk",
"type": "fix",
"summary": "Monitor -> Nodes: Local now means ONLY this server's own reflector nodes. When a box monitors a foreign master (the hub box reads the HUB SE master status), the master's own nodes used to land under Local -- they are a different server reached over a trunk, not local. They are now grouped under that trunk's section, named from config (the svxreflector.conf trunk whose host matches the monitored master, e.g. SE-AUX -- never hardcoded). Local is read from our OWN reflector (REFLECTOR_STATUS_URL) and self nodes are de-duplicated out of the master section. A box that monitors its own reflector (the bridge box) is unaffected: same URL -> no split, top-level stays Local."
"summary": "Monitor -> Nodes: Local now means ONLY this server's own reflector nodes. When a box monitors a foreign master (speed reads the HUB SE master status), the master's own nodes used to land under Local -- they are a different server reached over a trunk, not local. They are now grouped under that trunk's section, named from config (the svxreflector.conf trunk whose host matches the monitored master, e.g. SE-AUX -- never hardcoded). Local is read from our OWN reflector (REFLECTOR_STATUS_URL) and self nodes are de-duplicated out of the master section. A box that monitors its own reflector (aldmr) is unaffected: same URL -> no split, top-level stays Local."
},
{
"date": "2026-08-06",
@@ -277,21 +277,21 @@
"repo": "proxy",
"hash": "fa69ae8",
"type": "feature",
"summary": "svx-web/proxy gained a meta-sync conduit so a box with NO local astmeta (the hub box) still shows the real talker on Lastheard. It sets UPSTREAM_STATUS_URL to the proxy of the box that HAS the meta (the bridge box) and FORWARD_TALKER_URL to its own nodelist: every 2s it fetches the upstream /status ('hämta status'), keeps the talker_meta (so its own /status carries it too) and POSTs each entry to the local nodelist /api/talker-meta ('api') with network left empty. The frozen Lastheard code enriches the existing trunk row IN PLACE — callsign, via, AllStar node, system — while the backend stays 'trunk' (it arrived over the trunk). Only trunk/status/API cross-box; no bridge, no polling of anyone else, no code change to nodelist/web, no dupes. No-op unless UPSTREAM_STATUS_URL is set (the bridge box stays fed by its local astmeta)."
"summary": "svx-web/proxy gained a meta-sync conduit so a box with NO local astmeta (speed) still shows the real talker on Lastheard. It sets UPSTREAM_STATUS_URL to the proxy of the box that HAS the meta (aldmr) and FORWARD_TALKER_URL to its own nodelist: every 2s it fetches the upstream /status ('hämta status'), keeps the talker_meta (so its own /status carries it too) and POSTs each entry to the local nodelist /api/talker-meta ('api') with network left empty. The frozen Lastheard code enriches the existing trunk row IN PLACE — callsign, via, AllStar node, system — while the backend stays 'trunk' (it arrived over the trunk). Only trunk/status/API cross-box; no bridge, no polling of anyone else, no code change to nodelist/web, no dupes. No-op unless UPSTREAM_STATUS_URL is set (aldmr stays fed by its local astmeta)."
},
{
"date": "2026-07-31",
"repo": "astmeta",
"hash": "33607dc",
"type": "feature",
"summary": "astmeta can now POST talker-meta to SEVERAL reflectors, not just the local one: [nodelist] peers = url|token, url|token. This lets a partner reflector that receives the same talker over the trunk (e.g. the hub box hearing an East Coast talker relayed from the bridge box) enrich its Lastheard IN PLACE with the real source — 'East Coast Reflector via KT4ROY-SAT1', AllStar node, backend AllStar — instead of the bare trunk name 'KT4ROY-SAT1 / trunk'. No dupes: the receiving nodelist already applies talker-meta to trunk-delivered rows (via-gated), so it enriches the existing single row. Backward compatible; no peers = unchanged."
"summary": "astmeta can now POST talker-meta to SEVERAL reflectors, not just the local one: [nodelist] peers = url|token, url|token. This lets a partner reflector that receives the same talker over the trunk (e.g. speed hearing an East Coast talker relayed from aldmr) enrich its Lastheard IN PLACE with the real source — 'East Coast Reflector via KT4ROY-SAT1', AllStar node, backend AllStar — instead of the bare trunk name 'KT4ROY-SAT1 / trunk'. No dupes: the receiving nodelist already applies talker-meta to trunk-delivered rows (via-gated), so it enriches the existing single row. Backward compatible; no peers = unchanged."
},
{
"date": "2026-07-31",
"repo": "web",
"hash": "4f5a617",
"type": "feature",
"summary": "On the AlabamaLink box (the bridge box) the AlabamaLink line is now folded into the SAME federation marquee — 'Part of the reflector-network.com federation … • Powered by Executor — a multi-mode digital voice server, part of the AlabamaLink network.' scrolling together in one bar, matching the DMR site's notice. No second banner. Gated on the local reflector identity (KT4ROY) from the status the page already fetches, so every other box keeps just the federation line."
"summary": "On the AlabamaLink box (aldmr) the AlabamaLink line is now folded into the SAME federation marquee — 'Part of the reflector-network.com federation … • Powered by Executor — a multi-mode digital voice server, part of the AlabamaLink network.' scrolling together in one bar, matching the DMR site's notice. No second banner. Gated on the local reflector identity (KT4ROY) from the status the page already fetches, so every other box keeps just the federation line."
},
{
"date": "2026-07-31",
@@ -340,7 +340,7 @@
"repo": "deploy",
"hash": "8ee1f46",
"type": "feature",
"summary": "deploy-remote.sh --conf deploys the per-box system config under /etc (deploy/etc for the hub box, deploy-the bridge box/etc for the bridge box). Secret-safe: each @@PLACEHOLDER@@ is filled from the CURRENT live file (section+key aware) so real passwords/tokens are never overwritten; a placeholder that can't be resolved skips the file (never writes @@ into a live config). Per-file diff + y/N confirm (or -y), -n dry-run, preserves target owner/mode. Runs before --bin so a following --bin restart picks up the new config. Also reconciled the astmeta.conf template with the live file (added the [nodelist] section) so its diff is clean."
"summary": "deploy-remote.sh --conf deploys the per-box system config under /etc (deploy/etc for speed, deploy-aldmr/etc for aldmr). Secret-safe: each @@PLACEHOLDER@@ is filled from the CURRENT live file (section+key aware) so real passwords/tokens are never overwritten; a placeholder that can't be resolved skips the file (never writes @@ into a live config). Per-file diff + y/N confirm (or -y), -n dry-run, preserves target owner/mode. Runs before --bin so a following --bin restart picks up the new config. Also reconciled the astmeta.conf template with the live file (added the [nodelist] section) so its diff is clean."
},
{
"date": "2026-07-28",
@@ -410,7 +410,7 @@
"repo": "nodelist",
"hash": "174b09d",
"type": "change",
"summary": "Monitor Nodes rebuilt to read ONE reflector /status (new /api/monitor-nodes) instead of the recursive crawl+aggregate: shows a Local section then one section per trunk with its nodes. Per-box source via MONITOR_STATUS_URL (the hub box=sm2ampr /geu/status/, the bridge box=its own /status). Search + mode toggle kept, borderless."
"summary": "Monitor Nodes rebuilt to read ONE reflector /status (new /api/monitor-nodes) instead of the recursive crawl+aggregate: shows a Local section then one section per trunk with its nodes. Per-box source via MONITOR_STATUS_URL (speed=sm2ampr /geu/status/, aldmr=its own /status). Search + mode toggle kept, borderless."
},
{
"date": "2026-07-28",
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Search matcher: glob wildcards * and ? → anchored regex; else substring.
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// fmt2() comes from lib/fmt.js (loaded before this file).
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
/* CTCSS Table view + export (beta)
* - One row per node (export can be multiple rows per node)
* - TX CTCSS = the access/mapping tone (CTCSS_TO_TG) the radio sends to pick a TG
-1
View File
@@ -1,5 +1,4 @@
<!doctype html>
<!-- Reflector Dashboard — Copyright (C) 2026 SA7AUX (Björn) — SPDX-License-Identifier: AGPL-3.0-or-later — see LICENSE -->
<html lang="en">
<head>
<meta charset="utf-8">
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Tab switching for help.html. Deep-linkable: #build, #setup, #admin, #portal.
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Shared hover info box: any element carrying a data-info attribute (URI-encoded
+110 -7
View File
@@ -1,5 +1,4 @@
<!doctype html>
<!-- Reflector Dashboard — Copyright (C) 2026 SA7AUX (Björn) — SPDX-License-Identifier: AGPL-3.0-or-later — see LICENSE -->
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -301,7 +300,28 @@
z-index: 2000;
}
#monitorSubMenu .dropdown-item{ padding: 6px 16px; white-space: nowrap; }
#lastheardMenuItem{ position: relative; }
#lastheardSubMenu{
position: absolute;
left: 0;
top: 100%;
min-width: 120px;
background: var(--panel);
border: 1px solid rgba(var(--accent-rgb),.35);
border-radius: 6px;
padding: 4px 0;
list-style: none;
margin: 0;
z-index: 2000;
}
#lastheardSubMenu .dropdown-item{ padding: 6px 16px; white-space: nowrap; }
/* Live lastheard: match the callmgr live page exactly — 800px centered
container (callmgr's <main max-width:800px>), 16px panel padding. */
#lastheardLivePanel{ max-width: 800px; margin: 0 auto; }
#lastheardLivePanel .panel{ padding: 16px; margin-bottom: 16px; }
/* Mobile responsive */
@media (max-width: 768px) {
.container, .container-fluid { padding-left: 10px; padding-right: 10px; }
@@ -340,7 +360,14 @@
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="#" id="navTgmon">TG Monitor</a></li>
<li class="nav-item"><a class="nav-link" href="#" id="navLastheard">Lastheard</a></li>
<li class="nav-item"><a class="nav-link" href="#" id="navListen">Listen Live</a></li>
<li class="nav-item" id="lastheardMenuItem">
<a class="nav-link" href="#" id="navLastheard">Last heard &#9662;</a>
<ul id="lastheardSubMenu" style="display:none;">
<li><a class="dropdown-item" href="#" id="navLastheardLive">Live</a></li>
<li><a class="dropdown-item" href="#" id="navLastheard24h">24h</a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="#" id="navCTCSS">CTCSS Table</a></li>
<li class="nav-item"><a class="nav-link" href="#" id="navMap">Map</a></li>
<li class="nav-item"><a class="nav-link" href="#" id="navChangelog">Changelog</a></li>
@@ -413,10 +440,63 @@
<div id="topologyBody" class="small"></div>
</div>
<!-- Lastheard -->
<!-- Lastheard — Live (mirrors the callmgr live page: 4 stat tiles + Live Talkers) -->
<div id="lastheardLivePanel" style="display:none;">
<div class="row g-2 mb-3" id="lhLiveStatsRow">
<div class="col-6 col-md-3">
<div class="panel text-center" style="background:rgba(0,128,255,.10);border-color:rgba(0,128,255,.4);">
<div class="small text-secondary">Active QSO's</div>
<div class="fs-3 fw-bold" id="lhLiveStatActive">0</div>
</div>
</div>
<div class="col-6 col-md-3">
<div class="panel text-center" style="background:rgba(0,200,0,.10);border-color:rgba(0,200,0,.4);">
<div class="small text-secondary">Repeaters</div>
<div class="fs-3 fw-bold" id="lhLiveStatRepeaters">0</div>
</div>
</div>
<div class="col-6 col-md-3">
<div class="panel text-center" style="background:rgba(255,200,0,.10);border-color:rgba(255,200,0,.4);">
<div class="small text-secondary">Clients</div>
<div class="fs-3 fw-bold" id="lhLiveStatClients">0</div>
</div>
</div>
<div class="col-6 col-md-3">
<div class="panel text-center" style="background:rgba(255,80,80,.10);border-color:rgba(255,80,80,.4);">
<div class="small text-secondary">Peer / Bridge</div>
<div class="fs-3 fw-bold" id="lhLiveStatBridges">0</div>
</div>
</div>
</div>
<div class="panel">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Live Talkers</h5>
<span id="lastheardLiveDot" class="small" style="color:#0f0;">&#x25CF; LIVE</span>
</div>
<div style="overflow-x:auto;min-height:220px;">
<table class="table table-sm mb-0 data-table" id="lhLiveTable" aria-label="Live talkers">
<thead>
<tr>
<th>Dir</th>
<th>Mode</th>
<th>Callsign</th>
<th>Location</th>
<th>TG</th>
</tr>
</thead>
<tbody id="lastheardLiveRows">
<tr><td colspan="5" class="text-secondary small">No active calls.</td></tr>
</tbody>
</table>
</div>
<p class="small text-secondary mt-2 mb-0">Currently keyed talkers. Mode is shown for local transmissions; bridge traffic shows RX only.</p>
</div>
</div>
<!-- Lastheard — 24h -->
<div id="lastheardPanel" class="panel mb-3" style="display:none;">
<div class="d-flex align-items-center gap-2 mb-2">
<div class="fw-bold me-auto">Last Heard (24h)</div>
<div class="fw-bold me-auto">Last Heard — 24h</div>
<span id="lastheardCount" class="small text-secondary"></span>
</div>
<div class="table-responsive">
@@ -435,6 +515,7 @@
<tbody id="lastheardRows"></tbody>
</table>
</div>
<div id="lastheardPager"></div>
</div>
<!-- CTCSS Table -->
@@ -508,6 +589,26 @@
</table>
</div>
</div>
<!-- Listen Live: pick a talkgroup, stream its live audio, see level + spectrum.
Laid out like the ECR "Listen Live FFT Audio Spectrum" page. -->
<div id="listenPanel" class="panel mb-3" style="display:none;">
<div style="max-width:880px;margin:0 auto;text-align:center;">
<h3 class="fw-bold mb-0" style="letter-spacing:.3px;">Listen Live</h3>
<div class="fw-bold mb-2" style="font-size:1.2rem;">FFT Audio Spectrum</div>
<div class="text-secondary small">Low-latency 16&nbsp;kHz PCM stream</div>
<div class="text-secondary small mb-3">Keep your audio in the amber range (not hitting red)</div>
<div class="d-flex justify-content-center align-items-center flex-wrap gap-2 mb-3">
<input id="listenTg" list="listenTgList" class="form-control form-control-sm" style="width:auto;min-width:240px;" placeholder="Pick a talkgroup or type a TG number" autocomplete="off" inputmode="numeric">
<datalist id="listenTgList"></datalist>
<button id="listenToggle" class="btn btn-primary" disabled>Start Streaming</button>
<span id="listenStatus" class="badge rounded-pill text-bg-secondary">Disconnected</span>
</div>
<div id="listenMeter" class="d-flex gap-1 mb-3" style="height:26px;" aria-label="Audio level"></div>
<canvas id="listenSpectrum" style="width:100%;height:300px;display:block;background:#0b0b0b;border-radius:10px;"></canvas>
<div class="text-secondary small mt-2">SA7AUX reflector — live talkgroup audio</div>
</div>
</div>
</main>
<script src="lib/api.js?v=20260922a" defer></script>
@@ -525,12 +626,14 @@
<script src="monitor_view.js?v=20260806e" defer></script>
<script src="trunks_view.js?v=20260806c" defer></script>
<script src="topology_view.js?v=20260806b" defer></script>
<script src="lastheard_view.js?v=20260803a" defer></script>
<script src="lastheard_view.js?v=20261118a" defer></script>
<script src="lastheard_live_view.js?v=20261118b" defer></script>
<script src="talker_view.js?v=20260720a" defer></script>
<script src="ctcss_view.js?v=20260704e" defer></script>
<script src="tgmon_view.js?v=20260826a" defer></script>
<script src="listen_view.js?v=20261113a" defer></script>
<script src="auth_ui.js?v=20261024a" defer></script>
<script src="app.js?v=20260728a" defer></script>
<script src="app.js?v=20261115b" defer></script>
<!-- Color edit — pick each part of the "Color" theme with a colour swatch.
Applies live; remembered in a cookie (and on the account when signed in). -->
+132
View File
@@ -0,0 +1,132 @@
'use strict';
/* Lastheard — LIVE. Shows ALL talkers heard in the last few seconds — local,
* trunk AND satellite alike — exactly like the 24h view, just a short live
* window. Driven by /api/lastheard (the SAME feed the 24h view uses), NOT by
* status.nodes[].isTalker, which only exists on local nodes and therefore misses
* every trunk/satellite talker (the bug). Newest on top; a talker lingers
* LIVE_WINDOW seconds after their over. 4 stat tiles + "● LIVE" dot. */
const LIVE_WINDOW = 10; // seconds a talker lingers after their over ends
let __lhEvents = [];
let __lhLiveTimer = null;
function lhLiveIsBridge(n){ return !!(n && (n.remoteTrunk || n.sat_id)); }
function lhLiveParseEvents(payload){
// LIVE reads the SEPARATE `live` feed (who is keyed NOW), NOT the 24h `events`
// history — the two are deliberately not mixed. Fall back to `events` only for an
// older server that does not yet serve `live`.
const arr = (payload && payload.live && payload.live.length) ? payload.live
: (payload && payload.events ? payload.events : []);
return arr
.map(e => {
if (typeof e === 'string'){ try { return JSON.parse(e); } catch { return null; } }
return e;
})
.filter(Boolean);
}
async function refreshLastheardLive(){
lhLiveStartTimer();
try {
const r = await apiFetch('/svxportal/api/lastheard?limit=50'); // lib/api.js
if (r && r.ok && r.json) __lhEvents = lhLiveParseEvents(r.json);
} catch(_){ /* keep last events */ }
renderLastheardLive();
}
// Direction: local transmit vs trunk/bridge inbound (RX). Everything that is not
// a plain local keyup is received over a trunk/satellite — shown as RX.
function lhLiveDir(net){
const b = String(net || '').toLowerCase();
return (b === '' || b === 'local' || b === 'svxlink') ? 'TX' : 'RX';
}
function updateLhLiveDot(){
const dot = document.getElementById('lastheardLiveDot');
if (!dot) return;
if (window.__svxSSE === 'down'){ dot.style.color = '#ff4040'; dot.innerHTML = '&#x25CF; RECONNECTING'; }
else { dot.style.color = '#0f0'; dot.innerHTML = '&#x25CF; LIVE'; }
}
function renderLastheardLive(){
const tbody = document.getElementById('lastheardLiveRows');
if (!tbody) return;
const esc = window.escHtml || (s => String(s));
const status = window.__svxportal_lastStatus || {};
const nodes = status.nodes || {};
const bn = status.bridge_nodes || {};
const now = Math.floor(Date.now()/1000);
updateLhLiveDot();
// Live talkers within the window (all sources), newest first, ONE row per
// talker: dedupe on callsign+TG so repeated overs don't stack up as doubles.
const seenKey = new Set();
const live = __lhEvents
.filter(e => (now - Number(e.ts || 0)) <= LIVE_WINDOW)
.sort((a,b) => Number(b.ts || 0) - Number(a.ts || 0))
.filter(e => {
const k = `${String(e.callsign||'').toUpperCase()}|${Number(e.tg||0)}`;
if (seenKey.has(k)) return false;
seenKey.add(k); return true;
});
// ---- 4 stat tiles ----
let repeaters = 0, clients = 0, bridges = 0;
for (const cs of Object.keys(nodes)){
const n = nodes[cs]; if (!n) continue;
if (lhLiveIsBridge(n)) bridges++;
else if (String(n.nodeClass||'').toLowerCase() === 'repeater') repeaters++;
else clients++;
}
const set = (id,v)=>{ const el=document.getElementById(id); if(el) el.textContent=String(v); };
set('lhLiveStatActive', live.length);
set('lhLiveStatRepeaters', repeaters);
set('lhLiveStatClients', clients);
set('lhLiveStatBridges', bridges);
// ---- Live Talkers table ----
if (live.length === 0){
tbody.innerHTML = '<tr><td colspan="5" class="text-secondary small">No active calls.</td></tr>';
return;
}
tbody.innerHTML = live.map(e => {
const age = now - Number(e.ts || 0);
const bi = bn[String(e.callsign || '').toUpperCase()];
const net = e.network || (bi && bi.network) || '';
const dir = lhLiveDir(net) === 'RX'
? '<span class="badge bg-info">RX</span>'
: '<span class="badge bg-success">TX</span>';
const mode = net ? `<span class="mono">${esc(net)}</span>` : '<span class="text-secondary">&mdash;</span>';
const loc = esc(e.location || (bi && bi.system) || '');
// Fresh (just now) = green on air; older within the window = grey lingering.
const bg = age <= 3 ? 'rgba(25,135,84,0.85)' : 'rgba(108,117,125,0.65)';
return `<tr style="background:${bg};">
<td>${dir}</td>
<td>${mode}</td>
<td class="mono"><b>${esc(e.callsign || '')}</b></td>
<td class="wrap">${loc}</td>
<td class="mono">${Number(e.tg || 0)}</td>
</tr>`;
}).join('');
}
// 2 s poll while the panel is open: re-fetch events so trunk/satellite talkers
// appear fast, and let lingering rows age out of the window.
function lhLiveStartTimer(){
if (__lhLiveTimer) return;
__lhLiveTimer = setInterval(() => {
if (document.getElementById('lastheardLivePanel')?.style.display === 'none'){
lhLiveStopTimer(); return;
}
refreshLastheardLive();
}, 2000);
}
function lhLiveStopTimer(){ if (__lhLiveTimer){ clearInterval(__lhLiveTimer); __lhLiveTimer = null; } }
window.refreshLastheardLive = refreshLastheardLive;
window.renderLastheardLive = renderLastheardLive;
window.updateLhLiveDot = updateLhLiveDot;
+93 -60
View File
@@ -1,27 +1,27 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
/* Last Heard — 24h history. Shows EVERY key-up (the server appends one row per
* over), newest first, PAGINATED: a dynamic page size (rows that fit the current
* window, recomputed on resize) with « First ‹ Prev · 1 2 3 · Next › Last » in the
* footer (shared lib/pager.js). Fetches up to 1000 rows (the API cap) once; paging
* is client-side, so Next/Prev never re-hit the server. The LIVE panel is a
* separate view (lastheard_live_view.js) reading the separate `live` feed. */
let __lhInflight = false;
let __lhAllEvents = []; // all fetched 24h events (up to 1000), newest first
let __lhPage = 1; // current page (1-based)
let __lhResizeWired = false;
async function refreshLastheard(){
if (__lhInflight) return;
__lhInflight = true;
try {
const r = await apiFetch('/svxportal/api/lastheard?limit=200'); // lib/api.js
const r = await apiFetch('/svxportal/api/lastheard?limit=1000'); // lib/api.js
if(!r.ok || !r.json){
renderLastheard({events:[], count:0, _err:`http ${r.status}`});
return;
}
const j = r.json;
renderLastheard(j);
renderLastheard(r.json);
} catch(e){
renderLastheard({events:[], count:0, _err:String(e)});
} finally {
@@ -29,63 +29,96 @@ async function refreshLastheard(){
}
}
function renderLastheard(payload){
// Turn the stored events into table rows for the CURRENT page only.
function lhRowHtml(e, now, bn){
const ts = Number(e.ts || 0);
const ageStr = formatAge(now - ts);
const absTs = new Date(ts*1000).toLocaleString();
const dur = Number(e.duration_s || 0);
const durStr = dur >= 60 ? `${Math.floor(dur/60)}m${dur%60}s` : `${dur}s`;
const sig = (e.siglev !== undefined && e.siglev !== null && e.siglev !== 0)
? ` <span class="text-secondary mono">${Number(e.siglev).toFixed(0)}</span>` : '';
const rx = e.rx_name ? `${escHtml(e.rx_name)}${sig}` : '<span class="text-secondary">-</span>';
const bi = bn[String(e.callsign || '').toUpperCase()];
const eSystem = e.system || (bi && bi.system) || '';
// Backend = HOW the talker enters (AllStar / SVXLink / trunk / DMR / PBX …), the
// ingress path (the network field). Callsign + Location split is filled by the
// backend; the web just renders it (uniform on every box).
const eBackend = e.network || (bi && bi.network) || '';
const csCell = `<b>${escHtml(e.callsign || eSystem || '')}</b>`;
return `<tr>
<td class="mono nowrap" title="${escHtml(absTs)}">${ageStr}</td>
<td class="mono">${csCell}</td>
<td class="wrap">${escHtml(eBackend)}</td>
<td class="mono nowrap">${Number(e.tg||0)}</td>
<td class="wrap">${escHtml(e.location || '')}</td>
<td class="wrap">${rx}</td>
<td class="mono nowrap">${durStr}</td>
</tr>`;
}
// Render ONLY the current page + the pager footer. No refetch — pure client paging.
function lhRenderPage(){
const tbody = document.getElementById('lastheardRows');
const cnt = document.getElementById('lastheardCount');
const pager = document.getElementById('lastheardPager');
if(!tbody) return;
const evs = (payload?.events || []).map(e => {
const evs = __lhAllEvents;
if (evs.length === 0){
tbody.innerHTML = `<tr><td colspan="8" class="text-secondary">No keyups recorded in last 24h.</td></tr>`;
if (pager) pager.innerHTML = '';
return;
}
// Dynamic page size: how many rows fit below the table in the current window
// (recomputed here so a resize re-pages). pageSizeFor falls back sanely when the
// panel is momentarily hidden. Shared helper, same as the other paginated views.
const pageSize = (window.pageSizeFor ? window.pageSizeFor('lastheardRows', 34, 150) : 25);
const pages = (window.paginate ? window.paginate.totalPages(evs.length, pageSize)
: Math.max(1, Math.ceil(evs.length / pageSize)));
if (__lhPage > pages) __lhPage = pages;
if (__lhPage < 1) __lhPage = 1;
const slice = (window.paginate ? window.paginate.slice(evs, pageSize, __lhPage)
: evs.slice(0, pageSize));
const bn = (window.__svxportal_lastStatus && window.__svxportal_lastStatus.bridge_nodes) || {};
const now = Math.floor(Date.now()/1000);
tbody.innerHTML = slice.map(e => lhRowHtml(e, now, bn)).join('');
// Footer pager: « First ‹ Prev · 1 2 3 · Next › Last ».
if (pager && window.paginate){
window.paginate.render(pager, evs.length, pageSize, __lhPage, (p) => {
__lhPage = p;
lhRenderPage();
});
}
}
function renderLastheard(payload){
const cnt = document.getElementById('lastheardCount');
__lhAllEvents = (payload?.events || []).map(e => {
if (typeof e === 'string'){ try{ return JSON.parse(e); }catch{ return null; } }
return e;
}).filter(Boolean);
if (cnt) cnt.textContent = evs.length ? `${evs.length} event${evs.length===1?'':'s'} / last 24h` :
(payload?._err ? `error: ${payload._err}` : 'no events yet');
if (evs.length === 0){
tbody.innerHTML = `<tr><td colspan="8" class="text-secondary">No keyups recorded in last 24h.</td></tr>`;
return;
if (cnt){
cnt.textContent = __lhAllEvents.length
? `${__lhAllEvents.length} event${__lhAllEvents.length===1?'':'s'} / last 24h`
: (payload?._err ? `error: ${payload._err}` : 'no events yet');
}
// Network bridge directory (crawled from every reflector): so a bridge that
// arrives bare over a trunk (hub reflector: node/system empty) renders IDENTICALLY to
// where it is a local client (bridge box: astmeta filled node/system). Same code,
// same result on both boxes.
const bn = (window.__svxportal_lastStatus && window.__svxportal_lastStatus.bridge_nodes) || {};
const now = Math.floor(Date.now()/1000);
tbody.innerHTML = evs.map(e => {
const ts = Number(e.ts || 0);
const age = now - ts;
const ageStr = formatAge(age);
const absTs = new Date(ts*1000).toLocaleString();
const dur = Number(e.duration_s || 0);
const durStr = dur >= 60 ? `${Math.floor(dur/60)}m${dur%60}s` : `${dur}s`;
const sig = (e.siglev !== undefined && e.siglev !== null && e.siglev !== 0)
? ` <span class="text-secondary mono">${Number(e.siglev).toFixed(0)}</span>` : '';
const rx = e.rx_name ? `${escHtml(e.rx_name)}${sig}` : '<span class="text-secondary">-</span>';
const bi = bn[String(e.callsign || '').toUpperCase()];
const eSystem = e.system || (bi && bi.system) || '';
// Backend = HOW the talker enters (AllStar / SVXLink / trunk / DMR / PBX …),
// the ingress path — same concept the DMR side calls "Backend" (there "Mode"
// means the DV protocol, a different fact). Carried in the network field.
const eBackend = e.network || (bi && bi.network) || '';
// Callsign column = the callsign field as-is (e.g. the trunk callsign
// KT4ROY-ASL). The gateway/reflector descriptor ("East Coast Reflector via
// 45225 / W2ECR") lives in the Location column. Uniform on every box: an
// AllStar row (bridge box) and the same talker arriving over the trunk (hub)
// render identically — the backend already fills callsign + location, the
// web just shows them, it never re-derives the name.
const csCell = `<b>${escHtml(e.callsign || eSystem || '')}</b>`;
return `<tr>
<td class="mono nowrap" title="${escHtml(absTs)}">${ageStr}</td>
<td class="mono">${csCell}</td>
<td class="wrap">${escHtml(eBackend)}</td>
<td class="mono nowrap">${Number(e.tg||0)}</td>
<td class="wrap">${escHtml(e.location || '')}</td>
<td class="wrap">${rx}</td>
<td class="mono nowrap">${durStr}</td>
</tr>`;
}).join('');
lhRenderPage();
// Re-page on window resize so the page size follows the screen / web box.
if (!__lhResizeWired){
__lhResizeWired = true;
let t = null;
window.addEventListener('resize', () => {
clearTimeout(t);
t = setTimeout(lhRenderPage, 150);
});
}
}
function formatAge(sec){
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// api.js — shared HTTP helpers for every web (dmr-web, svx-web, svxlink-web).
// Canonical copy: <dmr-portal>/lib/api.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/api.js; other repos carry a COPY.
//
// apiFetch(url, {method, body, form, csrf, headers, quiet}) → {ok, status, json}
// apiGet(url, opts) → json | null GET, cache: no-store
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// auth_ui.js — shared sign-in / register / sign-out transport (dmr-web, svx-web).
// Canonical copy: <dmr-portal>/lib/auth_ui.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/auth_ui.js; other repos carry a COPY.
// Needs lib/api.js. Pages keep their own field validation and messages; this
// owns the request/response contract so both webs behave the same.
//
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// changelog.js — shared "recent updates" viewer (dmr-web, svx-web).
// Canonical copy: <dmr-portal>/lib/changelog.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/changelog.js; other repos carry a COPY.
// Reads changelog.json (newest first, {date, repo, hash, type, summary}) and
// renders a client-side paginated list. Needs lib/fmt.js (escHtml).
//
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// fmt.js — shared formatting helpers for every web (dmr-web, svx-web, svxlink-web).
// Canonical copy: <dmr-portal>/lib/fmt.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/fmt.js; other repos carry a COPY.
// Every function here replaced an identical local copy; outputs are unchanged.
(function () {
'use strict';
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// pager.js — shared pagination (dmr-web, svx-web).
// Canonical copy: <dmr-portal>/lib/pager.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/pager.js; other repos carry a COPY.
//
// pageSizeFor('monitorBody', 32, 160) rows that fit below the element (min 5)
// pagerHtml({page, pages, total, noun, cls}) footer « ‹ 1..n › » as HTML;
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
/* Theme engine — Dark / Light / Color, with a Color editor. Shared by every web
* (canonical copy: <dmr-portal>/lib/theme.js; other repos carry a COPY).
* (canonical copy: callmgr2/www-mumien/lib/theme.js; other repos carry a COPY).
* Page settings: window.THEME_AUTH_BASE (default '/auth/'); window.THEME_SERVER_SYNC = false
* disables the per-account sync (svxlink-web has no account backend).
*
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// ui_field.js — shared form-field builders (dmr-web, svx-web, svxlink-web).
// Canonical copy: <dmr-portal>/lib/ui_field.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/ui_field.js; other repos carry a COPY.
//
// makeToggleBtn(isOn, onFlip(next, btn), extraCls) Enable/Disable button; .value 'true'/'false', .setOn()
// makeBoolSelect(cls, val, disabled) same button, fires 'change' — drop-in for a true/false <select>
+1 -10
View File
@@ -1,15 +1,6 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// ui_list.js — shared list editor for every web (dmr-web, svx-web, svxlink-web).
//
// Canonical copy: <dmr-portal>/lib/ui_list.js. Other repos carry a
// Canonical copy: callmgr2/www-mumien/lib/ui_list.js. Other repos carry a
// plain COPY (never a symlink); deploy copies it in. Plain script, no deps
// beyond the shared CSS classes (btn, form-control, data-table, mono).
//
+1 -10
View File
@@ -1,14 +1,5 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
// ui_msg.js — shared status/error message helpers (dmr-web, svx-web, svxlink-web).
// Canonical copy: <dmr-portal>/lib/ui_msg.js; other repos carry a COPY.
// Canonical copy: callmgr2/www-mumien/lib/ui_msg.js; other repos carry a COPY.
//
// setMsg(elOrId, text, isErr) inline text line: hidden when empty, green/red
// showErr(elOrId, text) show/hide an error line, keeps its own colour
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
function renderList(nodes){
+311
View File
@@ -0,0 +1,311 @@
'use strict';
// Listen Live — pick a talkgroup, stream its live reflector audio, and watch the
// level meter + FFT spectrum. Talks to the svx-web listen service over a
// WebSocket that delivers raw 16 kHz s16 little-endian mono PCM.
//
// Self-contained: it wires its own nav item and panel (no app.js changes). The
// stream runs ONLY while you press Start and the panel is open — leaving the
// panel, closing the tab or a dead socket all stop it (the service tears its
// bridge down when the last listener goes).
(function () {
const SAMPLE_RATE = 16000;
const SEGMENTS = 30;
const DECAY = 0.85;
const MAX_QUEUE = 24; // ~0.5 s of 20 ms frames before we drop (keeps latency low)
const MAX_RETRIES = 5;
// WS endpoint. Override with window.LISTEN_WS_BASE; default is same-origin,
// reverse-proxied at /svxlisten/ -> the listen service.
function wsURL(tg) {
const base = window.LISTEN_WS_BASE ||
((location.protocol === 'https:' ? 'wss://' : 'ws://') + location.host + '/svxlisten');
return base + '/listen?tg=' + encodeURIComponent(tg);
}
let socket = null, audioCtx = null, analyser = null, freqData = null;
let bufferQueue = [], nextStartTime = 0, displayed = 0, rafId = 0;
let playing = false, attempts = 0;
// Per-TG access level (free/members/off) from tglist.php, and this viewer's
// login state from /auth/me.php — so we can gate before opening the socket.
let tgLevel = {}, loggedIn = false;
const $ = (id) => document.getElementById(id);
const sel = () => $('listenTg'), btn = () => $('listenToggle'), stat = () => $('listenStatus');
// The picker is a free-text combobox: a datalist option ("2403 · Sweden") or a
// hand-typed number both work — take the leading integer as the TG.
const tgOf = () => { const n = parseInt(((sel() && sel().value) || '').trim(), 10); return n > 0 ? n : 0; };
function setStatus(msg, bg) {
const s = stat(); if (!s) return;
s.textContent = msg;
s.className = 'badge rounded-pill text-bg-' + (bg || 'secondary');
}
// members-only TG and not signed in: show a prompt with a sign-in link.
function setLoginNeeded() {
const s = stat(); if (!s) return;
s.className = 'badge rounded-pill text-bg-warning';
s.innerHTML = 'Login required — <a href="/auth/login.php" style="text-decoration:underline;color:inherit;">sign in</a>';
}
const levelOf = (tg) => tgLevel[tg] || 'free'; // unknown/typed TG -> free (server still enforces)
// ── level meter (30 segments, green -> amber -> red) ──
function buildMeter() {
const m = $('listenMeter'); if (!m || m.childElementCount) return;
for (let i = 0; i < SEGMENTS; i++) {
const d = document.createElement('div');
d.style.cssText = 'flex:1;border-radius:2px;background:#161616;';
m.appendChild(d);
}
}
function paintMeter(level) { // level 0..1
const m = $('listenMeter'); if (!m) return;
if (level < 0.0001) level = 0.0001;
const db = Math.max(-30, 20 * Math.log10(level));
const target = ((db + 30) / 30) * SEGMENTS;
displayed = Math.max(target, displayed * DECAY);
const active = Math.round(displayed);
const segs = m.children;
for (let i = 0; i < segs.length; i++) {
let bg = '#161616';
if (i < active) bg = (i < SEGMENTS * 0.5) ? '#2e9b3e' : (i < SEGMENTS * 0.8) ? '#ffa500' : '#ff3b30';
segs[i].style.background = bg;
}
}
// ── spectrum ──
function initAnalyser() {
analyser = audioCtx.createAnalyser();
analyser.fftSize = 1024;
analyser.smoothingTimeConstant = 0.8;
freqData = new Uint8Array(analyser.frequencyBinCount);
}
// ECR-style scope: dB grid + labels down the left, frequency ticks along the
// bottom (the 0–4 kHz voice band), yellow bars over it.
function drawSpectrum() {
const cv = $('listenSpectrum');
if (!cv || !analyser) { rafId = 0; return; }
const w = cv.clientWidth, h = cv.clientHeight;
if (cv.width !== w) cv.width = w;
if (cv.height !== h) cv.height = h;
const ctx = cv.getContext('2d');
const x0 = 36, botPad = 16, plotW = w - x0, plotH = h - botPad;
ctx.clearRect(0, 0, w, h);
ctx.font = '10px system-ui, sans-serif';
ctx.lineWidth = 1;
// dB grid (−10 at top … −60 near bottom)
const dbs = [-10, -20, -30, -40, -50, -60];
ctx.textBaseline = 'middle';
for (let k = 0; k < dbs.length; k++) {
const y = 2 + (plotH - 4) * (k / (dbs.length - 1));
ctx.strokeStyle = 'rgba(255,255,255,0.08)';
ctx.beginPath(); ctx.moveTo(x0, y); ctx.lineTo(w, y); ctx.stroke();
ctx.fillStyle = 'rgba(255,255,255,0.45)';
ctx.fillText(dbs[k] + ' dB', 2, y);
}
analyser.getByteFrequencyData(freqData);
const nyquist = SAMPLE_RATE / 2, maxHz = 4000, bins = freqData.length;
const maxBin = Math.max(1, Math.min(bins, Math.round((maxHz / nyquist) * bins)));
// frequency grid + labels
ctx.textBaseline = 'alphabetic';
for (const f of [500, 1000, 2000, 3000, 4000]) {
const x = x0 + (f / maxHz) * plotW;
ctx.strokeStyle = 'rgba(255,255,255,0.08)';
ctx.beginPath(); ctx.moveTo(x, 2); ctx.lineTo(x, plotH); ctx.stroke();
ctx.fillStyle = 'rgba(255,255,255,0.45)';
ctx.fillText(f >= 1000 ? (f / 1000) + ' kHz' : f + ' Hz', x + 2, h - 4);
}
// bars
const bw = plotW / maxBin;
ctx.fillStyle = '#EAC700';
for (let i = 0; i < maxBin; i++) {
const bh = (freqData[i] / 255) * (plotH - 2);
ctx.fillRect(x0 + i * bw, plotH - bh, Math.max(1, bw - 0.5), bh);
}
rafId = requestAnimationFrame(drawSpectrum);
}
// ── playback ──
function playNext() {
if (!playing || !audioCtx || bufferQueue.length === 0) return;
const pcm = bufferQueue.shift();
if (!pcm || pcm.byteLength < 2) return;
const frames = pcm.byteLength >> 1;
const buf = audioCtx.createBuffer(1, frames, SAMPLE_RATE);
const ch = buf.getChannelData(0);
const view = new DataView(pcm);
let peak = 0;
for (let i = 0; i < frames; i++) {
const s = view.getInt16(i * 2, true) / 32768;
ch[i] = s;
const a = Math.abs(s); if (a > peak) peak = a;
}
paintMeter(peak);
const src = audioCtx.createBufferSource();
src.buffer = buf;
src.connect(analyser);
analyser.connect(audioCtx.destination);
const now = audioCtx.currentTime;
nextStartTime = Math.max(nextStartTime, now);
src.start(nextStartTime);
nextStartTime += buf.duration;
src.onended = () => { if (playing && bufferQueue.length) playNext(); };
}
// ── stream control ──
function start() {
const tg = tgOf();
if (!tg) { setStatus('Enter a talkgroup', 'warning'); return; }
// Access gate (mirrors the server; the service enforces it too).
const lv = levelOf(tg);
if (lv === 'off') { setStatus('Not available for listening', 'secondary'); resetButton(); return; }
if (lv === 'members' && !loggedIn) { setLoginNeeded(); resetButton(); return; }
if (playing) stop(true);
attempts++;
setStatus('Connecting…', 'warning');
try {
if (!audioCtx) {
audioCtx = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: SAMPLE_RATE, latencyHint: 'interactive' });
initAnalyser();
}
audioCtx.resume && audioCtx.resume();
socket = new WebSocket(wsURL(tg));
socket.binaryType = 'arraybuffer';
socket.onopen = () => {
attempts = 0; playing = true;
btn().textContent = 'Stop Streaming'; btn().classList.replace('btn-primary', 'btn-danger');
setStatus('Connected', 'success');
nextStartTime = 0;
if (!rafId) drawSpectrum();
};
socket.onmessage = (e) => {
if (!(e.data instanceof ArrayBuffer)) return;
if (bufferQueue.length < MAX_QUEUE) {
bufferQueue.push(e.data);
if (bufferQueue.length === 1) playNext();
}
};
socket.onerror = () => { setStatus('Connection error', 'danger'); };
socket.onclose = (ev) => {
if (playing) { playing = false; retryOrGiveUp(tg, ev.code); }
else cleanup();
};
} catch (err) {
setStatus('Failed', 'danger');
retryOrGiveUp(tg, 0);
}
}
function retryOrGiveUp(tg) {
cleanup();
if (attempts < MAX_RETRIES && tgOf() === tg && panelVisible()) {
setStatus('Reconnecting (' + (attempts + 1) + '/' + MAX_RETRIES + ')…', 'warning');
setTimeout(() => { if (panelVisible() && tgOf() === tg) start(); }, 2000);
} else {
setStatus('Disconnected', 'secondary');
resetButton();
}
}
function cleanup() {
playing = false;
bufferQueue = [];
if (socket) { try { socket.onclose = null; socket.close(); } catch (_) {} socket = null; }
}
function stop(silent) {
cleanup();
if (rafId) { cancelAnimationFrame(rafId); rafId = 0; }
paintMeter(0.0001); displayed = 0; paintMeter(0.0001);
const cv = $('listenSpectrum');
if (cv) { const c = cv.getContext('2d'); c && c.clearRect(0, 0, cv.width, cv.height); }
resetButton();
if (!silent) setStatus('Disconnected', 'secondary');
}
function resetButton() {
const b = btn(); if (!b) return;
b.textContent = 'Start Streaming'; b.classList.replace('btn-danger', 'btn-primary');
}
// ── talkgroup list (datalist suggestions; the input also takes any typed TG) ──
let tgsLoaded = false;
async function loadTgs() {
if (btn()) btn().disabled = false; // typing a TG works even before the list loads
if (tgsLoaded) return;
try {
const r = await fetch('tglist.php', { cache: 'no-store' });
const list = await r.json();
const dl = $('listenTgList'); if (!dl) return;
dl.innerHTML = '';
tgLevel = {};
(Array.isArray(list) ? list : (list.tgs || [])).forEach((o) => {
if (!o || !o.tg) return;
const lv = o.listen || 'free';
tgLevel[o.tg] = lv;
if (lv === 'off') return; // hidden from Listen Live
const op = document.createElement('option');
op.value = String(o.tg); // picking inserts the number
op.label = o.tg + (o.name ? ' · ' + o.name : '') + (lv === 'members' ? ' 🔒' : '');
dl.appendChild(op);
});
tgsLoaded = true;
} catch (_) {
// Not fatal — you can still type a TG number by hand.
}
}
// Is this viewer signed in? (for 'members' TGs). Cheap, re-checked each open.
async function checkMe() {
try {
const r = await fetch('/auth/me.php', { credentials: 'same-origin', cache: 'no-store' });
const j = await r.json();
loggedIn = !!(j && j.logged_in);
} catch (_) { loggedIn = false; }
}
// ── nav wiring (self-contained; no app.js edits) ──
const OTHER_NAVS = ['navList', 'navClients', 'navMonitor', 'navMonitorNodes', 'navMonitorTrunks',
'navMonitorTopology', 'navTgmon', 'navLastheard', 'navCTCSS', 'navChangelog'];
const panel = () => $('listenPanel');
const panelVisible = () => panel() && panel().style.display !== 'none';
function showPanel() {
document.querySelectorAll('main .panel').forEach((p) => { if (p.id !== 'listenPanel') p.style.display = 'none'; });
const lp = $('listPanel'); if (lp) lp.style.display = 'none';
if (panel()) panel().style.display = 'block';
$('navListen') && $('navListen').classList.add('active');
OTHER_NAVS.forEach((id) => $(id) && $(id).classList.remove('active'));
buildMeter();
loadTgs();
checkMe();
}
function hidePanel() {
if (panel()) panel().style.display = 'none';
$('navListen') && $('navListen').classList.remove('active');
if (location.hash === '#listen') history.replaceState(null, '', location.pathname + location.search);
stop();
}
function wire() {
$('navListen') && $('navListen').addEventListener('click', (e) => { e.preventDefault(); showPanel(); });
OTHER_NAVS.forEach((id) => $(id) && $(id).addEventListener('click', () => { if (panelVisible()) hidePanel(); }));
btn() && btn().addEventListener('click', () => { if (playing) stop(); else start(); });
sel() && sel().addEventListener('change', () => { if (playing) start(); }); // switch TG live (blur / pick)
sel() && sel().addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); if (tgOf()) start(); } });
window.addEventListener('beforeunload', cleanup);
// Deep link: the menu on the auth/PHP pages (header.php) links here with
// /#listen — open the panel when we land on it, and on later hash changes.
// Deferred so it wins over app.js's default (clients) view on first load.
const openIfHash = () => { if (location.hash === '#listen' && $('listenPanel')) showPanel(); };
window.addEventListener('hashchange', openIfHash);
if (location.hash === '#listen') setTimeout(openIfHash, 0);
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', wire);
else wire();
})();
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
/*
* Monitor → Nodes. Read ONE reflector /status (via nodelist /api/monitor-nodes)
+1
View File
@@ -0,0 +1 @@
10010
-10
View File
@@ -1,15 +1,5 @@
#!/usr/bin/env php
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
/*
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
function updateTalkerPopup(nodes, talkerMeta){
+3 -10
View File
@@ -1,14 +1,4 @@
<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/auth/lib.php';
@@ -24,12 +14,15 @@ if (is_string($p) && is_file($p)) {
if (is_array($j) && isset($j['tgs']) && is_array($j['tgs'])) {
foreach ($j['tgs'] as $o) {
if (!is_array($o)) continue;
$lv = strtolower(trim((string)($o['listen'] ?? 'free')));
if (!in_array($lv, ['free', 'members', 'off'], true)) $lv = 'free';
$tgs[] = [
'tg' => (int)($o['tg'] ?? 0),
'name' => (string)($o['name'] ?? ''),
'system' => (string)($o['system'] ?? ''),
'allstar' => (string)($o['allstar'] ?? ''),
'mode' => (string)($o['mode'] ?? ''),
'listen' => $lv, // Listen Live access level (free/members/off)
];
}
}
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// TG Monitor — vilka klienter finns på varje TG, per mode + sida (SVX/DMR).
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Monitor → Topology. Reads the complete structure nodelist collected
-9
View File
@@ -1,12 +1,3 @@
// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
// Monitor → Trunks: ONLY the trunks THIS reflector is configured to trunk against,