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:
1 parent
8ee4e9636a
commit
c98c67e18b
24 files changed
+415
-22
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ const originalNavigate=navigate;navigate=function(next){originalNavigate(next);i
|
||||
function filtered(){const port=$('#monitor-port').value,dir=$('#monitor-direction').value,q=$('#monitor-search').value.toLowerCase();return events.filter(e=>(!port||String(e.port)===port)&&(!dir||e.direction===dir)&&(!q||e.text.toLowerCase().includes(q)));}
|
||||
function render(){const list=filtered(),area=$('#monitor-console');area.innerHTML=list.map(e=>`<article class="monitor-frame ${e.direction.toLowerCase()}"><div><span class="monitor-direction">${esc(e.direction)}</span><span class="monitor-port">${e.port?'P'+e.port:'BPQ'}</span></div><pre>${esc(e.text)}</pre></article>`).join('')||'<p class="monitor-empty">'+(state==='online'?'In ascolto. Nessun traffico corrispondente ai filtri.':'Avvia il monitor per seguire il traffico BPQ.')+'</p>';$('#monitor-count').textContent=list.length+' frame · '+events.length+' in memoria'+(paused?' · visualizzazione in pausa':'');if($('#monitor-follow').checked)area.scrollTop=area.scrollHeight;displayedCursor=cursor;}
|
||||
function status(data){state=data.state;$('#monitor-state').className='chat-status '+state;$('#monitor-state').textContent=data.error||({online:'● In ascolto',connecting:'Connessione…',offline:'Disconnesso',error:'Non disponibile'}[state]);$('#monitor-connect').hidden=state==='online';$('#monitor-connect').disabled=state==='connecting';$('#monitor-stop').hidden=!['online','connecting'].includes(state);const current=$('#monitor-port').value;$('#monitor-port').innerHTML='<option value="">Tutte le porte</option>'+data.ports.map(p=>`<option value="${p.id}">${p.id} · ${esc(p.name)}</option>`).join('');$('#monitor-port').value=current;}
|
||||
async function poll(){if(!csrf||busy)return;busy=true;try{let data=await api('/monitor?after='+cursor,{busy:false});if(data.latest<cursor){cursor=0;events=[];data=await api('/monitor?after=0');}status(data);events.push(...data.events);events=events.slice(-1000);cursor=data.latest;if(!paused&&(cursor!==displayedCursor||!events.length))render();}catch(e){if(page==='monitor')toast(e.message)}finally{busy=false;}}
|
||||
async function poll(){if(!csrf||busy||window.BPQDetached&&!window.BPQDetached.shouldPoll('monitor'))return;busy=true;try{let data=await api('/monitor?after='+cursor,{busy:false});if(data.latest<cursor){cursor=0;events=[];data=await api('/monitor?after=0');}status(data);events.push(...data.events);events=events.slice(-1000);cursor=data.latest;if(!paused&&(cursor!==displayedCursor||!events.length))render();}catch(e){if(page==='monitor')toast(e.message)}finally{busy=false;}}
|
||||
$('#monitor-connect').onclick=async()=>{try{status(await api('/monitor/connect',{method:'POST',body:'{}'}));await poll();}catch(e){toast(e.message)}};
|
||||
$('#monitor-stop').onclick=async()=>{try{await api('/monitor/disconnect',{method:'POST',body:'{}'});await poll()}catch(e){toast(e.message)}};
|
||||
$('#monitor-pause').onclick=()=>{paused=!paused;$('#monitor-pause').textContent=paused?'Riprendi':'Pausa';if(!paused)render();else $('#monitor-count').textContent+=' · visualizzazione in pausa';};
|
||||
|
||||
Reference in new issue
Block a user