745 lines
35 KiB
HTML
Executable File
745 lines
35 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title id="webtitle"></title>
|
|
<link href="css/styles.css" rel="stylesheet" media="screen">
|
|
<script src="js/auth.js"></script>
|
|
<script src="js/jquery.js"></script>
|
|
<script src="js/dashboard.js"></script>
|
|
<style>
|
|
/* inherit the page's colours: styles.css themes this shell light or dark */
|
|
.spec-toolbar { display:flex; flex-wrap:wrap; gap:18px; align-items:center; margin-bottom:10px; }
|
|
.spec-toolbar label { font-size:13px; color:inherit; }
|
|
.spec-readouts { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
|
|
.spec-readout { min-width:130px; padding:8px 12px; border:1px solid rgba(148,163,184,0.35); border-radius:6px; }
|
|
.spec-readout .k { display:block; font-size:11px; letter-spacing:.04em; text-transform:uppercase; opacity:.7; }
|
|
.spec-readout .v { display:block; font-size:18px; font-weight:600; }
|
|
#spec_canvas { width:100%; height:420px; display:block; background:#0b1220; border-radius:6px; }
|
|
#eye_canvas { width:100%; height:380px; display:block; background:#0b1220; border-radius:6px; }
|
|
#eye_state { font-size:13px; opacity:.7; margin-left:auto; }
|
|
#spec_state { font-size:13px; opacity:.7; margin-left:auto; }
|
|
</style>
|
|
<script>
|
|
var lastTime = new Date().getTime();
|
|
var currentTime = new Date().getTime();
|
|
var timeOut = 20 * 60 * 1000; // 20 minutes
|
|
|
|
$(function(){
|
|
$(document).on('mousemove keydown click scroll touchstart', function(){
|
|
lastTime = new Date().getTime();
|
|
});
|
|
});
|
|
|
|
function testTime(){
|
|
currentTime = new Date().getTime();
|
|
if(currentTime - lastTime > timeOut){
|
|
window.location.href="login.cgi?logout=1";
|
|
}
|
|
}
|
|
window.setInterval(testTime, 1000);
|
|
setInterval(refreshDashboard, 3000);
|
|
|
|
function get_remote_local_ctrl()
|
|
{
|
|
$.get("atsc_status_cfg.cgi?sys_cfg=&", function(data, status){
|
|
if (typeof data === 'object' && data !== null) return;
|
|
var table = String(data).split("|");
|
|
document.title = table[0].split("#")[11];
|
|
});
|
|
}
|
|
|
|
function refresh_show(){
|
|
get_remote_local_ctrl();
|
|
refreshDashboard();
|
|
specInit();
|
|
}
|
|
|
|
/* ================= ORx IQ spectrum =================
|
|
* iq_spectrum.cgi hands back the newest window analysed by the app's iq_rx
|
|
* thread: a 1024-point Welch over one 26.2 ms window of the 10 MSPS complex
|
|
* ORx stream. psd[] is in dB relative to the mean in-band flat density
|
|
* (|f| < 2.5 MHz) -- the only shoulder yardstick that does not move when the
|
|
* FFT length changes. See Notes/Result06-5.md section 7.
|
|
*/
|
|
var SPEC_TIMER = null;
|
|
var specPeak = null; // peak-hold trace
|
|
var specLast = null;
|
|
var specFails = 0;
|
|
|
|
var Y_TOP = 30, Y_BOT = -80; // dB rel in-band flat density
|
|
var SH_LO = 3.5, SH_HI = 4.8; // shoulder band the app takes the median over
|
|
|
|
function specInit(){
|
|
window.addEventListener('resize', function(){ if (specLast) drawSpectrum(specLast); else drawGrid(); });
|
|
drawGrid();
|
|
specRestart();
|
|
eyeRestart();
|
|
}
|
|
|
|
/* PR12: the Refresh/Pause/Peak-hold toolbar and the status lines were
|
|
* removed on request, so these helpers tolerate the elements being absent
|
|
* (fixed 1 s refresh, never paused, no peak-hold). */
|
|
function elChecked(id){ var e = document.getElementById(id); return !!(e && e.checked); }
|
|
function specRateMs(){ var e = document.getElementById('spec_rate'); return e ? Number(e.value) : 1000; }
|
|
|
|
function specRestart(){
|
|
if (SPEC_TIMER) clearInterval(SPEC_TIMER);
|
|
if (elChecked('spec_pause')) { setState('paused'); return; }
|
|
specFetch();
|
|
SPEC_TIMER = setInterval(specFetch, specRateMs());
|
|
}
|
|
|
|
function setState(s){ var e = document.getElementById('spec_state'); if (e) e.innerText = s; }
|
|
function setEyeState(s){ var e = document.getElementById('eye_state'); if (e) e.innerText = s; }
|
|
|
|
function specFetch(){
|
|
$.ajax({url: 'iq_spectrum.cgi?t=' + Date.now(), dataType: 'json', cache: false})
|
|
.done(function(d){
|
|
if (!d || d.error){
|
|
if (d && d.redirect) { window.location.href = d.redirect; return; }
|
|
setState(d && d.error === 'nodata' ? 'no window captured yet' : 'error');
|
|
return;
|
|
}
|
|
specFails = 0;
|
|
specLast = d;
|
|
updateReadouts(d);
|
|
drawSpectrum(d);
|
|
setState('window ' + d.wid + ' | updated ' + new Date().toLocaleTimeString());
|
|
})
|
|
.fail(function(){ specFails++; setState('fetch failed (' + specFails + ')'); });
|
|
}
|
|
|
|
function updateReadouts(d){
|
|
/* PR12: the readout cards under the spectrum were removed; d.shoulder
|
|
* and d.pilot are still drawn on the plot itself in drawSpectrum(). */
|
|
}
|
|
|
|
|
|
/* ================= 8VSB eye =================
|
|
* iq_eye.cgi returns the newest window demodulated by the app's iq_vsb thread:
|
|
* matched filter -> j^k derotation -> 130 x 192 persistence map (base64, log-scaled).
|
|
* The demod is expensive and nice'd, so a new eye lands roughly every 10 s; the page
|
|
* polls at the same rate as the spectrum and redraws only when the window id changes.
|
|
*/
|
|
var EYE_TIMER = null, eyeWid = -1, eyeFails = 0;
|
|
var eyeLastData = null; // newest iq_eye.json, for the in-band noise line
|
|
|
|
function eyeRestart(){
|
|
if (EYE_TIMER) clearInterval(EYE_TIMER);
|
|
if (elChecked('spec_pause')) return;
|
|
eyeFetch();
|
|
EYE_TIMER = setInterval(eyeFetch, specRateMs());
|
|
}
|
|
|
|
function eyeFetch(){
|
|
$.ajax({url: 'iq_eye.cgi?t=' + Date.now(), dataType: 'json', cache: false})
|
|
.done(function(d){
|
|
if (!d || d.error){
|
|
if (d && d.redirect) { window.location.href = d.redirect; return; }
|
|
setEyeState((d && d.error === 'nodata') ? 'no window demodulated yet' : 'error');
|
|
return;
|
|
}
|
|
if (!d.sync){ setEyeState('no symbol lock'); return; }
|
|
eyeFails = 0;
|
|
eyeLastData = d;
|
|
eyeReadouts(d);
|
|
if (d.wid !== eyeWid){ eyeWid = d.wid; drawEye(d); }
|
|
setEyeState('window ' + d.wid + ' | ' + d.nsym + ' symbols');
|
|
})
|
|
.fail(function(){ eyeFails++; setEyeState('fetch failed (' + eyeFails + ')'); });
|
|
}
|
|
|
|
function eyeReadouts(d){
|
|
/* PR12: only SNR/MER and SNR raw remain on request. */
|
|
document.getElementById('rd_snr').innerText = d.snr_db.toFixed(2);
|
|
document.getElementById('rd_snrraw').innerText = (d.snr_raw_db === undefined) ? '--' : d.snr_raw_db.toFixed(2);
|
|
var sn = document.getElementById('rd_snr');
|
|
sn.style.color = (d.snr_db >= 27) ? '#22c55e' : (d.snr_db >= 20 ? '#f59e0b' : '#ef4444');
|
|
}
|
|
|
|
function drawEye(d){
|
|
var c = document.getElementById('eye_canvas');
|
|
var dpr = window.devicePixelRatio || 1;
|
|
var W = c.clientWidth, H = c.clientHeight;
|
|
if (c.width !== Math.round(W*dpr) || c.height !== Math.round(H*dpr)){
|
|
c.width = Math.round(W*dpr); c.height = Math.round(H*dpr);
|
|
}
|
|
var g = c.getContext('2d');
|
|
g.setTransform(dpr,0,0,dpr,0,0);
|
|
g.clearRect(0,0,W,H);
|
|
g.fillStyle = '#0b1220'; g.fillRect(0,0,W,H);
|
|
|
|
var cols = d.eye.cols, rows = d.eye.rows, amp = d.eye.amp;
|
|
var bin = atob(d.eye.data), x, y;
|
|
/* Build the histogram off-screen at its native size and let the browser scale it:
|
|
* one putImageData beats stroking a thousand paths. */
|
|
var off = document.createElement('canvas');
|
|
off.width = cols; off.height = rows;
|
|
var og = off.getContext('2d');
|
|
var img = og.createImageData(cols, rows);
|
|
for (x = 0; x < cols; x++){
|
|
for (y = 0; y < rows; y++){
|
|
var v = bin.charCodeAt(x * rows + y) / 255; /* column-major, row 0 = -amp */
|
|
var p = ((rows - 1 - y) * cols + x) * 4; /* canvas y grows downward */
|
|
img.data[p] = Math.min(255, 40 + 255 * Math.pow(v, 0.75));
|
|
img.data[p + 1] = Math.min(255, 20 + 200 * Math.pow(v, 1.6));
|
|
img.data[p + 2] = Math.min(255, 60 + 120 * Math.pow(v, 2.6));
|
|
img.data[p + 3] = v > 0 ? 255 : 0;
|
|
}
|
|
}
|
|
og.putImageData(img, 0, 0);
|
|
|
|
var L = 46, R = 12, T = 10, B = 28;
|
|
g.imageSmoothingEnabled = true;
|
|
g.drawImage(off, L, T, W - L - R, H - T - B);
|
|
|
|
function yOfLvl(v){ return T + (amp - v) / (2 * amp) * (H - T - B); }
|
|
g.strokeStyle = 'rgba(57,208,255,0.45)'; g.lineWidth = 0.7;
|
|
[-7,-5,-3,-1,1,3,5,7].forEach(function(v){
|
|
var yy = yOfLvl(v);
|
|
g.beginPath(); g.moveTo(L,yy); g.lineTo(W-R,yy); g.stroke();
|
|
});
|
|
var xc = L + (W - L - R) / 2; /* decision instant = centre column */
|
|
g.strokeStyle = '#a3e635'; g.setLineDash([4,3]);
|
|
g.beginPath(); g.moveTo(xc,T); g.lineTo(xc,H-B); g.stroke();
|
|
g.setLineDash([]);
|
|
|
|
g.fillStyle = '#94a3b8'; g.font = '11px sans-serif';
|
|
g.textAlign = 'right'; g.textBaseline = 'middle';
|
|
[-7,-5,-3,-1,1,3,5,7].forEach(function(v){ g.fillText(v.toFixed(0), L-6, yOfLvl(v)); });
|
|
g.textAlign = 'center'; g.textBaseline = 'top';
|
|
[-1,-0.5,0,0.5,1].forEach(function(u){
|
|
g.fillText(u.toFixed(1), L + (u+1)/2*(W-L-R), H-B+5);
|
|
});
|
|
g.fillStyle = '#64748b'; g.textBaseline = 'bottom';
|
|
g.fillText('symbol periods (UI) - decision instant at 0', (L+W-R)/2, H-2);
|
|
g.save(); g.translate(12,(T+H-B)/2); g.rotate(-Math.PI/2);
|
|
g.textBaseline = 'top'; g.fillText('normalised I level', 0, 0); g.restore();
|
|
}
|
|
|
|
/* ---- canvas ---- */
|
|
function specGeom(){
|
|
var c = document.getElementById('spec_canvas');
|
|
var dpr = window.devicePixelRatio || 1;
|
|
var w = c.clientWidth, h = c.clientHeight;
|
|
if (c.width !== Math.round(w*dpr) || c.height !== Math.round(h*dpr)){
|
|
c.width = Math.round(w*dpr); c.height = Math.round(h*dpr);
|
|
}
|
|
var g = c.getContext('2d');
|
|
g.setTransform(dpr,0,0,dpr,0,0);
|
|
return {g:g, w:w, h:h, l:56, r:14, t:14, b:30};
|
|
}
|
|
function xOf(m, f, fmin, fmax){ return m.l + (f - fmin)/(fmax - fmin) * (m.w - m.l - m.r); }
|
|
function yOf(m, db){ return m.t + (Y_TOP - db)/(Y_TOP - Y_BOT) * (m.h - m.t - m.b); }
|
|
|
|
function drawGrid(fmin, fmax){
|
|
if (fmin === undefined){ fmin = -5; fmax = 5; }
|
|
var m = specGeom(), g = m.g, f, db;
|
|
g.clearRect(0,0,m.w,m.h);
|
|
g.fillStyle = '#0b1220'; g.fillRect(0,0,m.w,m.h);
|
|
|
|
g.fillStyle = 'rgba(56,189,248,0.10)'; // the band the shoulder is measured in
|
|
[[SH_LO,SH_HI],[-SH_HI,-SH_LO]].forEach(function(b){
|
|
var x0 = xOf(m,Math.max(b[0],fmin),fmin,fmax), x1 = xOf(m,Math.min(b[1],fmax),fmin,fmax);
|
|
g.fillRect(x0, m.t, x1-x0, m.h-m.t-m.b);
|
|
});
|
|
|
|
g.lineWidth = 1;
|
|
g.font = '11px sans-serif';
|
|
g.textAlign = 'center'; g.textBaseline = 'top';
|
|
for (f = Math.ceil(fmin); f <= fmax; f++){
|
|
var x = Math.round(xOf(m,f,fmin,fmax)) + 0.5;
|
|
g.strokeStyle = '#1e293b';
|
|
g.beginPath(); g.moveTo(x,m.t); g.lineTo(x,m.h-m.b); g.stroke();
|
|
g.fillStyle = '#94a3b8'; g.fillText(f.toFixed(0), x, m.h-m.b+5);
|
|
}
|
|
g.textAlign = 'right'; g.textBaseline = 'middle';
|
|
for (db = Y_TOP; db >= Y_BOT; db -= 10){
|
|
var y = Math.round(yOf(m,db)) + 0.5;
|
|
g.strokeStyle = (db === 0) ? '#334155' : '#1e293b';
|
|
g.beginPath(); g.moveTo(m.l,y); g.lineTo(m.w-m.r,y); g.stroke();
|
|
g.fillStyle = '#94a3b8'; g.fillText(db.toFixed(0), m.l-6, y);
|
|
}
|
|
g.fillStyle = '#64748b'; g.textAlign = 'center'; g.textBaseline = 'bottom';
|
|
g.fillText('MHz from carrier', (m.l+m.w-m.r)/2, m.h-2);
|
|
g.save(); g.translate(12,(m.t+m.h-m.b)/2); g.rotate(-Math.PI/2);
|
|
g.textBaseline = 'top'; g.fillText('dB rel. in-band flat density', 0, 0); g.restore();
|
|
return m;
|
|
}
|
|
|
|
function trace(m, psd, f0, df, fmin, fmax, color, width){
|
|
var g = m.g, i, started = false;
|
|
g.strokeStyle = color; g.lineWidth = width; g.beginPath();
|
|
for (i = 0; i < psd.length; i++){
|
|
var f = f0 + i*df;
|
|
if (f < fmin || f > fmax) continue;
|
|
var x = xOf(m,f,fmin,fmax), y = yOf(m, Math.max(Math.min(psd[i],Y_TOP),Y_BOT));
|
|
if (!started){ g.moveTo(x,y); started = true; } else g.lineTo(x,y);
|
|
}
|
|
g.stroke();
|
|
}
|
|
|
|
function drawSpectrum(d){
|
|
var fmin = d.f0, fmax = d.f0 + (d.n-1)*d.df;
|
|
var m = drawGrid(fmin, fmax), i;
|
|
|
|
if (elChecked('spec_hold')){
|
|
if (!specPeak || specPeak.length !== d.psd.length) specPeak = d.psd.slice();
|
|
else for (i = 0; i < d.psd.length; i++) if (d.psd[i] > specPeak[i]) specPeak[i] = d.psd[i];
|
|
trace(m, specPeak, d.f0, d.df, fmin, fmax, '#f59e0b', 1);
|
|
} else specPeak = null;
|
|
|
|
trace(m, d.psd, d.f0, d.df, fmin, fmax, '#38bdf8', 1.2);
|
|
|
|
var y = yOf(m, d.shoulder); // measured shoulder level
|
|
m.g.strokeStyle = '#f87171'; m.g.setLineDash([5,4]); m.g.lineWidth = 1;
|
|
m.g.beginPath(); m.g.moveTo(m.l,y); m.g.lineTo(m.w-m.r,y); m.g.stroke();
|
|
m.g.setLineDash([]);
|
|
m.g.fillStyle = '#f87171'; m.g.textAlign = 'left'; m.g.textBaseline = 'bottom';
|
|
m.g.fillText('shoulder ' + d.shoulder.toFixed(1) + ' dB', m.l+6, y-3);
|
|
|
|
/* PR12: pilot vertical marker removed on request (it covered the pilot
|
|
* peak). The pilot frequency is still available in d.pilot. */
|
|
|
|
/* PR12: error signal spectrum (yellow) = reshaped decisions subtracted
|
|
* from the actual IQ, in the channel frame so it lines up with the blue
|
|
* trace. Full-band residual (shows in-band distortion AND out-of-band
|
|
* shoulder). Drawn only where it stays below the blue PSD -- any point
|
|
* above the signal breaks the segment (clip, not clamp). */
|
|
/* DISABLED on request (2026-07-25): drop the leading `false &&` to restore */
|
|
if (false && eyeLastData && eyeLastData.err && eyeLastData.err.db){
|
|
var er = eyeLastData.err, g2 = m.g, started = false, ei;
|
|
g2.strokeStyle = '#eab308'; g2.lineWidth = 1.4; g2.beginPath();
|
|
for (ei = 0; ei < er.db.length; ei++){
|
|
var ef = er.f0 + ei*er.df;
|
|
if (ef < fmin || ef > fmax){ started = false; continue; }
|
|
/* blue signal level at this frequency (nearest published bin) */
|
|
var bi = Math.round((ef - d.f0)/d.df);
|
|
var sig = (bi >= 0 && bi < d.psd.length) ? d.psd[bi] : 99;
|
|
if (er.db[ei] > sig){ started = false; continue; } /* above signal: hide */
|
|
var ex = xOf(m, ef, fmin, fmax),
|
|
ey = yOf(m, Math.max(Math.min(er.db[ei], Y_TOP), Y_BOT));
|
|
if (!started){ g2.moveTo(ex, ey); started = true; } else g2.lineTo(ex, ey);
|
|
}
|
|
g2.stroke();
|
|
/* PR12: yellow error trace has no text label on request */
|
|
}
|
|
}
|
|
|
|
// Opens the modal - gets current username from server
|
|
function openAccountModal() {
|
|
// Fetch current username from server
|
|
$.get("login.cgi?action=get_user", function(data) {
|
|
var trimmedData = (data || "").trim();
|
|
if (trimmedData && trimmedData !== "UNAUTHORIZED") {
|
|
document.getElementById('current_user').value = trimmedData;
|
|
}
|
|
document.getElementById('accountModal').style.display = 'block';
|
|
setTimeout(function() { document.getElementById('current_pwd').focus(); }, 100);
|
|
}).fail(function() {
|
|
document.getElementById('accountModal').style.display = 'block';
|
|
setTimeout(function() { document.getElementById('current_pwd').focus(); }, 100);
|
|
});
|
|
}
|
|
|
|
// Closes the modal and clears the sensitive inputs
|
|
function closeAccountModal() {
|
|
document.getElementById('accountModal').style.display = 'none';
|
|
document.getElementById('current_pwd').value = '';
|
|
document.getElementById('new_pwd').value = '';
|
|
document.getElementById('confirm_pwd').value = '';
|
|
}
|
|
|
|
// Validates that a string contains only printable characters (excluding space)
|
|
function isValidPrintableString(str) {
|
|
// Regular expression to check for printable characters (ASCII 33-126), excluding space
|
|
// Space is ASCII 32, and we want to exclude it
|
|
var printableCharRegex = /^[!-~]+$/; // ! is ASCII 33, ~ is ASCII 126
|
|
return printableCharRegex.test(str);
|
|
}
|
|
|
|
// Validates the passwords match before submitting to the CGI script - All required fields must be filled
|
|
function validateAccountForm() {
|
|
var currentUser = document.getElementById('current_user').value;
|
|
var currentPwd = document.getElementById('current_pwd').value;
|
|
var newUsername = document.getElementById('new_user').value;
|
|
var newPwd = document.getElementById('new_pwd').value;
|
|
var confirmPwd = document.getElementById('confirm_pwd').value;
|
|
|
|
// Current password is required (cannot be empty)
|
|
if (!currentPwd || currentPwd.trim() === "") {
|
|
alert("Current password is required");
|
|
return false;
|
|
}
|
|
|
|
// Validate current password contains only printable characters
|
|
if (!isValidPrintableString(currentPwd)) {
|
|
alert("Current password contains invalid characters. Only printable characters (excluding space) are allowed.");
|
|
return false;
|
|
}
|
|
|
|
// New password is required (cannot be empty)
|
|
if (!newPwd || newPwd.trim() === "") {
|
|
alert("New password is required");
|
|
return false;
|
|
}
|
|
|
|
// Validate new password contains only printable characters
|
|
if (!isValidPrintableString(newPwd)) {
|
|
alert("New password contains invalid characters. Only printable characters (excluding space) are allowed.");
|
|
return false;
|
|
}
|
|
|
|
// Validate new password length (max 16 chars)
|
|
if (newPwd.length > 16) {
|
|
alert("New password must be no more than 16 characters");
|
|
return false;
|
|
}
|
|
|
|
// Validate new password length
|
|
if (newPwd.length < 6) {
|
|
alert("New password must be at least 6 characters");
|
|
return false;
|
|
}
|
|
|
|
// Confirm password must match new password
|
|
if (newPwd !== confirmPwd) {
|
|
alert("New passwords do not match");
|
|
return false;
|
|
}
|
|
|
|
// Validate confirm password contains only printable characters
|
|
if (!isValidPrintableString(confirmPwd)) {
|
|
alert("Confirm password contains invalid characters. Only printable characters (excluding space) are allowed.");
|
|
return false;
|
|
}
|
|
|
|
// Validate confirm password length (max 16 chars)
|
|
if (confirmPwd.length > 16) {
|
|
alert("Confirm password must be no more than 16 characters");
|
|
return false;
|
|
}
|
|
|
|
// Validate new username if provided
|
|
if (newUsername && newUsername.trim() !== "") {
|
|
// Validate new username contains only printable characters
|
|
if (!isValidPrintableString(newUsername)) {
|
|
alert("New username contains invalid characters. Only printable characters (excluding space) are allowed.");
|
|
return false;
|
|
}
|
|
|
|
// Validate new username length (max 16 chars)
|
|
if (newUsername.length > 16) {
|
|
alert("New username must be no more than 16 characters");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true; // Allows the form to submit
|
|
}
|
|
|
|
// Form submission handler using fetch API
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
var accountForm = document.getElementById('accountForm');
|
|
if (accountForm) {
|
|
accountForm.addEventListener('submit', function(e) {
|
|
e.preventDefault();
|
|
|
|
if (!validateAccountForm()) return;
|
|
|
|
var formData = new URLSearchParams({
|
|
Username: document.getElementById('current_user').value,
|
|
OldPassword: document.getElementById('current_pwd').value,
|
|
NewUsername: document.getElementById('new_user').value,
|
|
NewPassword: document.getElementById('new_pwd').value,
|
|
ConfirmPassword: document.getElementById('confirm_pwd').value
|
|
});
|
|
|
|
fetch('login.cgi?action=change_account', {
|
|
method: 'POST',
|
|
body: formData
|
|
})
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
alert("Update successful! Please login again.");
|
|
closeAccountModal();
|
|
// Redirect to login page after 1.5 seconds
|
|
setTimeout(function() {
|
|
window.location.href = 'login.cgi?logout=1';
|
|
}, 1500);
|
|
} else {
|
|
alert(data.error || "Update failed");
|
|
}
|
|
})
|
|
.catch(function(err) {
|
|
alert("Network error: " + err);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
// Optional: Closes the modal if the user clicks the dark background outside the box
|
|
window.onclick = function(event) {
|
|
var modal = document.getElementById('accountModal');
|
|
if (event.target == modal) {
|
|
closeAccountModal();
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="refresh_show()">
|
|
|
|
|
|
<div class="app-layout">
|
|
<aside class="app-sidebar">
|
|
<ul class="items">
|
|
<li><a href="status_info.html" title="Status">Status</a></li>
|
|
<li><a href="sys_set.html" title="Settings">Settings</a></li>
|
|
<li><a href="sys_rf.html" title="RF Control">RF Control</a></li>
|
|
<li><a href="sys_psip.html" title="TSID&PSIP">TSID&PSIP</a></li>
|
|
<li><a href="sys_ts.html" title="TSoIP">TSoIP</a></li>
|
|
<li class="active"><a href="sys_spectrum.html" title="Spectrum">Spectrum</a></li>
|
|
<li><a href="log_output.html" title="Log">Log</a></li>
|
|
</ul>
|
|
<div class="sidebar-footer">
|
|
<h4>Anywave Broadcast Inc.</h4>
|
|
<p>Copyright 2026<br><br><span class="redbox-label">Technical Support</span><br>+1 847 415 2258<br><a href="mailto:support@anywaveus.com">support@anywaveus.com</a></p>
|
|
</div>
|
|
</aside>
|
|
<div class="sidebar-overlay" onclick="toggleSidebar()"></div>
|
|
|
|
<header class="app-header">
|
|
<button class="menu-toggle" onclick="toggleSidebar()" aria-label="Toggle menu">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
</svg>
|
|
</button>
|
|
<h1><a href="https://anywavecom.net/" class="logo-bg" title="Anywave Broadcast Inc."></a></h1>
|
|
<h2 id="webtitle_header"><span></span></h2>
|
|
<h3>
|
|
<div class="dropdown">
|
|
<button class="dropbtn-modern">Admin ▾</button>
|
|
<div class="dropdown-content">
|
|
<a href="#" onclick="openAccountModal(); return false;">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="3"></circle>
|
|
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06-.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06-.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06-.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
</svg>
|
|
Account Settings
|
|
</a>
|
|
<a href="login.cgi?logout=1">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
|
|
<polyline points="16 17 21 12 16 7"></polyline>
|
|
<line x1="21" y1="12" x2="9" y2="12"></line>
|
|
</svg>
|
|
Logout
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</h3>
|
|
</header>
|
|
|
|
<!-- Fixed Dashboard Summary - Top of page, under header -->
|
|
<div class="dashboard-fixed">
|
|
<div class="summary-dashboard">
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_freq" aria-hidden="true"></span>
|
|
<span class="summary-label">Frequency</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_freq">--</span>
|
|
<span class="summary-unit">MHz</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_snr" aria-hidden="true"></span>
|
|
<span class="summary-label">SNR</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_snr">--</span>
|
|
<span class="summary-unit">dB</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_uimd" aria-hidden="true"></span>
|
|
<span class="summary-label">UIMD</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_uimd">--</span>
|
|
<span class="summary-unit">dBc</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_limd" aria-hidden="true"></span>
|
|
<span class="summary-label">LIMD</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_limd">--</span>
|
|
<span class="summary-unit">dBc</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-off" id="dot_rf" aria-hidden="true"></span>
|
|
<span class="summary-label">RF Switch</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-muted" id="sum_rf">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_outpow" aria-hidden="true"></span>
|
|
<span class="summary-label">Output Power</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_outpow">--</span>
|
|
<span class="summary-unit">dBm</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_input" aria-hidden="true"></span>
|
|
<span class="summary-label">Input Source</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_input">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_input_status" aria-hidden="true"></span>
|
|
<span class="summary-label">Input Status</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_input_status">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_bitrate" aria-hidden="true"></span>
|
|
<span class="summary-label">Bitrate</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_bitrate">--</span>
|
|
<span class="summary-unit">Mbps</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_temp" aria-hidden="true"></span>
|
|
<span class="summary-label">Temperature</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_temp">--</span>
|
|
<span class="summary-unit">°F</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-off" id="dot_agc" aria-hidden="true"></span>
|
|
<span class="summary-label">AGC</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-muted" id="sum_agc">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_control" aria-hidden="true"></span>
|
|
<span class="summary-label">Control</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_control">--</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<main class="app-main">
|
|
<h2>ORx Receive Spectrum</h2>
|
|
<div class="box">
|
|
<!-- PR12: Refresh/Pause/Peak-hold toolbar + status line removed on
|
|
request (fixed 1 s refresh). Readout cards were removed earlier;
|
|
the on-plot shoulder line and yellow error trace remain. -->
|
|
<canvas id="spec_canvas"></canvas>
|
|
</div>
|
|
|
|
<h2>8VSB Eye Diagram</h2>
|
|
<div class="box">
|
|
<!-- PR12: eye caption + status line removed on request. -->
|
|
<canvas id="eye_canvas"></canvas>
|
|
<div class="spec-readouts">
|
|
<div class="spec-readout" title="MER, I-path definition: 10log10(sum d^2 / sum (r-d)^2)"><span class="k">SNR / MER</span><span class="v"><span id="rd_snr">--</span> dB</span></div>
|
|
<div class="spec-readout" title="MER before the ORx AGC gain steps are tracked out. The gap to SNR/MER is what the observation receiver costs you, not the transmitter."><span class="k">SNR raw</span><span class="v"><span id="rd_snrraw">--</span> dB</span></div>
|
|
<!-- PR13: FSSI from the ORx FAGC gain index (255->0%, 195->100%).
|
|
Value comes from the shared 3 s dashboard poll (dashboard.js),
|
|
not from iq_eye.cgi. Shows "A / B" when FSSI refresh is on. -->
|
|
<div class="spec-readout" title="ORx front-end signal strength from the FAGC gain index (gain index 255 -> 0%, 195 -> 100%). A path; A / B when the FSSI refresh switch is on."><span class="k">FSSI</span><span class="v"><span id="rd_fssi">--</span> %</span></div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
|
|
<div id="accountModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3>Account Settings</h3>
|
|
<span class="close" onclick="closeAccountModal()">×</span>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="accountForm" method="post" action="login.cgi?action=change_account" onsubmit="return validateAccountForm()">
|
|
<table class="modal-table">
|
|
<tr>
|
|
<td>Current Username</td>
|
|
<td><input type="text" id="current_user" name="current_user" readonly></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Current Password</td>
|
|
<td><input type="password" id="current_pwd" name="current_pwd" required></td>
|
|
</tr>
|
|
<tr>
|
|
<td>New Username</td>
|
|
<td><input type="text" id="new_user" name="new_user"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>New Password</td>
|
|
<td><input type="password" id="new_pwd" name="new_pwd"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Confirm Password</td>
|
|
<td><input type="password" id="confirm_pwd" name="confirm_pwd"></td>
|
|
</tr>
|
|
</table>
|
|
<div class="modal-footer">
|
|
<input type="button" class="btn-modern" style="background-color: #64748b;" value="Cancel" onclick="closeAccountModal()">
|
|
<input type="submit" class="btn-modern" value="Save Changes">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function toggleSidebar(){
|
|
document.querySelector('.app-sidebar').classList.toggle('sidebar-open');
|
|
document.querySelector('.sidebar-overlay').classList.toggle('active');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|