Add detached service windows and selectable terminal themes

Support standalone APRS, Monitor, Chat and Terminal views with courtesy screens, window focus and return controls, shared sessions and suspended embedded polling.

Add five persistent phosphor palettes, remove Console terminal idle disconnections, and display decoded Mic-E movement and altitude with expandable original packets.

Document the new behavior and add regression coverage. Validation: 182 tests passed; the known hanging PowerShell startup readiness test was excluded.
This commit is contained in:
alberto committed 2026-10-19 22:15:15 +02:00
1 parent 8ee4e9636a
commit c98c67e18b
24 files changed
+415 -22

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
// A detached view shares the authenticated browser session and its existing Telnet socket.
const $=selector=>document.querySelector(selector);
let station={features:{}},csrf='',page='terminal';
function navigate(){page='terminal';$('#terminal').hidden=false;}
function toast(text){$('#toast').textContent=text;$('#toast').hidden=false;clearTimeout(toast.timer);toast.timer=setTimeout(()=>$('#toast').hidden=true,6500);}
function terminalWindowError(text){document.dispatchEvent(new Event('bpq-detach-auth-lost'));csrf='';station={features:{}};$('#terminal').hidden=true;$('#terminal-window-error').hidden=false;$('#terminal-window-error-text').textContent=BPQI18n.t(text);}
async function api(url,options={}){
const {busy,...request}=options;
const response=await fetch('/api'+url,{...request,headers:{'Content-Type':'application/json',...(request.method==='POST'?{'X-CSRF-Token':csrf}:{}),...request.headers}});
const data=await response.json();
if(!response.ok){if(response.status===401)terminalWindowError('Sessione scaduta. Accedi nuovamente dal pannello.');throw new Error(data.error||'Richiesta fallita');}
return data;
}
$('#logout').onclick=async()=>{};
document.addEventListener('DOMContentLoaded',async()=>{
try{
const user=await api('/session');station=user.config;csrf=user.csrf;
if(!station.features.terminal){terminalWindowError('Terminale non configurato in BPQ.');return;}
document.title='BPQ Console · '+station.call+' · Terminal';
document.dispatchEvent(new Event('station-ready'));
}catch(error){if(csrf||!$('#terminal-window-error-text').textContent)terminalWindowError(error.message);}
});