diff --git a/README.md b/README.md
index 985f36a..5d2807a 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,12 @@ Incoming and queued Winlink messages show an attachment indicator in the list an
In **New email**, use **Attach files** or drop files into the attachment panel. Review filenames, sizes and image thumbnails; remove files before saving. The Console accepts up to 10 files and 64 KiB total per outgoing email, with a combined message text/file limit of 80 KiB and the existing 32 KB body limit. These Console upload limits leave room for multipart headers within the native BPQ HTTP input buffer; BPQ, the receiving gateway and radio conditions may impose further limits. Small files are preferable over radio. Files stay in the browser until the message is saved and then use BPQ’s native WebMail attachment upload and normal Winlink queue, over Internet or radio. The Console verifies that BPQ stored the same filenames and file bytes before confirming success. If it reports a saved message with mismatched attachments, check the queue before retrying.
+Use **Detach** in APRS, Monitor, Chat or Terminal to open a standalone window. The embedded section switches to a courtesy screen with **Show window** and **Bring back here**, and pauses its own polling. Returning or closing the detached window restores the embedded view without disconnecting the underlying service. Window ownership is coordinated per browser and origin; stale ownership expires if a window crashes. Popup blocking leaves the embedded view available.
+
+Use **Detach** in the terminal toolbar to open a compact standalone window. Both views share the existing authenticated Telnet session and transcript; closing the window does not disconnect it. **Back to dashboard** returns to the original panel. Allow popups for the Console if the browser blocks the window. Amber, Green, Ice, Violet and White phosphor themes are saved per browser and synchronized between open views.
+
+Terminal connections are not closed by BPQ Console for inactivity, including when another dashboard page is open. Disconnect or sign out to close the terminal. BPQ and remote applications may still enforce their own session limits.
+
## Telnet login compatibility
Terminal and Chat read `LOGINPROMPT` and `PASSWORDPROMPT` from the Telnet port in `BPQ32.cfg`. Standard `Username:`, `Login:`, `User:` and `Password:` prompts also work. `PASSWORD` is not the prompt setting. Custom CTEXT banners do not need the word Welcome or a node prompt; both `ALIAS:CALL>` and `ALIAS:CALL}` work. After the password, the clients wait for 400 ms of quiet after non-empty banner text; a repeated login/password prompt or explicit denial rejects the login. Password echoes are removed before displaying the terminal banner, and Chat discards the Telnet banner before sending `CHAT`. A server that sends no text at all after the password times out instead of reporting an unconfirmed login as successful. Restart BPQ Console after changing prompt settings.
diff --git a/aprs-activity.mjs b/aprs-activity.mjs
index 705fd6a..399826b 100644
--- a/aprs-activity.mjs
+++ b/aprs-activity.mjs
@@ -8,7 +8,7 @@ export function parseRadioAprs(frame){const lines=frame.text.split('\n'),m=lines
export function parseIsAprs(line,date){const m=line.match(/^(\d{2}:\d{2}:\d{2})([RT])\s+(.*)$/);if(!m)return null;const packet=parseTnc2(m[3]);return packet?{...packet,at:date+'T'+m[1]+'Z',direction:m[2]==='T'?'TX':'RX',transport:'Internet',port:null,evidence:'BPQ APRS-IS log'}:null;}
export function positionOf(body){let text=body;if(/[\/@]/.test(text[0]))text=text.slice(8);else if(/[!=]/.test(text[0]))text=text.slice(1);else return null;
const m=text.match(/^(\d{2})(\d{2}\.\d{2})([NS])(.)(\d{3})(\d{2}\.\d{2})([EW])(.)(.*)$/);if(!m||Number(m[2])>=60||Number(m[6])>=60)return null;const lat=(+m[1]+Number(m[2])/60)*(m[3]==='S'?-1:1),lon=(+m[5]+Number(m[6])/60)*(m[7]==='W'?-1:1);return Math.abs(lat)<=90&&Math.abs(lon)<=180?{lat,lon,symbol:m[8],symset:m[4]}:null;}
-export function parseNativeStations(text,now=Date.now()){const out=[];for(const row of text.split(/\r?\n\|/)){const m=row.trim().match(/^A,(-?[\d.]+),(-?[\d.]+),([^,]+),([\s\S]*),([A-Fa-f0-9]{4}.),(\d+)$/);if(!m)continue;const lat=Number(m[1]),lon=Number(m[2]),call=m[3];if(!/^[A-Z0-9-]{2,12}$/i.test(call)||!Number.isFinite(lat)||!Number.isFinite(lon)||Math.abs(lat)>90||Math.abs(lon)>180)continue;const detail=decode(m[4]),port=Number(detail.match(/Last Heard:.*?on Port (\d+)/)?.[1])||0,lines=detail.split(/ /i).map(s=>plain(s).trim()).filter(Boolean);out.push({call,position:{lat,lon,...nativeSymbol(m[5])},lastAt:new Date(now-Number(m[6])*1000).toISOString(),transport:port?'Radio':'Internet',port:port||null,path:lines[0]||'',lastBody:lines[1]||'',status:lines.find(s=>!s.startsWith('Last Heard')&&!s.startsWith('Distance')&&s!==lines[0]&&s!==lines[1])||'',heardRadio:port>0,positionSource:'BPQ APRS decoder',native:true});}return out;}
+export function parseNativeStations(text,now=Date.now()){const out=[];for(const row of text.split(/\r?\n\|/)){const m=row.trim().match(/^A,(-?[\d.]+),(-?[\d.]+),([^,]+),([\s\S]*),([A-Fa-f0-9]{4}.),(\d+)$/);if(!m)continue;const lat=Number(m[1]),lon=Number(m[2]),call=m[3];if(!/^[A-Z0-9-]{2,12}$/i.test(call)||!Number.isFinite(lat)||!Number.isFinite(lon)||Math.abs(lat)>90||Math.abs(lon)>180)continue;const detail=m[4],port=Number(detail.match(/Last Heard:.*?on Port (\d+)/)?.[1])||0,lines=detail.split(/ /i).map(s=>decode(s.replace(/<[^>]+>/g,''))).filter(s=>s.trim());out.push({call,position:{lat,lon,...nativeSymbol(m[5])},lastAt:new Date(now-Number(m[6])*1000).toISOString(),transport:port?'Radio':'Internet',port:port||null,path:lines[0]||'',lastBody:lines[1]||'',status:lines.find(s=>!s.startsWith('Last Heard')&&!s.startsWith('Distance')&&s!==lines[0]&&s!==lines[1])||'',heardRadio:port>0,positionSource:'BPQ APRS decoder',native:true});}return out;}
export class AprsActivity{
constructor(config,dir,bpq,credentials,settings){this.config=config;this.bpq=bpq;this.settings=settings;this.file=path.join(dir,'aprs-activity.cache.json');this.events=[];this.stations=new Map();this.seq=0;this.cursor=0;this.monitor=new Monitor(credentials,{port:config.monitorPort});this.kiss=(config.aprsKissMonitor||[]).map(endpoint=>new AprsKiss(endpoint,(packet,port)=>this.ingest({...parseTnc2(packet),at:new Date().toISOString(),direction:'RX',transport:'Radio',port,evidence:'KISS receive-only monitor'})));this.lastNative=0;this.lastPersist=0;this.logFile=null;this.logOffset=null;this.partial='';this.errors=[];this.started=false;this.busy=false;this.init=this.restore();this.timer=setInterval(()=>{if(this.started)this.sample().catch(()=>{});},2000);this.timer.unref();}
async restore(){try{const data=JSON.parse(await readFile(this.file,'utf8'));this.events=(data.events||[]).slice(-2000);this.seq=this.events.at(-1)?.id||0;this.logFile=data.logFile||null;this.logOffset=data.logOffset??null;this.partial=data.partial||'';this.ownPosition=data.ownPosition;for(const s of data.stations||[])if(s.call)this.stations.set(s.call,s);}catch{} }
diff --git a/aprs-packet-text.test.mjs b/aprs-packet-text.test.mjs
new file mode 100644
index 0000000..94a6fa1
--- /dev/null
+++ b/aprs-packet-text.test.mjs
@@ -0,0 +1,35 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import vm from 'node:vm';
+import {readFileSync} from 'node:fs';
+import {parseNativeStations} from './aprs-activity.mjs';
+const context=vm.createContext({window:{}});
+vm.runInContext(readFileSync(new URL('./public/aprs-symbols.js',import.meta.url),'utf8'),context);
+const decode=context.window.BPQAprsPacket.decode;
+const mic='`\x7f^U!n^>/';
+
+test('Mic-E station descriptions decode movement and base91 altitude instead of showing binary position bytes',()=>{
+ const info=decode(mic+'"5J}');
+ assert.equal(info.format,'Mic-E');assert.equal(info.speedKmh,107);assert.equal(info.course,266);assert.equal(info.altitudeM,142);assert.equal(info.comment,'');
+ assert.equal(decode(mic+'"5J}Hello from the car').comment,'Hello from the car');
+ assert.equal(decode('`short').speedKmh,null);assert.equal(decode('`short').comment,'');
+});
+test('known Mic-E device identifiers are separated from comments; unknown suffixes and real comments are preserved',()=>{
+ const info=decode(mic+'`"5J}Test_3');assert.equal(info.device,'Yaesu FT5D');assert.equal(info.altitudeM,142);assert.equal(info.comment,'Test');
+ assert.equal(decode(mic+'>Hello=').device,'Kenwood TH-D72');
+ assert.equal(decode(mic+'`Hello?Z').comment,'Hello?Z');
+ assert.equal(decode(mic+'').comment,'');
+});
+test('plain position descriptions omit position fields without damaging the transmitted text',()=>{
+ assert.equal(decode('!4534.18N/00907.89E]Local BBS').comment,'Local BBS');
+ assert.equal(decode('@191200z4534.18N/00907.89E]Local BBS').comment,'Local BBS');
+ assert.equal(decode('>191200zOn air').comment,'On air');
+ assert.equal(decode('Comment\x7f with controls').comment,'Comment with controls');
+});
+test('native HTML decoding preserves Mic-E byte positions, literal angle brackets and repeated spaces',()=>{
+ const body='`\x7f<U ^>/"5J}';
+ const row='A,45.5,9.1,N0TEST,TEST,WIDE1-1 '+body+' Last Heard: 12:00:00 on Port 3 ,010D@,1\r\n|';
+ const station=parseNativeStations(row)[0];
+ assert.equal(station.lastBody,'`\x7f/"5J}');assert.equal(station.lastBody[7],'>');assert.equal(station.lastBody[8],'/');
+ assert.equal(decode(station.lastBody).altitudeM,142);
+});
diff --git a/detach.test.mjs b/detach.test.mjs
new file mode 100644
index 0000000..75a4a59
--- /dev/null
+++ b/detach.test.mjs
@@ -0,0 +1,52 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import vm from 'node:vm';
+import {readFileSync} from 'node:fs';
+const source=readFileSync(new URL('./public/detach.js',import.meta.url),'utf8');
+function harness(search='',shared=new Map()){
+ const docEvents={},events={},sections={},calls=[];let serial=0,tick,popup;
+ function element(){const children=new Map();return {hidden:false,dataset:{},textContent:'',className:'',innerHTML:'',classes:new Set(),
+ classList:{toggle(name,on){this.owner.classes[on?'add':'delete'](name);}},append(child){this.child=child;},
+ querySelector(selector){if(selector==='.detached-placeholder')return this.child||null;if(!children.has(selector))children.set(selector,element());return children.get(selector);},
+ querySelectorAll(){return [this.querySelector('first'),this.querySelector('second')];}};}
+ for(const id of ['terminal','aprs','monitor','chat']){sections[id]=element();sections[id].classList.owner=sections[id];}
+ const main={hidden:false};const document={body:{append(node){calls.push(['notice',node.className]);}},querySelector:()=>main,readyState:'complete',documentElement:{dataset:{}},getElementById:id=>sections[id],createElement:element,addEventListener:(name,fn)=>docEvents[name]=fn};
+ const window={name:'',addEventListener:(name,fn)=>events[name]=fn,focus:()=>calls.push('focus'),close:()=>calls.push('close'),
+ open:(...args)=>{calls.push(args);popup={closed:false,focus(){},close(){this.closed=true;}};return popup;}};
+ const location={pathname:'/',search,hash:'',assign:url=>calls.push(['assign',url])};
+ const context=vm.createContext({window,document,location,URLSearchParams,crypto:{randomUUID:()=>String(++serial)},
+ localStorage:{getItem:key=>shared.get(key)||null,setItem:(key,value)=>shared.set(key,value),removeItem:key=>shared.delete(key)},
+ Date,Set,Map,BPQI18n:{t:s=>s},toast:text=>calls.push(['toast',text]),navigate:id=>calls.push(['navigate',id]),setInterval:fn=>{tick=fn;}});
+ vm.runInContext(source,context);docEvents.DOMContentLoaded();
+ return {api:window.BPQDetached,window,document,docEvents,events,sections,calls,shared,main,tick:()=>tick(),popup:()=>popup};
+}
+test('a page shows courtesy only after its detached view is ready, and another page stays usable',()=>{
+ const h=harness();h.api.open('aprs');assert.equal(h.api.isAway('aprs'),false);
+ assert.match(h.calls[0][0],/^\/\?detached=aprs&window=\d+#aprs$/);
+ h.shared.set('bpq-detached:aprs',JSON.stringify({owner:'2',at:Date.now()}));h.tick();
+ assert.equal(h.sections.aprs.child.hidden,false);assert.equal(h.api.shouldPoll('aprs'),false);assert.equal(h.api.shouldPoll('chat'),true);
+ assert.equal(h.sections.aprs.classes.has('section-detached-away'),true);
+ h.api.dock('aprs');assert.equal(h.sections.aprs.child.hidden,true);assert.equal(h.api.shouldPoll('aprs'),true);assert.equal(h.popup().closed,true);
+});
+test('closing a child restores its parent and stale records cannot strand a page on the courtesy screen',()=>{
+ const h=harness();h.api.open('monitor');h.shared.set('bpq-detached:monitor',JSON.stringify({owner:'2',at:Date.now()}));h.tick();
+ h.popup().closed=true;h.tick();assert.equal(h.api.isAway('monitor'),false);assert.equal(h.sections.monitor.child.hidden,true);
+ h.shared.set('bpq-detached:chat',JSON.stringify({owner:'old',at:Date.now()-130000}));h.tick();assert.equal(h.api.isAway('chat'),false);
+});
+test('blocked popups keep the embedded view and never claim a detached session',()=>{
+ const h=harness();h.window.open=()=>null;h.api.open('chat');assert.equal(h.api.isAway('chat'),false);assert.equal(h.shared.has('bpq-detached:chat'),false);assert.match(h.calls[0][1],/popup/);
+});
+test('a standalone page claims just its service, releases on close and never reconnects or disconnects BPQ',()=>{
+ const shared=new Map(),h=harness('?detached=chat&window=child',shared);h.docEvents['station-ready']();
+ assert.equal(h.api.view,'chat');assert.equal(h.api.shouldPoll('chat'),true);assert.equal(h.api.shouldPoll('aprs'),false);
+ assert.equal(JSON.parse(shared.get('bpq-detached:chat')).owner,'child');assert.equal(h.document.documentElement.dataset.detachedView,'chat');
+ h.events.pagehide();assert.equal(shared.has('bpq-detached:chat'),false);h.tick();assert.equal(shared.has('bpq-detached:chat'),false);
+ assert.ok(h.calls.every(call=>call[0]==='navigate'));
+});
+
+
+test('a dock request stops the detached view even when its browser refuses scripted window closing',()=>{
+ const h=harness('?detached=monitor&window=child');h.docEvents['station-ready']();
+ h.events.storage({key:'bpq-detached-command',newValue:JSON.stringify({id:'monitor',action:'dock',at:Date.now()})});
+ assert.equal(h.shared.has('bpq-detached:monitor'),false);assert.equal(h.api.shouldPoll('monitor'),false);assert.equal(h.main.hidden,true);assert.ok(h.calls.includes('close'));
+});
diff --git a/map-refresh-ui.test.mjs b/map-refresh-ui.test.mjs
index c1a88da..ec992e3 100644
--- a/map-refresh-ui.test.mjs
+++ b/map-refresh-ui.test.mjs
@@ -112,3 +112,14 @@ test('APRS opens at a 30 km radius and refresh does not reset a manually selecte
h.fixture.fitLocal();assert.equal(l.state.fits,3);
data.own.position=null;h.fixture.setData(data);h.fixture.renderMap();assert.equal(h.$('#aprs-map-local').disabled,true);h.fixture.fitLocal();assert.equal(l.state.fits,3);
});
+
+
+test('APRS popups show decoded Mic-E values and keep encoded bytes only in a collapsed original-packet detail',()=>{
+ const h=harness('aprs-activity.js','globalThis.fixture={popup,stationDescription};');
+ const body='`'+String.fromCharCode(127)+'^U!n^>/"5J}';
+ const s={...station('N0TEST'),status:'',lastBody:body};
+ const description=h.fixture.stationDescription(s);assert.equal(description,'Mic-E · 107 km/h · 266° · Quota 142 m');
+ const html=h.fixture.popup(s);assert.match(html,/Pacchetto originale/);
+ assert.ok(html.includes(String.fromCharCode(92)+'x7f'));assert.ok(!html.includes(String.fromCharCode(127)));
+ assert.equal(s.lastBody,body);
+});
diff --git a/public/app.js b/public/app.js
index 686070d..754e1db 100644
--- a/public/app.js
+++ b/public/app.js
@@ -5,8 +5,8 @@ let csrf='',allMessages=[],dashboardData=null,filter='all',selected=null,page='h
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
async function api(url,options={}){const {busy=true,...request}=options;const finish=(busy&&window.BPQBusy?.start())||(()=>{});try{const r=await fetch('/api'+url,{...request,headers:{...(options.body instanceof FormData?{}:{'Content-Type':'application/json'}),...(options.method==='POST'?{'X-CSRF-Token':csrf}:{}),...options.headers}});const data=await r.json();if(!r.ok){if(r.status===401&&url!=='/login')showLogin();throw new Error(data.error||'Richiesta fallita')}return data;}finally{finish();}}
function toast(text){$('#toast').textContent=text;$('#toast').hidden=false;clearTimeout(toast.timer);toast.timer=setTimeout(()=>$('#toast').hidden=true,6500);}
-function showLogin(){document.title='BPQ Console';$('#shell').hidden=true;$('#login').hidden=false;csrf='';}
-function showShell(user){deletedMessageIds.clear();station=user.config;applyStation(user);csrf=user.csrf;$('#login').hidden=true;$('#shell').hidden=false;loadDashboard();if(station.features.bbs)loadMessages();document.dispatchEvent(new Event('station-ready'));}
+function showLogin(){document.dispatchEvent(new Event('bpq-detach-auth-lost'));document.title='BPQ Console';$('#shell').hidden=true;$('#login').hidden=false;csrf='';}
+function showShell(user){deletedMessageIds.clear();station=user.config;applyStation(user);csrf=user.csrf;$('#login').hidden=true;$('#shell').hidden=false;if(!window.BPQDetached?.view){loadDashboard();if(station.features.bbs)loadMessages();}document.dispatchEvent(new Event('station-ready'));}
function logTime(value){if(!value)return '—';const m=value.match(/^(\d{2})(\d{2})(\d{2}) (\d{2}:\d{2}:\d{2})$/);if(!m)return value;return new Date(`20${m[1]}-${m[2]}-${m[3]}T${m[4]}Z`).toLocaleTimeString(BPQI18n.locale(),{hour:'2-digit',minute:'2-digit'});}
function categoryLabel(m){return m.type==='P'?BPQI18n.t('PERSONALE'):m.to||BPQI18n.t('BOLLETTINO')}
function friendlyActivity(text){if(/Failure with/.test(text))return 'il nodo remoto non ha risposto alla chiamata';if(/Connecting to BBS/.test(text))return 'Chiamata radio verso il nodo remoto avviata';if(/Incoming Connect/.test(text))return 'il nodo remoto si è collegato alla nostra BBS';if(/Uncompressing Message/.test(text))return 'Ricevuto e salvato un nuovo bollettino';if(/Disconnected/.test(text))return 'Sessione con il nodo remoto terminata';return text;}
@@ -16,7 +16,7 @@ function navigate(next){page=next;$$('.page').forEach(p=>p.hidden=p.id!==next);$
$$('[data-page]').forEach(b=>b.addEventListener('click',()=>navigate(b.dataset.page)));
$('#login-form').addEventListener('submit',async e=>{e.preventDefault();const b=e.target.querySelector('button');b.disabled=true;$('#login-error').textContent='';try{const user=await api('/login',{method:'POST',body:JSON.stringify(Object.fromEntries(new FormData(e.target)))});e.target.password.value='';showShell(user);}catch(err){$('#login-error').textContent=err.message}finally{b.disabled=false}});
$('#logout').onclick=async()=>{try{await api('/logout',{method:'POST',body:'{}'})}finally{showLogin()}};
-async function loadDashboard(background=false){try{const d=await api('/dashboard',{busy:!background});dashboardData=d;$('#connection').textContent=d.errors.length?'● Dati parziali':'● BPQ connesso';$('#notice').hidden=!d.errors.length;$('#notice').textContent=d.errors.join(' · ');$('#k-messages').textContent=d.counts.messages;$('#nav-count').textContent=d.counts.messages;$('#k-message-detail').textContent=`${d.counts.bulletins} bollettini · ${d.counts.personal} personali`;$('#k-nodes').textContent=d.nodes.length;$('#k-routes').textContent=d.routes.filter(r=>r.active).length;$('#k-sync').textContent=logTime(d.sync?.at);$('#k-sync-detail').textContent=d.sync?`${d.sync.received} ${d.sync.received===1?'messaggio ricevuto':'messaggi ricevuti'} · ${mailTimezone()}`:'Nessuno rilevato oggi';const r=d.radio;$('#radio-freq').textContent=r?.frequency||'—';$('#radio-status').textContent=r?.connected?'MODEM ONLINE':'NON DISPONIBILE';$('#radio-modem').textContent=r?.connected?(station.radio?.driver||'Modem')+' '+r.mode:'Non collegato';$('#radio-channel').textContent=r?(r.busy?'Occupato':'Libero'):'—';$('#radio-snr').textContent=r?r.snr+' dB':'—';$('#radio-scan').textContent=r?.scanning?'● Scansione attiva':r?.state&&r.state!=='Free'?'● '+r.state:'Scansione non rilevata';$('#updated').textContent='Aggiornato '+new Date(d.updatedAt).toLocaleTimeString(BPQI18n.locale(),{hour:'2-digit',minute:'2-digit'});$('#routes').innerHTML=d.routes.map(r=>`
`}).join('');$('#node-total').textContent=d.nodes.length+' destinazioni';}catch(err){$('#connection').textContent='● Connessione assente';$('#notice').hidden=false;$('#notice').textContent=err.message;}}
async function loadMessages(background=false){if(!station.features.bbs)return;try{allMessages=(await api('/messages',{busy:!background})).filter(m=>!deletedMessageIds.has(m.id));const current=$('#category').value;const categories=[...new Set(allMessages.filter(m=>m.type==='B').map(m=>m.to))].sort();$('#category').innerHTML=''+categories.map(c=>``).join('');$('#category').value=current;renderMessages();}catch(err){toast(err.message)}}
function mailDate(m,kind='received'){const value=kind==='sent'?m.createdAt:(m.receivedAt||m.createdAt);if(!value)return m.date||'—';return new Date(value).toLocaleString(BPQI18n.locale(),{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit'});}
function mailTimezone(){const minutes=-new Date().getTimezoneOffset();return 'UTC'+(minutes>=0?'+':'-')+String(Math.floor(Math.abs(minutes)/60)).padStart(2,'0')+':'+String(Math.abs(minutes)%60).padStart(2,'0');}
diff --git a/public/aprs-activity.css b/public/aprs-activity.css
index 3e038f8..758b902 100644
--- a/public/aprs-activity.css
+++ b/public/aprs-activity.css
@@ -45,3 +45,5 @@
.aprs-map-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.aprs-map-actions .secondary{white-space:nowrap}@media(max-width:650px){.aprs-map-actions{width:100%;justify-content:flex-start}.aprs-map-actions .secondary{flex:1}}
.aprs-map-actions .secondary[aria-pressed=true]{border-color:#88c7b1;background:#8acbb018;color:#c8ebdf}
+
+.aprs-map-popup p{white-space:pre-line}.aprs-raw-packet summary{font-size:11px;color:#a9c4d8;cursor:pointer}.aprs-raw-packet pre{max-height:120px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.5 Consolas,monospace;color:#a7becf;margin:6px 0}.aprs-received-station p{white-space:pre-line}
diff --git a/public/aprs-activity.js b/public/aprs-activity.js
index 34ba6a3..b0bbb42 100644
--- a/public/aprs-activity.js
+++ b/public/aprs-activity.js
@@ -17,7 +17,18 @@
}
const symbolKey=(s)=>JSON.stringify([s.position?.symset,s.position?.symbol,s.transport]);
function symbolDetail(position){const info=window.BPQAprsSymbols.decode(position);return info?esc(info.name)+' · '+esc(info.code)+''+(info.overlay?' · '+BPQI18n.t('Sovrapposizione')+' '+esc(info.overlay):''):BPQI18n.t('Simbolo non disponibile');}
- function popup(s){return '
'+esc(s.call)+''+symbolDetail(s.position)+''+esc(s.transport)+(s.port?' · Port '+s.port:'')+''+esc(time(s.lastAt))+''+s.position.lat.toFixed(5)+', '+s.position.lon.toFixed(5)+'
'+esc(s.call)+''+symbolDetail(s.position)+''+esc(s.transport)+(s.port?' · Port '+s.port:'')+''+esc(time(s.lastAt))+''+s.position.lat.toFixed(5)+', '+s.position.lon.toFixed(5)+'
');}
+ function renderStations(){const list=stations();markup('#aprs-received-stations',list.map(s=>'').join('')||'
Nessuna stazione ricevuta con questi filtri.
');}
function render(){if(!data)return;const events=data.events.filter(e=>(!source()||e.transport===source())&&(!$('#aprs-direction').value||e.direction===$('#aprs-direction').value)&&(!query()||(e.packet+' '+e.from).toUpperCase().includes(query()))).slice().reverse();
$('#aprs-live-state').textContent=paused?'Vista in pausa':data.monitor==='online'?'● APRS in tempo reale':'Monitor '+data.monitor;
markup('#aprs-activity-kpis',[['Radio RX',events.filter(e=>e.transport==='Radio'&&e.direction==='RX').length],['Radio TX · BPQ',events.filter(e=>e.transport==='Radio'&&e.direction==='TX').length],['Internet RX',events.filter(e=>e.transport==='Internet'&&e.direction==='RX').length],['Internet TX',events.filter(e=>e.transport==='Internet'&&e.direction==='TX').length],['Stazioni ricevute',stations().length]].map(([k,v])=>''+esc(k)+''+v+'').join(''));
$('#aprs-traffic-count').textContent=events.length+' '+BPQI18n.t('pacchetti nel registro');markup('#aprs-traffic-rows',events.slice(0,400).map(e=>'
Connettiti con il tuo account per partecipare alla chat.
`;$('main').append(chatPage);
const topicDialog=document.createElement('dialog');topicDialog.innerHTML='';document.body.append(topicDialog);
@@ -45,7 +45,7 @@ function renderChat(data){
}
}
-async function pollChat(){if(!csrf||chatPollBusy)return;chatPollBusy=true;try{renderChat(await api('/chat',{busy:false}))}catch(e){if(page==='chat')toast(e.message)}finally{chatPollBusy=false}}
+async function pollChat(){if(!csrf||chatPollBusy||window.BPQDetached&&!window.BPQDetached.shouldPoll('chat'))return;chatPollBusy=true;try{renderChat(await api('/chat',{busy:false}))}catch(e){if(page==='chat')toast(e.message)}finally{chatPollBusy=false}}
$('#chat-connect').onclick=async()=>{try{chatLastId=0;chatFollowing=true;chatUnread=0;$('#chat-messages').innerHTML='';renderChat(await api('/chat/connect',{method:'POST',body:'{}'}))}catch(e){toast(e.message)}};$('#chat-disconnect').onclick=async()=>{try{await api('/chat/disconnect',{method:'POST',body:'{}'});pollChat()}catch(e){toast(e.message)}};
$('#chat-form').onsubmit=async e=>{e.preventDefault();const input=$('#chat-input'),button=$('#chat-send'),text=input.value.trim();if(!text)return;button.disabled=true;try{await api('/chat/send',{method:'POST',body:JSON.stringify({text,to:$('#chat-recipient').value})});input.value='';await pollChat()}catch(err){toast(err.message)}finally{button.disabled=chatState!=='online';input.focus()}};
$('#new-topic').onclick=()=>topicDialog.showModal();$('#topic-cancel').onclick=()=>topicDialog.close();$('#topic-form').onsubmit=async e=>{e.preventDefault();try{await api('/chat/topic',{method:'POST',body:JSON.stringify({topic:$('#topic-name').value})});topicDialog.close();pollChat()}catch(err){toast(err.message)}};
diff --git a/public/i18n.js b/public/i18n.js
index 5ee2da8..04a6539 100644
--- a/public/i18n.js
+++ b/public/i18n.js
@@ -8,6 +8,24 @@ Zona locale · 30 km|Local area · 30 km
Inquadra il gruppo più denso, ignorando le stazioni isolate|Fit the densest group, excluding isolated stations
Inquadra un raggio di 30 km dalla tua stazione|Show a 30 km radius around your station
Posizione della tua stazione non disponibile|Your station position is unavailable
+Questa sezione è aperta in una finestra separata.|This section is open in a separate window.
+Sezione riportata nel pannello|Section returned to the dashboard
+Puoi chiudere questa finestra.|You can close this window.
+Mostra finestra|Show window
+Riporta qui|Bring back here
+Consenti le finestre popup per aprire la sezione separata.|Allow popups to open the detached section.
+Fosfori|Phosphor
+Stile del terminale|Terminal theme
+Stacca|Detach
+Torna al pannello|Back to dashboard
+Apri il pannello|Open dashboard
+Apri il terminale in una finestra separata|Open the terminal in a separate window
+Consenti le finestre popup per aprire il terminale separato.|Allow popups to open the detached terminal.
+Sessione scaduta. Accedi nuovamente dal pannello.|Session expired. Sign in again from the dashboard.
+Terminale non configurato in BPQ.|Terminal is not configured in BPQ.
+Quota|Altitude
+Posizione APRS|APRS position
+Pacchetto originale|Original packet
Simbolo non disponibile|Symbol unavailable
Sovrapposizione|Overlay
Commenta|Comment
diff --git a/public/index.html b/public/index.html
index 1be51eb..0923629 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,5 +1,5 @@
-BPQ Console
+BPQ Console