Add ALNODE BPQ web console with BBS, Winlink, chat and modem dashboard
This commit is contained in:
commit
5a50f0cfdf
213 files changed
+1027
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
# Runtime e credenziali
|
||||
node_modules/
|
||||
*.log
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
*.cfg
|
||||
*.ini
|
||||
*.mes
|
||||
DIRMES.SYS
|
||||
*.bak
|
||||
*.backup
|
||||
# File locali
|
||||
outputs/
|
||||
work/
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
@@ -0,0 +1,6 @@
|
||||
# Eseguire come amministratore solo se il pannello non si apre da altri PC della LAN.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$nodeExe = 'C:\Users\User1\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe'
|
||||
if (!(Get-NetFirewallRule -DisplayName 'ALNODE Web Console LAN' -ErrorAction SilentlyContinue)) {
|
||||
New-NetFirewallRule -DisplayName 'ALNODE Web Console LAN' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8090 -RemoteAddress '192.168.1.0/24' -Program $nodeExe -Profile Any
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
# ALNODE Console
|
||||
|
||||
Console web locale per BPQ32, con backend Node.js e interfaccia HTML/CSS/JavaScript. Le pagine BPQ non vengono incorporate nell'interfaccia.
|
||||
|
||||
## Avvio
|
||||
|
||||
Richiede Windows, Node.js 20 o successivo e BPQ32 attivo sullo stesso computer.
|
||||
|
||||
```powershell
|
||||
node server.mjs
|
||||
```
|
||||
|
||||
Aprire http://127.0.0.1:8090 oppure http://IP-DEL-PC:8090 sulla rete locale. La porta del pannello può essere impostata con la variabile BPQ_CONSOLE_PORT.
|
||||
|
||||
Il progetto è configurato per la stazione IU2EUG: legge BPQ32.cfg e i dati BPQ da %APPDATA%/BPQ32. L'accesso usa le credenziali Telnet dell'account sysop IU2EUG, lette sul server. Password e configurazioni della stazione non sono incluse nel repository.
|
||||
|
||||
Connessioni locali richieste:
|
||||
|
||||
| Servizio | Porta |
|
||||
| --- | --- |
|
||||
| Interfaccia HTTP BPQ | 8080 |
|
||||
| Telnet BPQ / chat | 8100 |
|
||||
| BPQTermTCP / monitor FBB | 8101 |
|
||||
| Pannello web | 8090 |
|
||||
| Syslog VARA, UDP loopback | 18514 |
|
||||
|
||||
Start-Console.ps1 avvia il pannello in background evitando una seconda istanza sulla porta 8090. Gli script Start-Console.ps1 e Enable-LAN.ps1 contengono il percorso Node di questo PC: adattarlo per altre installazioni. Enable-LAN.ps1 richiede privilegi amministrativi e apre la porta 8090 per la rete 192.168.1.0/24. La task Windows ALNODE-WebConsole presente su questo PC non viene creata automaticamente dal repository.
|
||||
|
||||
## Funzioni
|
||||
|
||||
- Dashboard scura con stato radio, CAT e VARA, chiamante/chiamato, CPU del PC e di VARA, SNR, grafici e modalità schermo intero.
|
||||
- BBS e Winlink con elenco sopra e lettura sotto, scorrimento indipendente, ricerca, filtri, composizione, risposta e cancellazione.
|
||||
- Date e ore convertite nella timezone del browser, indicata come offset UTC. Quando BPQ omette l'anno, viene ricostruito usando i riferimenti temporali del messaggio.
|
||||
- Aggiornamento manuale Winlink tramite il profilo RMS via Internet e avvio del forwarding configurato verso IW2OHX.
|
||||
- Chat Telnet nativa con utenti, stanze, collegamenti, messaggi pubblici e privati, scorrimento automatico e indicatore di nuovi messaggi.
|
||||
- Monitor BPQTermTCP con traffico RX/TX, porte, frame di controllo e NODES, ricerca, pausa e download TXT.
|
||||
- Notifiche per nuovi bollettini e posta, con suono disattivabile. Operano mentre il pannello è aperto; il suono richiede un gesto nel browser.
|
||||
- Allegati B2: download e anteprime immagini, PDF tramite PDF.js locale e testo. HTML e SVG sono mostrati come testo. Messaggi 7plus scaricabili, senza ricostruzione automatica delle parti.
|
||||
|
||||
Il KPI bitrate legge i comandi BITRATE del syslog nativo VARA, con direzione TX/RX, senza una seconda connessione TCP al modem. Configurare VARA con Syslog abilitato, host 127.0.0.1, porta UDP 18514 e CommandsLog attivo. Il ricevitore locale è verificato; il valore BITRATE effettivo deve ancora essere verificato durante una sessione radio. A riposo mostra zero; durante una sessione senza dato mostra velocità non disponibile. SNR viene da BPQ e non è una misura continua.
|
||||
|
||||
## Dati e sicurezza
|
||||
|
||||
Il pannello è amministrativo e destinato al PC e alla LAN fidata. Non esporre direttamente la porta HTTP su Internet. Include sessioni HttpOnly/SameSite, controlli Origin/CSRF e host limitati a loopback e indirizzi LAN privati. Dopo il riavvio del server occorre accedere di nuovo.
|
||||
|
||||
Lettura e scrittura dei messaggi passano dall'interfaccia BPQ. I file .mes vengono letti per gli allegati; DIRMES.SYS e i file dei messaggi non sono modificati direttamente. Elimina marca il messaggio K nella BBS locale: non richiama email già consegnate al CMS. Inviate indica inoltro al CMS, non lettura del destinatario.
|
||||
|
||||
La chat usa una sessione condivisa IU2EUG; conserva fino a 300 eventi in memoria. Il monitor conserva fino a 1000 frame in memoria e viene avviato dal suo pulsante. Entrambi si disconnettono dopo due minuti senza polling. Telemetria e payload syslog non sono archiviati dal pannello.
|
||||
|
||||
I log di runtime, le credenziali, le configurazioni BPQ/VARA e i messaggi della BBS sono esclusi da Git. Il progetto non contiene BPQ32 o VARA e richiede la configurazione della stazione già operativa.
|
||||
|
||||
## Verifica
|
||||
|
||||
```powershell
|
||||
node --test test.mjs
|
||||
```
|
||||
|
||||
I test coprono parsing BPQ, allegati binari, classificazione della posta Winlink, stato CMS, notifiche, chat, monitor, bitrate VARA e timestamp.
|
||||
|
||||
PDF.js e le risorse font/CMap incluse mantengono le proprie licenze in public/vendor/pdfjs.
|
||||
@@ -0,0 +1,5 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$listener = Get-NetTCPConnection -LocalPort 8090 -State Listen -ErrorAction SilentlyContinue
|
||||
if ($listener) { exit 0 }
|
||||
$nodeExe = 'C:\Users\User1\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe'
|
||||
Start-Process -FilePath $nodeExe -ArgumentList 'server.mjs' -WorkingDirectory $PSScriptRoot -WindowStyle Hidden -RedirectStandardOutput (Join-Path $PSScriptRoot 'server.log') -RedirectStandardError (Join-Path $PSScriptRoot 'server-error.log')
|
||||
@@ -0,0 +1,5 @@
|
||||
import path from 'node:path';
|
||||
export function safeName(name){return path.win32.basename(String(name).replaceAll('/','\\')).replace(/[\x00-\x1f\x7f]/g,'').slice(0,200)||'allegato.bin';}
|
||||
export function mimeOf(bytes,name){if(bytes.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])))return 'image/png';if(bytes[0]===255&&bytes[1]===216&&bytes[2]===255)return 'image/jpeg';if(/^GIF8[79]a$/.test(bytes.subarray(0,6).toString('ascii')))return 'image/gif';if(bytes.subarray(0,4).toString()==='RIFF'&&bytes.subarray(8,12).toString()==='WEBP')return 'image/webp';if(bytes.subarray(0,5).toString()==='%PDF-')return 'application/pdf';if(/\.(txt|csv|log|json|xml|html?|svg|md|7pl)$/i.test(name)&&!bytes.subarray(0,4096).includes(0))return 'text/plain';return 'application/octet-stream';}
|
||||
export function b2Body(bytes){const end=bytes.indexOf('\r\n\r\n');if(end<0||end>65536)return null;const header=bytes.subarray(0,end).toString('utf8'),body=header.match(/^Body:\s*(\d+)\s*$/m);if(!body||!/^Mid:/mi.test(header))return null;const length=Number(body[1]);if(end+4+length>bytes.length)throw new Error('Corpo B2 incompleto');const data=bytes.subarray(end+4,end+4+length);try{return new TextDecoder('utf8',{fatal:true}).decode(data);}catch{return data.toString('latin1');}}
|
||||
export function parseAttachments(bytes){const end=bytes.indexOf('\r\n\r\n');if(end<0||end>65536)return [];const header=bytes.subarray(0,end).toString('utf8'),body=header.match(/^Body:\s*(\d+)\s*$/m);const files=[...header.matchAll(/^File:\s*(\d+)\s+([^\r\n]+)\r?$/gm)];if(!body||!files.length)return [];if(files.length>128)throw new Error('Troppi allegati');let offset=end+4+Number(body[1])+2;if(offset>bytes.length)throw new Error('Messaggio B2 incompleto');return files.map((f,index)=>{const length=Number(f[1]);if(!Number.isSafeInteger(length)||offset+length>bytes.length)throw new Error('Allegato incompleto');const data=bytes.subarray(offset,offset+length);offset+=length+2;const name=safeName(f[2]);return {index,name,size:length,mime:mimeOf(data,name),data};});}
|
||||
@@ -0,0 +1,7 @@
|
||||
export function decode(s){return s.replace(/&#(\d+);/g,(_,n)=>String.fromCodePoint(Number(n))).replace(/&#x([a-f\d]+);/gi,(_,n)=>String.fromCodePoint(parseInt(n,16))).replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'|'/g,"'").replace(/ /g,' ').replace(/&/g,'&');}
|
||||
export function plain(html){return decode(html.replace(/<script[\s\S]*?<\/script>/gi,'').replace(/<style[\s\S]*?<\/style>/gi,'').replace(/<[^>]+>/g,' ')).replace(/\s+/g,' ').trim();}
|
||||
export function parseMessages(html){const result=[];const regex=/<a\s+href=\/WebMail\/WM\?[^>&\s]+&(\d+)>[^<]+<\/a>([^\r\n<]+)/gi;for(const m of html.matchAll(regex)){const line=m[2];const a=line.match(/^\s*(\S+)\s+([BPT])([A-Z$])\s+(\d+)\s(.{7})\s(.{7})\s(.{7})(.*)$/);if(a){result.push({id:Number(m[1]),date:a[1],type:a[2],status:a[3],size:Number(a[4]),to:a[5].trim(),via:a[6].trim(),from:a[7].trim(),subject:decode(a[8].trim())});continue;}const header=line.match(/^\s*(\S+)\s+([BPT])([A-Z$])\s+(\d+) (.{8})(.*)$/);if(!header)continue;const tail=header[6].match(/^(.*?)([A-Z0-9]{1,6}) {2,}(.*)$/);if(tail)result.push({id:Number(m[1]),date:header[1],type:header[2],status:header[3],size:Number(header[4]),to:header[5].trim(),via:tail[1].trim(),from:tail[2],subject:decode(tail[3].trim()),needsMetadata:true});}return result;}
|
||||
export function parseRoutes(html){return [...html.matchAll(/<tr>([\s\S]*?)<\/tr>/gi)].flatMap(m=>{const cells=[...m[1].matchAll(/<td[^>]*>([\s\S]*?)<\/td>/gi)].map(c=>plain(c[1]));if(cells.length<12)return [];return [{port:cells[0].replace('>',''),active:cells[0].startsWith('>'),call:cells[1],quality:Number(cells[2]),nodes:Number(cells[3]),frames:Number(cells[4]),retries:Number(cells[5]),heard:cells[9],queued:Number(cells[10])}];});}
|
||||
export function parseMessage(html){const m=html.match(/<textarea[^>]*>([\s\S]*?)<\/textarea>/i);if(!m)return null;const text=decode(m[1]).replace(/\r\n|\r/g,'\n');const header={},first=text.indexOf('\n\n');for(const l of text.slice(0,first).split('\n')){const sep=l.indexOf(':');if(sep>0)header[l.slice(0,sep)]=l.slice(sep+1).trim();}return {from:header.From||'',to:header.To||'',subject:header.Title||'',date:header['Date/Time']||'',bid:header.Bid||'',type:header['Type/Status']?.[0]||'',text:first>=0?text.slice(first+2):text};}
|
||||
export function bpqTimestamp(value,reference=new Date()) {const m=String(value||'').match(/^(\d{1,2})-([A-Za-z]{3})\s+(\d{2}):(\d{2})Z$/);if(!m)return null;const month=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'].indexOf(m[2].toLowerCase());if(month<0||Number(m[1])>31||Number(m[3])>23||Number(m[4])>59)return null;let year=reference.getUTCFullYear();let date=new Date(Date.UTC(year,month,Number(m[1]),Number(m[3]),Number(m[4])));if(date.getTime()>reference.getTime()+86400000)date=new Date(Date.UTC(--year,month,Number(m[1]),Number(m[3]),Number(m[4])));if(date.getUTCMonth()!==month||date.getUTCDate()!==Number(m[1]))return null;return date.toISOString();}
|
||||
export function parseRadio(html){const t=plain(html);return {connected:t.includes('Connected to VARA TNC'),state:t.match(/TNC State (.*?) Mode/)?.[1]||'Free',busy:t.includes('Channel State Busy'),mode:t.match(/Mode (\d+)/)?.[1]||'2300',snr:t.match(/S\/N ([\d,.-]+)/)?.[1]||'—',sent:Number(t.match(/Traffic Sent (\d+)/)?.[1]||0),received:Number(t.match(/RXed (\d+)/)?.[1]||0),frequency:t.match(/FT991A ([\d.]+) USB/)?.[1]||'—',scanning:/FT991A [\d.]+ USB S/.test(t)};}
|
||||
@@ -0,0 +1,34 @@
|
||||
import net from 'node:net';
|
||||
import {StringDecoder} from 'node:string_decoder';
|
||||
|
||||
export function parseUser(line){const m=line.match(/^([A-Z0-9]+(?:-\d+)?)\s+at\s+(\S+)\s+(.+?),\s*(.*?)\s+\[([^\]]+)\] Idle for (\d+) seconds/i);return m?{call:m[1],node:m[2],name:m[3],qth:m[4],topic:m[5],idle:Number(m[6])}:null;}
|
||||
export class Chat {
|
||||
constructor(credentials){this.credentials=credentials;this.state='offline';this.events=[];this.seq=0;this.users=[];this.topics=['General'];this.links=[];this.topic='General';this.lastAccess=Date.now();this.timer=setInterval(()=>{if(this.state==='online'&&Date.now()-this.lastAccess>120000)this.disconnect();else if(this.state==='online'&&Date.now()-this.lastRoster>30000)this.roster()},10000);this.timer.unref();}
|
||||
event(type,text,sender=null,to=null){this.events.push({id:++this.seq,type,text,sender,to,at:new Date().toISOString()});if(this.events.length>300)this.events.shift();}
|
||||
snapshot(){this.lastAccess=Date.now();return {state:this.state,events:this.events,users:this.users,topics:this.topics,links:this.links,topic:this.topic,call:'IU2EUG'};}
|
||||
async connect(){if(this.socket&&!this.socket.destroyed)return this.snapshot();const {user,password}=await this.credentials();this.users=[];this.links=[];this.events=[];this.state='connecting';this.section='';this.stage=0;this.buffer='';this.authBuffer='';this.decoder=new StringDecoder('utf8');this.iac=0;this.socket=net.createConnection({host:'127.0.0.1',port:8100});this.socket.setTimeout(15000);this.socket.on('timeout',()=>{if(this.state!=='online')this.socket.destroy(new Error('Timeout di accesso chat'));});this.socket.on('error',e=>{this.state='error';this.event('system','Chat non disponibile: '+e.message)});this.socket.on('close',()=>{if(this.state!=='error')this.state='offline';this.event('system','Disconnesso dalla chat')});
|
||||
this.socket.on('data',chunk=>{const bytes=[];for(const b of chunk){if(this.iac===1){if(b===255){bytes.push(b);this.iac=0}else if([251,252,253,254].includes(b))this.iac=2;else this.iac=0;continue}if(this.iac===2){this.iac=0;continue}if(b===255){this.iac=1;continue}bytes.push(b)}const text=this.decoder.write(Buffer.from(bytes)).replace(/\x1b\[[0-9;]*m/g,'');this.authBuffer=(this.authBuffer+text).slice(-5000);
|
||||
if(this.stage===0&&/Username:/i.test(this.authBuffer)){this.write(user);this.stage=1;this.authBuffer='';return;}
|
||||
if(this.stage===1&&/Password:/i.test(this.authBuffer)){this.write(password);this.stage=2;this.authBuffer='';return;}
|
||||
if(this.stage===2&&/Welcome|ALNODE:IU2EUG-7/i.test(this.authBuffer)){this.write('CHAT');this.stage=3;this.authBuffer='';return;}
|
||||
if(this.stage<3)return;this.buffer+=text.replace(/\r\n/g,'\n').replace(/\r/g,'\n');const lines=this.buffer.split('\n');this.buffer=lines.pop();for(const line of lines)this.line(line.trim());});
|
||||
this.lastAccess=Date.now();return this.snapshot();}
|
||||
line(line){if(!line)return;if(line.includes('[BPQChatServer-')){this.state='online';this.socket.setTimeout(0);this.event('system','Connesso a ALBCHT come IU2EUG');setTimeout(()=>{if(this.state==='online')this.roster()},1000);return;}
|
||||
if(/Already connected/i.test(line)){this.event('system','BPQ ha rilevato una precedente sessione IU2EUG. Se la connessione si chiude, premi Connetti.');return;}
|
||||
if(/Disconnected from Stream/i.test(line)){this.socket?.end();return;}
|
||||
const count=line.match(/^(\d+) Station\(s\) connected:/);if(count){this.users=[];this.remaining=Number(count[1]);this.section='users';return;}
|
||||
const user=parseUser(line);if(user){this.users=this.users.filter(u=>u.call!==user.call);this.users.push(user);if(user.call==='IU2EUG')this.topic=user.topic;this.remaining--;if(this.remaining<=0)this.section='';return;}
|
||||
if(line==='Active Topics are:'){this.topics=[];this.section='topics';return;}
|
||||
if(/^\d+ Node\(s\)|^Here |^User IU2EUG|^Links Defined:/.test(line)){if(line==='Links Defined:'){this.section='links';this.links=[]}else this.section='';return;}
|
||||
if(this.section==='topics'){if(/^[A-Za-z0-9_-]+$/.test(line)&&!/^IU2EUG$/.test(line)){this.topics.push(line);}return;}
|
||||
if(this.section==='links'){const m=line.match(/^([A-Z0-9]+-\d+)\s+(Open|Connect failed|Connecting|Closed)(.*)$/i);if(m){this.links.push({call:m[1],state:m[2],detail:m[3].trim()});return;}this.section='';}
|
||||
if(/^(Nodes via|\s*[A-Z0-9#]{3,6}(?:\s+[A-Z0-9#]{3,6}){2,})/.test(line))return;
|
||||
if(/^IU2EUG Chat Server|^Type \/h|^Bringing up links|^This may take|^The \/p|^ALNODE:/.test(line))return;
|
||||
const message=line.match(/^(?:\d{2}:\d{2}(?::\d{2})?\s+)?(?:<|\[)?([A-Z0-9]*\d[A-Z0-9]*(?:-\d+)?)(?:>|\])?\s*(?:\([^)]*\))?[: ]+(.+)$/);
|
||||
this.event(message?'message':'system',message?message[2]:line,message?message[1]:null);}
|
||||
write(text){this.socket?.write(text+'\r');}
|
||||
roster(){this.lastRoster=Date.now();this.write('/U');setTimeout(()=>{if(this.state==='online')this.write('/T')},500);setTimeout(()=>{if(this.state==='online')this.write('/P')},1000);}
|
||||
send(text,to=''){if(this.state!=='online')throw new Error('Connettiti alla chat prima di scrivere');if(typeof text!=='string'||!text.trim()||text.length>500||/[\r\n\x00-\x1f]/.test(text)||text.trim().startsWith('/'))throw new Error('Scrivi un messaggio su una sola riga, massimo 500 caratteri');if(to&&!/^[A-Z0-9]*\d[A-Z0-9]*(?:-\d+)?$/i.test(to))throw new Error('Nominativo non valido');this.write(to?'/S '+to.toUpperCase()+' '+text:text);this.event('message',text,'IU2EUG',to?to.toUpperCase():null);this.lastAccess=Date.now();}
|
||||
changeTopic(name){if(this.state!=='online')throw new Error('Chat non connessa');if(!/^[A-Za-z0-9_-]{1,24}$/.test(name))throw new Error('Nome stanza non valido');this.write('/T '+name);this.topic=name;this.event('system','Stanza selezionata: '+name);setTimeout(()=>this.state==='online'&&this.roster(),800);}
|
||||
disconnect(){if(this.socket&&!this.socket.destroyed){this.write('/QUIT');this.socket.end();}this.state='offline';}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function mailDirection(m){const sender=String(m.fromAddress||m.from||'').replace(/^RMS[/:]/i,'').trim().toUpperCase();const own=/^IU2EUG(?:-\d+)?(?:@WINLINK\.ORG)?$/.test(sender)||/^IU2EUG(?:-\d+)?$/i.test(m.from||'');return own?'outgoing':'incoming';}
|
||||
export function mailFolder(m){if(mailDirection(m)==='incoming')return 'inbox';return ['F','D'].includes(m.status)?'sent':'queue';}
|
||||
export function cmsStatus(log){const lines=log.split(/\r?\n/).filter(l=>/[|<>]RMS\s+/.test(l)&&!/;PR:|;PQ:|;FW:/.test(l));const start=lines.findLastIndex(l=>/Connecting to BBS RMS/.test(l));if(start<0)return {state:'idle',at:null,text:'Nessuna sessione rilevata oggi'};const part=lines.slice(start),last=part.at(-1);const done=part.some(l=>/[<>]RMS\s+FQ\s*$/.test(l));const failed=part.some(l=>/Protocol Error|Failure with|Authentication failed|Connection failed|Invalid password/i.test(l));const ended=part.some(l=>/RMS Disconnected/.test(l));return {state:done?'complete':failed?'error':ended?'ended':'running',at:last.slice(0,15),text:done?'Sincronizzazione completata':failed?'Errore nella sessione CMS':ended?'Sessione CMS conclusa':'Sincronizzazione in corso'};}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import net from 'node:net';
|
||||
|
||||
// BPQTermTCP: FF ESC colour + decoded frame + FE; FF FF port definitions.
|
||||
export class MonitorDecoder {
|
||||
constructor(onFrame,onPorts){this.onFrame=onFrame;this.onPorts=onPorts;this.buffer=Buffer.alloc(0);}
|
||||
push(chunk){this.buffer=Buffer.concat([this.buffer,chunk]);while(this.buffer.length){const start=this.buffer.indexOf(255);if(start<0){this.buffer=Buffer.alloc(0);return;}if(start)this.buffer=this.buffer.subarray(start);if(this.buffer.length<2)return;
|
||||
if(this.buffer[1]===255){const sep=this.buffer.indexOf(124,2);if(sep<0)return;const count=Number(this.buffer.subarray(2,sep).toString());if(!Number.isInteger(count)||count<0||count>64){this.buffer=this.buffer.subarray(2);continue;}let end=sep;for(let i=0;i<count;i++){end=this.buffer.indexOf(124,end+1);if(end<0)return;}const ports=this.buffer.subarray(sep+1,end).toString('utf8').split('|').map(s=>{const m=s.match(/^(\d+) (.*)$/);return m?{id:Number(m[1]),name:m[2]}:null}).filter(Boolean);this.onPorts(ports.filter(p=>p.id>0));this.buffer=this.buffer.subarray(end+1);continue;}
|
||||
const end=this.buffer.indexOf(254,2);if(end<0){if(this.buffer.length>65536)this.buffer=Buffer.alloc(0);return;}const frame=this.buffer.subarray(1,end);const direction=frame[0]===27?(frame[1]===91?'TX':'RX'):'RX';const text=frame.subarray(frame[0]===27?2:0).toString('utf8').replace(/\r\n?/g,'\n').replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,'').trimEnd();const port=Number(text.match(/\bPort=(\d+)/)?.[1])||null;if(text)this.onFrame({text,direction,port});this.buffer=this.buffer.subarray(end+1);
|
||||
}}
|
||||
}
|
||||
export class Monitor {
|
||||
constructor(credentials){this.credentials=credentials;this.state='offline';this.events=[];this.seq=0;this.ports=[];this.lastAccess=0;this.timer=setInterval(()=>{if(this.socket&&Date.now()-this.lastAccess>120000)this.disconnect()},15000);this.timer.unref();}
|
||||
snapshot(after=0){this.lastAccess=Date.now();return {state:this.state,error:this.error,ports:this.ports,latest:this.seq,first:this.events[0]?.id||0,events:this.events.filter(e=>e.id>after)};}
|
||||
async connect(){this.lastAccess=Date.now();if(this.pending)return this.pending;if(this.socket&&!this.socket.destroyed)return this.snapshot();this.pending=this.open();try{return await this.pending}finally{this.pending=null;}}
|
||||
async open(){const credentials=await this.credentials();this.state='connecting';this.error=null;this.auth='';const socket=net.createConnection({host:'127.0.0.1',port:8101});this.socket=socket;const decoder=new MonitorDecoder(frame=>{this.events.push({...frame,id:++this.seq,at:new Date().toISOString()});if(this.events.length>1000)this.events.shift()},ports=>this.ports=ports);socket.setTimeout(15000);socket.on('connect',()=>socket.write(credentials.user+'\r'+credentials.password+'\rBPQTermTCP\r'));socket.on('timeout',()=>socket.destroy(new Error('Timeout monitor BPQ')));socket.on('error',()=>{this.state='error';this.error='Monitor BPQ non disponibile'});socket.on('close',()=>{if(this.state!=='error')this.state='offline'});socket.on('data',chunk=>{if(this.state==='connecting'){this.auth=(this.auth+chunk.toString('utf8')).slice(-4096);if(/Connected to TelnetServer/i.test(this.auth)){this.state='online';this.auth='';socket.setTimeout(0);socket.write('\\'.repeat(4)+'7fffffffffffffff 1 1 1 1 0 1 1\r');}else if(/invalid|attempts|failed/i.test(this.auth)){socket.destroy(new Error('Accesso monitor fallito'));}}decoder.push(chunk)});return this.snapshot();}
|
||||
disconnect(){this.socket?.destroy();this.state='offline';}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"alnode-console","version":"1.0.0","private":true,"type":"module","scripts":{"start":"node server.mjs","test":"node --test test.mjs"}}
|
||||
@@ -0,0 +1,31 @@
|
||||
const $=s=>document.querySelector(s), $$=s=>[...document.querySelectorAll(s)];
|
||||
let csrf='',allMessages=[],dashboardData=null,filter='all',selected=null,page='home',loadGeneration=0;
|
||||
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
async function api(url,options={}){const r=await fetch('/api'+url,{...options,headers:{'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;}
|
||||
function toast(text){$('#toast').textContent=text;$('#toast').hidden=false;clearTimeout(toast.timer);toast.timer=setTimeout(()=>$('#toast').hidden=true,6500);}
|
||||
function showLogin(){$('#shell').hidden=true;$('#login').hidden=false;csrf='';}
|
||||
function showShell(user){csrf=user.csrf;$('#login').hidden=true;$('#shell').hidden=false;loadDashboard();loadMessages();}
|
||||
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('it-IT',{hour:'2-digit',minute:'2-digit'});}
|
||||
function categoryLabel(m){return m.type==='P'?'PERSONALE':m.to||'BOLLETTINO'}
|
||||
function friendlyActivity(text){if(/Failure with/.test(text))return 'IW2OHX non ha risposto alla chiamata';if(/Connecting to BBS/.test(text))return 'Chiamata radio verso IW2OHX avviata';if(/Incoming Connect/.test(text))return 'IW2OHX si è collegato alla nostra BBS';if(/Uncompressing Message/.test(text))return 'Ricevuto e salvato un nuovo bollettino';if(/Disconnected/.test(text))return 'Sessione con IW2OHX terminata';return text;}
|
||||
function readableBody(text){const m=text.match(/^((?:R:[^\n]*\n)+)/);if(!m)return esc(text);return `<details class="routing-trace"><summary>Percorso del messaggio nella rete</summary><pre>${esc(m[1])}</pre></details>${esc(text.slice(m[1].length).replace(/^\n+/,''))}`;}
|
||||
function size(n){return n>1024?(n/1024).toFixed(1)+' KB':n+' B'}
|
||||
function navigate(next){page=next;$$('.page').forEach(p=>p.hidden=p.id!==next);$$('nav button').forEach(b=>b.classList.toggle('active',b.dataset.page===next));$('#breadcrumb').textContent='Stazione / '+({home:'Panoramica',bbs:'BBS & messaggi',network:'Rete & nodi'}[next]);location.hash=next;if(next==='bbs')loadMessages();}
|
||||
$$('[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(){try{const d=await api('/dashboard');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?'VARA HF '+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('it-IT',{hour:'2-digit',minute:'2-digit'});$('#recent-list').innerHTML=d.recent.map(m=>`<div class="recent-item" tabindex="0" role="button" data-id="${m.id}"><span class="category-chip">${esc(categoryLabel(m))}</span><div><b>${esc(m.subject)}</b><small>${esc(m.from)} · #${m.id}</small></div><span>${esc(m.date)}</span></div>`).join('')||'<p class="empty">Nessun messaggio disponibile.</p>';$$('#recent-list [data-id]').forEach(b=>{const open=()=>{navigate('bbs');readMessage(Number(b.dataset.id))};b.onclick=open;b.onkeydown=e=>{if(e.key==='Enter')open()}});$('#activity-list').innerHTML=d.activity.slice(0,8).map(a=>`<div class="activity"><b>${esc(friendlyActivity(a.text))}</b><small>${esc(logTime(a.at))} · ${mailTimezone()}</small></div>`).join('')||'<p class="empty">Nessuna attività di forwarding rilevata oggi.</p>';$('#routes').innerHTML=d.routes.map(r=>`<tr><td>${esc(r.call)}</td><td><span class="tag">${r.active?'ATTIVO':'INATTIVO'}</span></td><td>${esc(r.port)}</td><td>${r.quality}</td><td>${r.nodes}</td><td>${r.frames}</td><td>${r.retries}</td></tr>`).join('')||'<tr><td colspan="7">Nessuna rotta disponibile</td></tr>';$('#nodes').innerHTML=d.nodes.map(n=>{const [alias,call]=n.split(':');return `<div class="node"><strong>${esc(alias)}</strong><small>${esc(call)}</small></div>`}).join('');$('#node-total').textContent=d.nodes.length+' destinazioni';}catch(err){$('#connection').textContent='● Connessione assente';$('#notice').hidden=false;$('#notice').textContent=err.message;}}
|
||||
async function loadMessages(){try{allMessages=await api('/messages');const current=$('#category').value;const categories=[...new Set(allMessages.filter(m=>m.type==='B').map(m=>m.to))].sort();$('#category').innerHTML='<option value="">Tutte le categorie</option>'+categories.map(c=>`<option>${esc(c)}</option>`).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('it-IT',{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');}
|
||||
function mailTimeMeta(m){const zone=mailTimezone();const stamp=kind=>{const value=kind==='sent'?m.createdAt:m.receivedAt;return value?new Date(value).toLocaleString('it-IT',{day:'2-digit',month:'2-digit',year:'numeric',hour:'2-digit',minute:'2-digit'}):null;};return [stamp('sent')?'Inviato <b>'+esc(stamp('sent'))+'</b>':'',stamp('received')?'Ricevuto <b>'+esc(stamp('received'))+'</b>':'','Timezone: '+esc(zone)].filter(Boolean).map(x=>'<span>'+x+'</span>').join('');}
|
||||
function mailRow(m,selection,attribute,options={}){const unread=m.status==='N',current=selection===m.id;return `<button class="message-item mail-row ${current?'selected':''} ${unread?'unread':''}" ${attribute}="${m.id}" aria-pressed="${current}" title="${esc(m.subject)}"><span class="mail-indicator" aria-label="${unread?'Non letto':'Letto'}">${unread?'●':'○'}</span><span class="mail-from" title="${esc(options.from||m.from)}">${esc(options.from||m.from)}</span><span class="mail-subject">${esc(m.subject||'(Senza oggetto)')}</span><span class="mail-category">${esc(options.category||m.to)}</span><time class="mail-date" datetime="${esc(m.receivedAt||m.createdAt||'')}" title="${esc(mailDate(m,'sent'))}">${esc(mailDate(m,options.dateKind))}</time><span class="mail-size">${size(m.size)}</span><span class="mail-status">${esc(options.status||m.status)}</span></button>`;}
|
||||
function renderMessages(){const q=$('#search').value.toLowerCase(),cat=$('#category').value;const list=allMessages.filter(m=>(filter==='all'||m.type===filter||filter==='sent'&&m.from==='IU2EUG')&&(!cat||m.to===cat)&&(!q||`${m.subject} ${m.from} ${m.to} ${m.id}`.toLowerCase().includes(q)));$('#list-count').textContent=list.length+' messaggi';$('#message-list').innerHTML=list.map(m=>mailRow(m,selected,'data-id',{category:categoryLabel(m),status:m.status==='F'?'Inoltrato':m.status==='N'?'Nuovo':m.status==='Y'?'Letto':m.status==='H'?'Trattenuto':m.status})).join('')||'<p class="empty">Nessun messaggio corrisponde ai filtri.</p>';$$('#message-list [data-id]').forEach(b=>b.onclick=()=>readMessage(Number(b.dataset.id)));}
|
||||
async function readMessage(id){const generation=++loadGeneration;selected=id;renderMessages();$('#reader').innerHTML='<div class="reader-empty"><h2>Caricamento messaggio…</h2></div>';try{const m=await api('/messages/'+id);if(generation!==loadGeneration)return;$('#reader').innerHTML=`<div class="reader-header"><span class="tag">${m.type==='B'?'BOLLETTINO':'MESSAGGIO PERSONALE'} · #${id}</span><h2>${esc(m.subject)}</h2><div class="reader-meta"><span>Da <b>${esc(m.from)}</b></span><span>A <b>${esc(m.to)}</b></span>${mailTimeMeta(m)}</div></div><div class="reader-body">${readableBody(m.text)}</div><footer class="reader-footer"><span>BID ${esc(m.bid||'—')}</span><button class="secondary" id="reply">↩ Rispondi</button></footer>`;$('#reply').onclick=()=>openCompose({to:m.from,subject:(/^Re:/i.test(m.subject)?m.subject:'Re: '+m.subject).slice(0,80),text:'\n\n--- '+m.from+' ---\n'+m.text.split('\n').map(l=>'> '+l).join('\n')});}catch(err){$('#reader').innerHTML=`<div class="reader-empty"><h2>Messaggio non disponibile</h2><p>${esc(err.message)}</p></div>`}}
|
||||
$$('[data-filter]').forEach(b=>b.onclick=()=>{filter=b.dataset.filter;$$('[data-filter]').forEach(x=>x.classList.toggle('active',x===b));renderMessages()});$('#search').oninput=renderMessages;$('#category').onchange=renderMessages;
|
||||
function openCompose(data={}){const f=$('#compose-form');f.reset();for(const [key,value]of Object.entries(data))f.elements[key].value=value;$('#compose-error').textContent='';$('#compose').showModal();f.elements.to.focus()}
|
||||
$$('.compose-button').forEach(b=>b.onclick=()=>openCompose());$$('.close-compose').forEach(b=>b.onclick=()=>{const f=$('#compose-form');if((f.elements.text.value||f.elements.subject.value)&&!confirm('Chiudere e scartare questa bozza?'))return;$('#compose').close()});
|
||||
$('#compose-form').addEventListener('submit',async e=>{e.preventDefault();const winlinkMode=typeof wlCompose!=='undefined'&&wlCompose;const b=$('#send-button');b.disabled=true;b.textContent='Salvataggio in BPQ…';$('#compose-error').textContent='';try{const data=Object.fromEntries(new FormData(e.target));const created=await api('/messages',{method:'POST',body:JSON.stringify(data)});$('#compose').close();toast('Messaggio #'+created.id+' salvato nella BBS. L’inoltro sarà gestito da BPQ.');if(winlinkMode){navigate('winlink');wlFolder='queue';await wlLoad();wlRender();wlRead(created.id);}else{navigate('bbs');await loadMessages();readMessage(created.id);}loadDashboard();}catch(err){$('#compose-error').textContent=err.message}finally{b.disabled=false;b.textContent='Salva e metti in coda →'}});
|
||||
$('#refresh').onclick=async()=>{const b=$('#refresh');b.disabled=true;await Promise.all([loadDashboard(),loadMessages()]);b.disabled=false};$('#sync-open').onclick=()=>$('#sync-dialog').showModal();$('#sync-cancel').onclick=()=>$('#sync-dialog').close();$('#sync-confirm').onclick=async()=>{const b=$('#sync-confirm');b.disabled=true;try{await api('/sync',{method:'POST',body:'{}'});$('#sync-dialog').close();toast('Richiesta di forwarding inviata a BPQ. Segui l’esito nell’attività.');setTimeout(loadDashboard,2500)}catch(err){toast(err.message)}finally{b.disabled=false}};
|
||||
setInterval(()=>{if(csrf&&!document.hidden)loadDashboard()},20000);setInterval(()=>{$('#clock').textContent=new Date().toLocaleTimeString('it-IT',{timeZone:'Europe/Rome',hour:'2-digit',minute:'2-digit'})+' · '+mailTimezone()},1000);
|
||||
api('/session').then(showShell).catch(()=>showLogin());
|
||||
@@ -0,0 +1,7 @@
|
||||
let attachmentGeneration=0,attachmentPdf=null;
|
||||
const attachmentDialog=document.createElement('dialog');attachmentDialog.className='attachment-dialog';attachmentDialog.innerHTML='<div class="dialog-heading"><h2 id="attachment-title">Allegato</h2><button id="attachment-close" class="icon-button" aria-label="Chiudi anteprima">×</button></div><div id="attachment-preview"></div><footer><a id="attachment-download" class="primary" download>Scarica file ↓</a></footer>';document.body.append(attachmentDialog);$('#attachment-close').onclick=()=>attachmentDialog.close();attachmentDialog.addEventListener('close',()=>{attachmentGeneration++;attachmentPdf?.destroy().catch(()=>{});attachmentPdf=null;$('#attachment-preview').replaceChildren();});
|
||||
async function renderPdf(url,generation){const pdfjs=await import('/vendor/pdfjs/pdf.min.mjs');pdfjs.GlobalWorkerOptions.workerSrc='/vendor/pdfjs/pdf.worker.min.mjs';const documentPdf=await pdfjs.getDocument({url,withCredentials:true,isEvalSupported:false,enableXfa:false,disableFontFace:true,useSystemFonts:true,standardFontDataUrl:'/vendor/pdfjs/standard_fonts/',cMapUrl:'/vendor/pdfjs/cmaps/',cMapPacked:true}).promise;if(generation!==attachmentGeneration){await documentPdf.destroy();return;}attachmentPdf=documentPdf;const preview=$('#attachment-preview');preview.innerHTML='<div class="pdf-controls"><button id="pdf-previous" class="secondary">←</button><span id="pdf-page"></span><button id="pdf-next" class="secondary">→</button></div><canvas id="pdf-canvas" aria-label="Anteprima pagina PDF"></canvas>';let page=1,busy=false;async function draw(){if(busy||generation!==attachmentGeneration)return;busy=true;try{const p=await documentPdf.getPage(page);const v=p.getViewport({scale:1});const scale=Math.min(2,Math.max(1,(preview.clientWidth-30)/v.width));const viewport=p.getViewport({scale});const canvas=$('#pdf-canvas');if(!canvas||generation!==attachmentGeneration)return;canvas.width=viewport.width;canvas.height=viewport.height;await p.render({canvasContext:canvas.getContext('2d'),viewport}).promise;$('#pdf-page').textContent=page+' / '+documentPdf.numPages;$('#pdf-previous').disabled=page===1;$('#pdf-next').disabled=page===documentPdf.numPages;}finally{busy=false}}$('#pdf-previous').onclick=()=>{if(page>1&&!busy){page--;draw()}};$('#pdf-next').onclick=()=>{if(page<documentPdf.numPages&&!busy){page++;draw()}};await draw();}
|
||||
async function openAttachment(id,file){const generation=++attachmentGeneration;$('#attachment-title').textContent=file.name;const url='/api/messages/'+id+'/attachments/'+file.index;$('#attachment-download').href=url;$('#attachment-preview').innerHTML='<p class="empty">Caricamento anteprima…</p>';attachmentDialog.showModal();if(file.mime.startsWith('image/')){const image=document.createElement('img');image.alt=file.name;image.src=url+'?preview=1';image.onerror=()=>$('#attachment-preview').innerHTML='<p class="empty">Anteprima non disponibile. Puoi scaricare il file.</p>';$('#attachment-preview').replaceChildren(image);}else if(file.mime==='application/pdf'){try{await renderPdf(url+'?preview=1',generation)}catch{if(generation===attachmentGeneration)$('#attachment-preview').innerHTML='<p class="empty">Anteprima PDF non disponibile. Puoi scaricare il file.</p>';}}else if(file.mime==='text/plain'){try{const data=await api('/messages/'+id+'/attachments/'+file.index+'?text=1');if(generation!==attachmentGeneration)return;const pre=document.createElement('pre');pre.textContent=data.text;$('#attachment-preview').replaceChildren(pre);if(data.truncated){const hint=document.createElement('p');hint.className='muted';hint.textContent='Anteprima limitata ai primi 128 KB. Il download contiene il file completo.';$('#attachment-preview').append(hint)}}catch(e){$('#attachment-preview').textContent=e.message}}else{$('#attachment-preview').innerHTML='<p class="empty">Anteprima non disponibile per questo formato. Puoi scaricare il file.</p>';}}
|
||||
async function showAttachments(id,reader){const section=document.createElement('section');section.className='message-attachments';section.innerHTML='<span class="muted">Controllo allegati…</span>';reader.querySelector('.reader-footer')?.before(section);try{const data=await api('/messages/'+id+'/attachments');if(!section.isConnected)return;if(!data.files.length&&!data.encoded){section.remove();return;}section.replaceChildren();if(data.files.length){const heading=document.createElement('h3');heading.textContent='Allegati · '+data.files.length;section.append(heading);for(const file of data.files){const row=document.createElement('div');row.className='attachment-row';row.innerHTML=`<span class="attachment-icon">${file.mime.startsWith('image/')?'▧':file.mime==='application/pdf'?'PDF':'▤'}</span><div><b>${esc(file.name)}</b><small>${size(file.size)}</small></div><button class="secondary attachment-open">Anteprima</button><a class="secondary" href="/api/messages/${id}/attachments/${file.index}" download>Scarica ↓</a>`;row.querySelector('button').onclick=()=>openAttachment(id,file);if(file.mime==='application/octet-stream')row.querySelector('button').hidden=true;section.append(row);}}if(data.encoded){const box=document.createElement('div');box.className='encoded-attachment';box.innerHTML=`<b>7plus · ${esc(data.encoded.name)}</b><p>Parte ${data.encoded.part}/${data.encoded.total}. L’anteprima dell’immagine richiede il file ricostruito dalle parti complete.</p><a class="text-button" href="/api/messages/${id}/source" download>Scarica testo originale della parte ↓</a>`;section.append(box);}}catch(e){section.innerHTML=`<span class="muted">${esc(e.message)}</span>`;}}
|
||||
const attachmentRead=readMessage;readMessage=async function(id){await attachmentRead(id);if(selected===id&&$('#reader .reader-footer'))showAttachments(id,$('#reader'));};
|
||||
const attachmentWlRead=wlRead;wlRead=async function(id){await attachmentWlRead(id);if(wlSelected===id&&$('#wl-reader .reader-footer'))showAttachments(id,$('#wl-reader'));};
|
||||
@@ -0,0 +1,74 @@
|
||||
:root{color-scheme:dark;--bg:#0b0e13;--ink:#e4e8f0;--muted:#8a94a5;--green:#91b8df;--line:#252b36;--white:#151a23;--lime:#b6cdea}body{background:var(--bg)}.sidebar{background:#10141c;border-right:1px solid #232936;color:#e0e8f4}.sidebar .brand{font-weight:600;letter-spacing:1px}.side-label{color:#69788d}.side-station,.profile{border-color:#262e3b}.side-station small,.profile small{color:#8493a8}.side-frequency span{color:#a9bbd2}.avatar{background:#263c55;color:#b7d4ee}.dot{background:#7baaac}nav button{color:#94a2b7}nav button.active{background:#202e41;color:#b6d4ef}nav button:hover{background:#1a2433}nav b{background:#324a65;color:#c5e0f6}.card,.metrics article,.service,.secondary,.icon-button,input,select,textarea{background:#151a23;border-color:var(--line);color:var(--ink)}.card-header{border-color:var(--line)}.metrics strong{font-weight:500}.metrics i{color:#7088a5}.metrics article{box-shadow:0 4px 20px #0001}.primary{background:#adc9e5;color:#122133}.primary:hover{background:#c5dcf0}.secondary:hover,button.service:hover,.recent-item:hover{background:#1c2431}.tag,.live-badge{background:#233348;color:#aac8e5}.service{border-top-color:var(--line)}.service-icon{background:#242f3d;color:#a2bdd9}.service-call{color:#8c9aaf}.radio-card{background:linear-gradient(130deg,#1c2a3b,#152031);border:1px solid #30445c;color:#e1eaf5}.radio-card .eyebrow{color:#89a8c9}.radio-card .tag{background:#304862;color:#bdd7ef}.radio-details span,.radio-frequency small{color:#8b9fb8}.radio-card footer{border-color:#34465a;color:#a0b8d3}.waveform{background:repeating-linear-gradient(90deg,transparent 0 6px,#6e9bbf 6px 8px,transparent 8px 12px)}.recent-item{border-color:var(--line)}.category-chip{border-color:#304155;background:#202c3b;color:#a6bed6}.activity{border-color:#334255}.activity:before{background:#7c9abd}.tabs{background:#161e2b;border:1px solid #2a3445}.tabs button{color:#8696ad}.tabs button.active{background:#2a3c53;color:#bed8ed;box-shadow:none}.mail-list-heading,.message-item,.reader-header,.reader-footer{border-color:var(--line)}.message-item{background:#151a23;color:var(--ink)}.message-item:hover{background:#1c2635}.message-item.selected{background:#233349;border-color:#96bada}.message-bottom span:first-child{color:#9bbbd9}.reader-empty{color:#7f8ca0}.reader-empty>span,.reader-empty h2{color:#819bb8}.reader-body{color:#c5cfde}.routing-trace{border-color:#2c3a4d;background:#111822;color:#8397b0}.node{background:#19212e;border-color:#2b3544}th{background:#111722;color:#94a2b8}td,th{border-color:var(--line)}dialog{background:#161c26;border-color:#344056;color:var(--ink)}dialog::backdrop{background:#05080cbd}.notice{background:#2c241a;border-color:#61502e;color:#d9bf8e}.error{color:#e29a91}#toast{background:#223447;color:#dfedfa}.login-art{background:linear-gradient(135deg,#152338,#10161f)}.login-art .eyebrow{color:#7ea2c8}.login-art em{color:#afcbe7}.login-art p{color:#8396b0}.signal-art i{border-color:#304a68}.signal-art b{color:#a8c5e4}.topbar{background:#0d1118}.page-heading h1{font-size:29px;letter-spacing:-.7px}.page-heading .eyebrow,.page-heading>div>p{display:none}.page-heading{margin-bottom:25px}.page-footer{color:#58667a}.brand>span{color:#748ba9}.text-button{color:#9bbbd9}.reader-header h2{font-weight:500}.notification-stack{position:fixed;bottom:23px;right:24px;display:flex;flex-direction:column;gap:10px;z-index:30;width:min(360px,calc(100vw - 36px))}.arrival-toast{display:flex;gap:13px;align-items:center;padding:17px 18px;background:#1c293b;border:1px solid #3d5877;border-radius:11px;box-shadow:0 12px 35px #0005;animation:slide-in .3s ease;color:#e1edf8;cursor:pointer}.arrival-toast>span{display:grid;place-items:center;width:35px;height:35px;border-radius:9px;background:#314861;color:#b7d5f0;font-size:19px}.arrival-toast strong{font-size:12px;display:block;font-weight:600}.arrival-toast small{font-size:11px;display:block;margin-top:5px;color:#9eb3ca}.arrival-toast button{border:0;background:none;color:#8397b0;margin-left:auto;font-size:18px}.arrival-toast.mail{border-color:#536451}.arrival-toast.mail>span{background:#364d3b;color:#b7d5bc}@keyframes slide-in{from{opacity:0;transform:translateY(15px)}to{opacity:1;transform:translateY(0)}}.sound-toggle{font-size:15px}.sound-toggle.enabled{background:#243f51;border-color:#4b748c;color:#c4e1ef}.chat-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:14px}.chat-heading h1{font-size:29px;font-weight:500}.chat-heading .chat-actions{display:flex;gap:10px;align-items:center}.chat-layout{display:grid;grid-template-columns:190px minmax(0,1fr) 235px;height:calc(100vh - 200px);min-height:500px;max-height:1000px;border:1px solid #2a3442;border-radius:12px;overflow:hidden;background:#121923}.chat-rooms{background:#111721;border-right:1px solid #273240;padding:20px 14px}.chat-label{display:flex;justify-content:space-between;align-items:center;color:#70839d;font-size:10px;letter-spacing:1.3px;font-weight:600;margin-bottom:13px}.cLine truncated
|
||||
.mobile-presence{display:none}.chat-layout{position:relative}@media(max-width:900px){.mobile-presence{display:inline-flex}.chat-layout.users-open .chat-users{display:block;position:absolute;right:0;top:0;bottom:0;width:235px;z-index:5;box-shadow:-15px 0 30px #0004}}
|
||||
.wl-account{color:#8095af;font:12px Consolas,monospace;margin-top:8px}.wl-status{display:flex;gap:18px;padding:13px 18px;border:1px solid #29394b;background:#121d2a;border-radius:9px;font-size:11px;color:#8195ae;margin-bottom:22px}.wl-status>span:last-child{margin-left:auto}.wl-state.complete{color:#a0c4ae}.wl-state.running{color:#b6cce5}.wl-state.error{color:#d3948a}.danger{border:1px solid #6a4241;background:#322121;color:#e8afaa;border-radius:7px;padding:10px 15px;cursor:pointer;font-size:12px}.danger:hover{background:#4a2a2a}.delete-subject{margin-top:18px;color:#c2cddd}.delete-note{font-size:12px;color:#8191a6;margin-top:15px}@media(max-width:600px){.wl-status{flex-wrap:wrap;gap:10px}.wl-status>span:last-child{margin-left:0}}
|
||||
.message-attachments{padding:20px 25px;border-top:1px solid #283647}.message-attachments h3{font-size:12px;color:#a5bdd5;margin:0 0 14px}.attachment-row{display:flex;align-items:center;gap:12px;border:1px solid #31445b;border-radius:8px;padding:12px;margin-top:9px;background:#142031}.attachment-icon{font-size:14px;color:#88accd}.attachment-row>div{flex:1;min-width:0}.attachment-row b{display:block;font-size:11px;overflow-wrap:anywhere}.attachment-row small{display:block;font-size:10px;color:#7890aa;margin-top:5px}.attachment-row .secondary{font-size:10px;padding:8px 10px;text-decoration:none}.encoded-attachment{padding:16px;background:#1c2532;border:1px solid #354357;border-radius:8px;font-size:11px}.encoded-attachment p{font-size:11px;color:#8fa3bd;margin:8px 0 12px}.encoded-attachment a{text-decoration:none}.attachment-dialog{width:min(1000px,94vw);max-height:92vh}.attachment-dialog .dialog-heading{margin-bottom:15px}.attachment-dialog h2{font-size:17px;overflow-wrap:anywhere}#attachment-preview{max-height:68vh;overflow:auto;min-height:80px;text-align:center}#attachment-preview img{max-width:100%;max-height:65vh;object-fit:contain;border-radius:8px}#attachment-preview iframe{width:100%;height:65vh;border:1px solid #354357;border-radius:7px;background:#fff}#attachment-preview pre{white-space:pre-wrap;overflow-wrap:anywhere;text-align:left;font:12px/1.8 Consolas,monospace;color:#c4d2e2}.attachment-dialog .primary{text-decoration:none}@media(max-width:600px){.attachment-row{flex-wrap:wrap}.attachment-row>div{min-width:70%}.attachment-row .secondary{flex:1}}
|
||||
.pdf-controls{display:flex;gap:15px;align-items:center;justify-content:center;margin-bottom:16px;color:#aac1db;font-size:12px}.pdf-controls button{padding:7px 12px}#pdf-canvas{max-width:100%;height:auto;background:#fff;border-radius:5px}
|
||||
|
||||
/* Consistent controls and contained chat layout. */
|
||||
:root{--control-height:44px;--focus-ring:#7fafdb;--radius-control:9px}
|
||||
button,input,select,textarea{font-family:inherit}
|
||||
button{transition:background .15s ease,border-color .15s ease,color .15s ease}
|
||||
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px}
|
||||
input:focus,textarea:focus,select:focus{border-color:#739bc3;box-shadow:0 0 0 3px #739bc322}
|
||||
input,select{min-height:var(--control-height);font-size:13px;border-radius:var(--radius-control)}
|
||||
textarea{font-size:13px;line-height:1.7;border-radius:var(--radius-control)}
|
||||
input::placeholder,textarea::placeholder{color:#74839a;opacity:1}
|
||||
button:disabled,input:disabled,select:disabled{opacity:.45;cursor:not-allowed}
|
||||
.primary,.secondary,.danger{min-height:var(--control-height);display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:12px;border-radius:var(--radius-control)}
|
||||
.icon-button{width:36px;height:36px;display:inline-grid;place-items:center;padding:0;flex-shrink:0}
|
||||
nav button{min-height:44px;gap:12px}nav button>span{width:20px;text-align:center;flex-shrink:0}
|
||||
.mail-toolbar{gap:10px}.mail-toolbar>input,.mail-toolbar>select{min-height:44px;font-size:12px}.tabs{min-height:44px;align-items:center}.tabs button{min-height:34px;padding:8px 12px}
|
||||
.reader-header h2{overflow-wrap:anywhere}.reader-meta{row-gap:10px;line-height:1.6}.reader-footer{gap:12px;flex-wrap:wrap}.reader-body{font-size:13px;line-height:1.85}
|
||||
.attachment-row{gap:14px}.attachment-row .secondary{min-height:36px}.wl-status{align-items:center;line-height:1.6;flex-wrap:wrap}
|
||||
.monitor-tools label select{margin:0}.monitor-tools label{gap:8px}.monitor-tools input[type=search]{min-height:44px}.monitor-console{scrollbar-gutter:stable}.monitor-footer label input{min-height:0}
|
||||
body:has(#chat:not([hidden])) .topbar{height:64px}
|
||||
#chat{height:calc(100dvh - 64px);max-width:none;padding:24px 28px;display:flex;flex-direction:column;gap:18px;min-height:0}
|
||||
#chat .chat-heading{margin:0;min-height:44px;flex-shrink:0}
|
||||
#chat .chat-heading h1{font-size:28px;letter-spacing:-.6px;line-height:1.2}
|
||||
#chat .chat-actions{gap:12px}#chat .chat-status{font-size:12px;white-space:nowrap}
|
||||
.chat-layout{flex:1;height:auto;min-height:0;max-height:none;grid-template-columns:175px minmax(0,1fr) 245px;grid-template-rows:minmax(0,1fr);border-color:#2b3b50;background:#101823;box-shadow:0 16px 40px #0002}
|
||||
.chat-main{min-height:0;overflow:hidden;position:relative}
|
||||
.chat-rooms,.chat-users{min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#34455d transparent}
|
||||
.chat-rooms{padding:20px 12px}.chat-users{padding:20px 12px}.chat-label{font-size:10px;padding:0 6px;min-height:24px;margin-bottom:12px}
|
||||
.chat-label button{width:26px;height:26px;display:grid;place-items:center;border-radius:6px}.chat-label button:hover{background:#23344b}
|
||||
.room-button{font-size:13px;min-height:40px;padding:10px 12px}.chat-links{margin-top:24px;padding-top:18px}.chat-link{font-size:11px;gap:10px;line-height:1.6;padding:9px 6px}.chat-link>span:first-child{font-family:Consolas,monospace}
|
||||
.chat-room-header{height:60px;padding:0 24px;gap:12px;background:#131e2b}.chat-room-header b{font-size:15px}.chat-room-header small{font-size:11px;white-space:nowrap}
|
||||
.chat-messages{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:auto;scrollbar-width:thin;scrollbar-color:#3b506c transparent;scrollbar-gutter:stable;padding:22px 24px 18px}
|
||||
.chat-event{margin:0 0 18px;gap:12px;align-items:flex-start}.chat-event>.chat-avatar{width:34px;height:34px;border-radius:10px;font-size:11px;margin-top:2px;background:linear-gradient(140deg,#2d4764,#24344b)}
|
||||
.chat-message-content{flex:1;min-width:0}.chat-message-meta{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:0 0 5px}.chat-event strong{font-size:12px;letter-spacing:.2px}.chat-event time{margin:0;font-size:10px;color:#788da6;font-variant-numeric:tabular-nums}.chat-event p{margin:0;font-size:13px;line-height:1.75;white-space:pre-wrap;color:#d3ddeb;max-width:900px}
|
||||
.chat-event.own .chat-message-content{padding:10px 14px;border:1px solid #2b4059;border-radius:0 10px 10px;background:#182739}.chat-event.own .chat-avatar{background:#35445f;color:#d2e2f5}.chat-private-label{font-size:10px;color:#b6a9d3;font-weight:400}.chat-event.private .chat-message-content{border-left:2px solid #786aa5;padding-left:12px}
|
||||
.chat-system{font-size:11px;line-height:1.7;color:#7f93ad;margin:14px 0 20px}.chat-offline-note{font-size:12px;line-height:1.7;color:#7e90a8;padding:8px 6px}
|
||||
.chat-user{padding:11px 8px;gap:10px;border-radius:8px}.chat-user>div{min-width:0;flex:1}.chat-user b{font-size:12px;line-height:1.3}.chat-user-name{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-user small{font-size:10px;line-height:1.5;overflow-wrap:anywhere;margin-top:3px}.presence-dot{width:6px;height:6px}.chat-user .chat-avatar{width:32px;height:32px;border-radius:9px}
|
||||
.chat-compose{flex:0 0 auto;padding:14px 20px 18px;background:#131d2b}.chat-recipient{margin:0 0 12px;justify-content:flex-start;gap:12px;font-size:11px;min-height:34px}.chat-recipient label{margin:0;flex-shrink:0}.chat-recipient select{display:block;margin:0;width:auto;max-width:300px;min-width:160px;min-height:34px;height:34px;padding:0 30px 0 10px;font-size:11px;border-color:#30415a}
|
||||
.chat-input-row{align-items:stretch;gap:10px}.chat-input-row input{height:46px;min-height:46px;font-size:13px;padding:0 14px;border-color:#344960;border-radius:9px}.chat-input-row button{height:46px;min-width:92px;padding:0 18px;flex-shrink:0}
|
||||
.chat-jump{position:absolute;bottom:153px;left:50%;transform:translateX(-50%);z-index:4;background:#263f5c;color:#e3f0fc;border:1px solid #577aa2;box-shadow:0 6px 20px #0005;border-radius:20px;min-height:36px;padding:8px 16px;font-size:12px;white-space:nowrap}.chat-jump:hover{background:#345374}
|
||||
@media(min-width:1600px){.chat-layout{grid-template-columns:195px minmax(0,1fr) 280px}.chat-messages{padding:26px 30px}.chat-compose{padding:16px 26px 20px}.chat-user{padding:12px 10px}}
|
||||
@media(max-width:1150px){#chat{padding:22px 24px}.chat-layout{grid-template-columns:145px minmax(0,1fr) 205px}.chat-messages{padding:18px}.chat-room-header{padding:0 18px}.chat-compose{padding:14px 16px 16px}}
|
||||
@media(max-width:900px){.chat-layout{grid-template-columns:140px minmax(0,1fr)}.chat-users{display:none}.chat-layout.users-open .chat-users{width:260px;background:#121c2a;border-left-color:#3b506b}}
|
||||
@media(max-width:600px){nav{overflow-x:auto;gap:4px;scrollbar-width:none}nav button{flex:0 0 auto;min-height:38px;padding:8px 10px;gap:6px}nav button>span{width:16px}.topbar{gap:8px}.topbar>div{gap:7px}.topbar .live-badge{font-size:9px;padding:6px 8px}.topbar>span{font-size:10px}.icon-button{width:32px;height:32px}body:has(#chat:not([hidden])) .topbar{height:56px}#chat{height:calc(100dvh - 185px);min-height:440px;padding:18px 14px;gap:14px}#chat .chat-heading h1{font-size:25px}#chat .chat-actions{gap:8px}#chat .chat-status{font-size:10px}.chat-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);min-height:0;height:auto}.chat-rooms{padding:8px 10px;overflow:auto}.chat-rooms>.chat-label,.chat-links{display:none}#chat-topics{display:flex;gap:4px;overflow:auto}.room-button{min-height:32px;padding:7px 10px;white-space:nowrap}.chat-room-header{height:48px;padding:0 14px}.chat-room-header b{font-size:13px}.chat-messages{padding:16px 14px}.chat-event{gap:9px;margin-bottom:16px}.chat-event>.chat-avatar{width:28px;height:28px;font-size:9px;border-radius:8px}.chat-event p{font-size:12px}.chat-compose{padding:12px}.chat-recipient{gap:8px;margin-bottom:10px}.chat-recipient select{max-width:calc(100% - 80px);min-width:0;flex:1}.chat-input-row{gap:8px}.chat-input-row button{min-width:64px;padding:0 12px}.chat-input-row input{font-size:16px}.chat-jump{bottom:143px;font-size:11px}.reader-footer{align-items:flex-start}.monitor-footer{line-height:1.6}.mail-toolbar .tabs{overflow:auto;width:100%}.tabs button{padding:8px 10px}.attachment-row .secondary{min-height:36px}}
|
||||
@media(prefers-reduced-motion:reduce){button{transition:none}.arrival-toast{animation:none}}
|
||||
|
||||
.chat-actions .mobile-presence{display:none}@media(max-width:900px){.chat-actions .mobile-presence{display:inline-flex}}
|
||||
|
||||
@media(max-width:600px){nav{justify-content:flex-start}nav button{width:auto}#chat .chat-heading{gap:8px}.chat-jump{max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis}}
|
||||
|
||||
/* Outlook-style list above the reading pane. */
|
||||
#bbs,#winlink{height:calc(100dvh - 76px);max-width:none;padding:24px 28px;display:flex;flex-direction:column;min-height:0}
|
||||
#bbs .page-heading,#winlink .chat-heading{min-height:44px;flex-shrink:0;margin-bottom:16px}#bbs .page-heading h1,#winlink .chat-heading h1{font-size:28px;line-height:1.2}#winlink .wl-account{margin-top:5px}
|
||||
#bbs .mail-toolbar,#winlink .mail-toolbar{flex:0 0 auto;margin-bottom:14px}#winlink .wl-status{flex:0 0 auto;padding:9px 14px;margin-bottom:14px;font-size:11px}
|
||||
#bbs .mail-layout,#winlink .mail-layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(165px,.40fr) minmax(230px,.60fr);gap:14px;align-items:stretch}
|
||||
.mail-layout .mail-list{display:flex;flex-direction:column;min-height:0;max-height:none;overflow:hidden;border-radius:10px;background:#101822}
|
||||
.mail-layout .mail-list-heading{padding:10px 18px;min-height:36px;flex:0 0 auto;background:#151f2d;border-bottom:1px solid #2b394e;font-size:11px}.mail-rows{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#405673 transparent}
|
||||
.mail-columns,.mail-row{--mail-columns:16px minmax(130px,.9fr) minmax(200px,2.7fr) 100px 142px 74px 125px;display:grid;grid-template-columns:var(--mail-columns);gap:14px;align-items:center}
|
||||
.mail-columns{flex:0 0 auto;padding:9px 18px;background:#121c29;border-bottom:1px solid #2b394e;font-size:10px;color:#8e9fb7;min-height:34px}.mail-columns>span{min-width:0}.mail-columns>span:nth-last-child(2){text-align:right}
|
||||
.message-item.mail-row{min-height:43px;padding:10px 18px;text-align:left;border:0;border-bottom:1px solid #263247;background:#131c29;border-radius:0;font-size:12px;font-weight:400;line-height:1.4;position:relative;gap:14px;color:#b7c4d7}
|
||||
.mail-row:hover{background:#1c2b3e}.message-item.mail-row.selected{background:#203b56;padding-left:18px;border-left:0;color:#e2eefb}.mail-row.selected:before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:#91c8f3}
|
||||
.mail-row>span,.mail-row>time{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.mail-row.unread .mail-from,.mail-row.unread .mail-subject{font-weight:600;color:#e0ebf7}.mail-from{color:#bbd3e9;font-size:12px}.mail-subject{font-size:12px}.mail-indicator{font-size:9px;color:#4b607a}.mail-row.unread .mail-indicator{color:#7bb8ed}.mail-category{font-size:9px;letter-spacing:.35px;color:#9fb6cf}.mail-date{font-size:10px;color:#a1b0c4;font-variant-numeric:tabular-nums}.mail-size{font-size:10px;color:#8095ad;text-align:right}.mail-status{font-size:10px;color:#8ca5c0}.mail-row.unread .mail-status{color:#a7cce8}
|
||||
.mail-layout .reader{display:flex;flex-direction:column;min-height:0;overflow:hidden;border-radius:10px;background:#111a26}.mail-layout .reader-header{padding:14px 20px;flex:0 0 auto;background:#151f2d}.mail-layout .reader-header h2{font-size:19px;line-height:1.35;margin:9px 0 12px;font-weight:600}.mail-layout .reader-meta{font-size:11px;gap:8px 22px}.mail-layout .reader-body{flex:1 1 0;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;padding:18px 20px;font-size:13px;scrollbar-width:thin;scrollbar-color:#405673 transparent}.mail-layout .reader-empty{flex:1;min-height:0;padding:24px;gap:8px}.mail-layout .reader-empty>span{font-size:30px;margin:0 0 8px}.mail-layout .reader-empty h2{font-size:17px;margin:0}.mail-layout .reader-empty p{margin:0}.mail-layout .reader-footer{flex:0 0 auto;padding:9px 20px;background:#151f2d;border-top:1px solid #2b394e;min-height:54px}.mail-layout .reader-footer .secondary,.mail-layout .reader-footer .danger{min-height:34px;padding:7px 13px;font-size:11px}.mail-layout .reader-footer .danger{margin-left:auto}.mail-layout .message-attachments{flex:0 0 auto;max-height:130px;overflow:auto;padding:12px 20px;scrollbar-width:thin}.mail-layout .attachment-row{padding:8px 10px;margin-top:7px}.mail-layout .message-attachments h3{margin-bottom:8px}.mail-layout .routing-trace{margin-bottom:16px}
|
||||
.mail-timezone{font-size:10px;color:#738ba5;white-space:nowrap;margin-left:auto}
|
||||
@media(max-width:1400px){.mail-columns,.mail-row{--mail-columns:14px minmax(110px,.9fr) minmax(180px,2.5fr) 80px 130px 65px 100px;gap:11px}.message-item.mail-row{gap:11px}.mail-from,.mail-subject{font-size:11px}}
|
||||
@media(max-width:1150px){#bbs,#winlink{padding:22px 24px}.mail-columns,.mail-row{--mail-columns:12px minmax(100px,.9fr) minmax(150px,2fr) 130px 90px}.mail-columns>span:nth-child(4),.mail-columns>span:nth-child(6),.mail-row .mail-category,.mail-row .mail-size{display:none}.mail-toolbar .mail-timezone{flex-basis:100%;text-align:right}}
|
||||
@media(max-width:850px){.mail-columns,.mail-row{--mail-columns:12px minmax(90px,.9fr) minmax(130px,2fr) 125px}.mail-columns>span:last-child,.mail-row .mail-status{display:none}.mail-timezone{display:none}}
|
||||
@media(max-width:600px){#bbs,#winlink{height:auto;min-height:calc(100dvh - 175px);padding:20px 14px}#winlink .chat-heading{flex-wrap:wrap;gap:12px}#winlink .chat-actions{display:flex;gap:8px}.mail-toolbar .tabs{width:100%;flex-wrap:nowrap}.mail-layout .mail-list{max-height:none}#bbs .mail-layout,#winlink .mail-layout{flex:none;grid-template-rows:260px minmax(330px,auto);gap:12px}.mail-columns{display:none}.message-item.mail-row{grid-template-columns:12px minmax(0,1fr) 110px;grid-template-rows:auto auto;gap:4px 9px;padding:11px 12px;min-height:62px}.message-item.mail-row.selected{padding-left:12px}.mail-indicator{grid-column:1;grid-row:1 / 3;align-self:start;margin-top:3px}.mail-from{grid-column:2;grid-row:1}.mail-date{grid-column:3;grid-row:1;font-size:9px;text-align:right}.mail-subject{grid-column:2 / 4;grid-row:2;font-size:12px}.mail-layout .reader-header{padding:14px 16px}.mail-layout .reader-header h2{font-size:17px}.mail-layout .reader-body{flex:none;min-height:150px;max-height:50dvh;padding:16px;font-size:12px}.mail-layout .reader-footer{padding:9px 16px}.mail-layout .reader-meta{gap:7px 14px;font-size:10px}.mail-layout .message-attachments{padding:12px 16px;max-height:170px}}
|
||||
|
||||
.mail-layout .mail-list-heading{gap:16px}.mail-layout .mail-list-heading>span{white-space:nowrap}.mail-layout .mail-list-heading .mail-timezone{margin-left:auto}
|
||||
@@ -0,0 +1,60 @@
|
||||
import {incoming} from '/notifications.js';
|
||||
let soundOn=localStorage.getItem('alnode-sound')!=='no',audio=null,chatLastId=0,chatState='offline',chatPollBusy=false;
|
||||
const soundButton=document.createElement('button');soundButton.id='sound-toggle';soundButton.className='icon-button sound-toggle';soundButton.setAttribute('aria-label','Attiva o disattiva suoni');$('#refresh').before(soundButton);
|
||||
function soundLabel(){soundButton.textContent=soundOn?'♪':'♩';soundButton.classList.toggle('enabled',soundOn);soundButton.title=soundOn?'Suono attivo':'Attiva suono notifiche';soundButton.setAttribute('aria-pressed',String(soundOn))}soundLabel();
|
||||
function prepareAudio(){try{audio??=new (window.AudioContext||window.webkitAudioContext)();audio.resume();}catch{}}
|
||||
function chime(){if(!soundOn||!audio||audio.state!=='running')return;const t=audio.currentTime;for(const [offset,freq]of [[0,659.25],[.17,987.77]]){const o=audio.createOscillator(),g=audio.createGain();o.type='sine';o.frequency.value=freq;g.gain.setValueAtTime(0,t+offset);g.gain.linearRampToValueAtTime(.045,t+offset+.025);g.gain.exponentialRampToValueAtTime(.0001,t+offset+.65);o.connect(g);g.connect(audio.destination);o.start(t+offset);o.stop(t+offset+.7)}}
|
||||
soundButton.onclick=()=>{soundOn=!soundOn;localStorage.setItem('alnode-sound',soundOn?'yes':'no');if(soundOn){prepareAudio();setTimeout(chime,60)}soundLabel()};document.addEventListener('pointerdown',()=>{if(soundOn)prepareAudio()},{once:true});
|
||||
const stack=document.createElement('div');stack.className='notification-stack';stack.setAttribute('aria-live','polite');document.body.append(stack);
|
||||
function arrival(kind,title,detail,ids=[]){const item=document.createElement('div');item.className='arrival-toast '+kind;item.innerHTML=`<span>${kind==='mail'?'✉':'▤'}</span><div><strong>${esc(title)}</strong><small>${esc(detail)}</small></div><button aria-label="Chiudi notifica">×</button>`;item.querySelector('button').onclick=e=>{e.stopPropagation();item.remove()};item.onclick=()=>{navigate('bbs');if(ids.length===1)readMessage(ids[0]);item.remove()};stack.append(item);while(stack.children.length>4)stack.firstChild.remove();setTimeout(()=>item.remove(),12000)}
|
||||
let knownIds;try{const saved=JSON.parse(localStorage.getItem('alnode-message-ids')||'null');knownIds=Array.isArray(saved)?new Set(saved):null}catch{knownIds=null}
|
||||
const oldLoadMessages=loadMessages;
|
||||
loadMessages=async function(){await oldLoadMessages();if(!csrf||!allMessages.length)return;const arrivals=incoming(allMessages,knownIds);const fresh=[...arrivals.bulletins,...arrivals.mail];knownIds=new Set(allMessages.map(m=>m.id));localStorage.setItem('alnode-message-ids',JSON.stringify([...knownIds]));if(fresh.length){const bulls=fresh.filter(m=>m.type==='B'),mail=fresh.filter(m=>m.type==='P'||m.type==='T');if(bulls.length)arrival('bulletin',bulls.length===1?'Nuovo bollettino scaricato':`${bulls.length} nuovi bollettini scaricati`,bulls.length===1?bulls[0].subject:'Disponibili nella BBS',bulls.map(m=>m.id));if(mail.length)arrival('mail',mail.length===1?'Nuova mail ricevuta':`${mail.length} nuove mail ricevute`,mail.length===1?'Da '+mail[0].from+' · '+mail[0].subject:'Disponibili nella posta personale',mail.map(m=>m.id));chime();}};
|
||||
setInterval(()=>{if(csrf)loadMessages()},15000);
|
||||
const chatNav=document.createElement('button');chatNav.dataset.page='chat';chatNav.innerHTML='<span>◇</span> Chat';chatNav.onclick=()=>navigate('chat');$('nav').append(chatNav);
|
||||
const chatPage=document.createElement('section');chatPage.id='chat';chatPage.className='page';chatPage.hidden=true;chatPage.innerHTML=`<div class="chat-heading"><h1>Chat</h1><div class="chat-actions"><span id="chat-state" class="chat-status">Disconnesso</span><button id="chat-connect" class="primary">Connetti</button><button id="chat-disconnect" class="secondary" hidden>Esci</button></div></div><div class="chat-layout"><aside class="chat-rooms"><div class="chat-label">STANZE<button id="new-topic" aria-label="Crea stanza">+</button></div><div id="chat-topics"><button class="room-button active"># General</button></div><div class="chat-links"><div class="chat-label">COLLEGAMENTI</div><div id="chat-links"></div></div></aside><div class="chat-main"><header class="chat-room-header"><b id="chat-room-name"># General</b><small id="chat-presence-count">— presenti</small></header><div id="chat-messages" class="chat-messages"><div class="chat-empty"><span>◇</span><h2>ALBCHT · IU2EUG-12</h2><p>Connettiti come IU2EUG per partecipare alla chat.</p></div></div><form id="chat-form" class="chat-compose"><div class="chat-recipient"><label for="chat-recipient">Destinatario</label><select id="chat-recipient"><option value="">Tutta la stanza</option></select></div><div class="chat-input-row"><input id="chat-input" aria-label="Messaggio chat" placeholder="Scrivi un messaggio…" maxlength="500" autocomplete="off" disabled><button id="chat-send" class="primary" disabled>Invia ↗</button></div></form></div><aside class="chat-users"><div class="chat-label">PRESENTI <span id="chat-user-count">0</span></div><div id="chat-users"><p class="empty">Non connesso</p></div></aside></div>`;$('main').append(chatPage);
|
||||
const topicDialog=document.createElement('dialog');topicDialog.innerHTML='<form id="topic-form"><h2>Crea o apri una stanza</h2><input id="topic-name" aria-label="Nome stanza" placeholder="Nome stanza" required pattern="[A-Za-z0-9_-]{1,24}" maxlength="24"><footer><button type="button" id="topic-cancel" class="secondary">Annulla</button><button class="primary">Entra</button></footer></form>';document.body.append(topicDialog);
|
||||
const oldNavigate=navigate;navigate=function(next){oldNavigate(next);$('#breadcrumb').textContent='Stazione / '+({home:'Panoramica',bbs:'BBS',network:'Rete',chat:'Chat',winlink:'Winlink'}[next]);if(next==='chat')pollChat();window.scrollTo({top:0,behavior:'instant'})};
|
||||
let chatFollowing=true,chatUnread=0,chatScrolling=false;
|
||||
const chatArea=$('#chat-messages');chatArea.tabIndex=0;chatArea.setAttribute('aria-label','Conversazione chat');
|
||||
const chatJump=document.createElement('button');chatJump.id='chat-jump';chatJump.className='chat-jump';chatJump.hidden=true;chatJump.type='button';chatJump.setAttribute('aria-label','Vai agli ultimi messaggi');$('.chat-main').insertBefore(chatJump,$('#chat-form'));
|
||||
function updateChatJump(){chatJump.hidden=chatFollowing;chatJump.textContent=chatUnread?`${chatUnread} ${chatUnread===1?'nuovo messaggio':'nuovi messaggi'} ↓`:'Ultimi messaggi ↓';}
|
||||
function chatToBottom(){if(page!=='chat')return;chatFollowing=true;chatUnread=0;chatScrolling=true;updateChatJump();requestAnimationFrame(()=>{chatArea.scrollTop=chatArea.scrollHeight;requestAnimationFrame(()=>{chatScrolling=false;});});}
|
||||
chatJump.onclick=chatToBottom;
|
||||
chatArea.addEventListener('scroll',()=>{if(chatScrolling||page!=='chat')return;chatFollowing=chatArea.scrollHeight-chatArea.scrollTop-chatArea.clientHeight<64;if(chatFollowing)chatUnread=0;updateChatJump();},{passive:true});
|
||||
new ResizeObserver(()=>{if(chatFollowing&&page==='chat')chatToBottom();}).observe(chatArea);
|
||||
const navigateWithChat=navigate;navigate=function(next){navigateWithChat(next);if(next==='chat'){if(chatFollowing)chatToBottom();else updateChatJump();}};
|
||||
function renderChat(data){
|
||||
chatState=data.state;const online=data.state==='online';
|
||||
$('#chat-state').className='chat-status '+data.state;$('#chat-state').textContent=({offline:'Disconnesso',connecting:'Connessione…',online:'● Connesso · IU2EUG',error:'Connessione interrotta'}[data.state]);$('#chat-connect').hidden=online;$('#chat-connect').disabled=data.state==='connecting';$('#chat-disconnect').hidden=!online;$('#chat-input').disabled=!online;$('#chat-send').disabled=!online;$('#chat-input').placeholder=online?'Scrivi alla stanza…':'Connettiti per scrivere…';
|
||||
$('#chat-room-name').textContent='# '+data.topic;$('#chat-presence-count').textContent=online?data.users.filter(u=>u.topic.toLowerCase()===data.topic.toLowerCase()).length+' nella stanza':'Non connesso';$('#chat-user-count').textContent=online?data.users.length:'—';
|
||||
$('#chat-users').innerHTML=online?data.users.map(u=>`<button class="chat-user" data-call="${esc(u.call)}" title="${esc(u.qth)}" aria-label="Messaggio privato a ${esc(u.call)}"><span class="chat-avatar">${esc(u.call.slice(0,2))}</span><div><b>${esc(u.call)}</b><div class="chat-user-name">${esc(u.name)}</div><small>${esc(u.node)} · ${esc(u.topic)}</small></div><span class="presence-dot ${u.idle>300?'idle':''}" title="${u.idle>300?'Inattivo':'Attivo'}"></span></button>`).join('')||'<p class="empty">Nessun utente rilevato</p>':'<p class="chat-offline-note">Connettiti per vedere chi è presente.</p>';
|
||||
const recipient=$('#chat-recipient').value;$('#chat-recipient').innerHTML='<option value="">Tutta la stanza</option>'+data.users.filter(u=>u.call!=='IU2EUG').map(u=>`<option value="${esc(u.call)}">Privato · ${esc(u.call)}</option>`).join('');$('#chat-recipient').value=recipient;if(!$('#chat-recipient').value)$('#chat-recipient').value='';$('#chat-recipient').disabled=!online;if(online&&$('#chat-recipient').value)$('#chat-input').placeholder='Messaggio privato a '+$('#chat-recipient').value+'…';
|
||||
$$('.chat-user').forEach(b=>b.onclick=()=>{$('#chat-recipient').value=b.dataset.call==='IU2EUG'?'':b.dataset.call;$('#chat-input').placeholder=b.dataset.call==='IU2EUG'?'Scrivi alla stanza…':'Messaggio privato a '+b.dataset.call+'…';$('#chat-input').focus();});
|
||||
$('#chat-topics').innerHTML=[...new Set(['General',...data.topics,data.topic])].map(t=>`<button class="room-button ${t.toLowerCase()===data.topic.toLowerCase()?'active':''}" data-topic="${esc(t)}"># ${esc(t)}</button>`).join('');
|
||||
$$('[data-topic]').forEach(b=>b.onclick=async()=>{try{await api('/chat/topic',{method:'POST',body:JSON.stringify({topic:b.dataset.topic})});chatFollowing=true;chatUnread=0;pollChat();}catch(e){toast(e.message);}});
|
||||
$('#chat-links').innerHTML=online?data.links.map(l=>`<div class="chat-link"><span>${esc(l.call)}</span><span class="${l.state==='Open'?'open':'closed'}">${l.state==='Open'?'Attivo':'Non attivo'}</span></div>`).join('')||'<div class="chat-link">—</div>':'<div class="chat-link">Non connesso</div>';
|
||||
const events=data.events.filter(e=>e.id>chatLastId),initial=chatLastId===0;
|
||||
if(events.length){if(chatArea.querySelector('.chat-empty'))chatArea.replaceChildren();const fragment=document.createDocumentFragment();let added=0;
|
||||
for(const event of events){chatLastId=Math.max(chatLastId,event.id);if(event.type==='system'&&/^[A-Z0-9]{3,6}(?:\s+[A-Z0-9]{3,6})*$/.test(event.text))continue;
|
||||
const element=document.createElement('div');if(event.type==='message'&&!/\*\*\* (?:Joined|Left)/i.test(event.text)){element.className='chat-event '+(event.sender==='IU2EUG'?'own':'')+(event.to?' private':'');element.innerHTML=`<div class="chat-avatar">${esc(event.sender?.slice(0,2)||'?')}</div><div class="chat-message-content"><div class="chat-message-meta"><strong>${esc(event.sender)}${event.to?` <span class="chat-private-label">→ ${esc(event.to)} · privato</span>`:''}</strong><time datetime="${esc(event.at)}" title="${esc(new Date(event.at).toLocaleString('it-IT',{timeZone:'Europe/Rome'}))}">${new Date(event.at).toLocaleTimeString('it-IT',{hour:'2-digit',minute:'2-digit'})}</time></div><p>${esc(event.text)}</p></div>`;added++;}else{element.className='chat-system';element.textContent=(event.sender?event.sender+' · ':'')+event.text;}fragment.append(element);}
|
||||
chatArea.append(fragment);while(chatArea.children.length>300)chatArea.firstChild.remove();
|
||||
if(initial||chatFollowing||events.some(e=>e.sender==='IU2EUG'&&e.type==='message')){chatFollowing=true;if(page==='chat')chatToBottom();}else{chatUnread+=added;updateChatJump();}
|
||||
}
|
||||
}
|
||||
|
||||
async function pollChat(){if(!csrf||chatPollBusy)return;chatPollBusy=true;try{renderChat(await api('/chat'))}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)}};
|
||||
setInterval(()=>{if(csrf&&(page==='chat'||chatState==='online'||chatState==='connecting'))pollChat()},2000);
|
||||
|
||||
const presenceButton=document.createElement('button');presenceButton.className='secondary mobile-presence';presenceButton.textContent='Utenti';presenceButton.setAttribute('aria-expanded','false');presenceButton.onclick=()=>{const open=$('.chat-layout').classList.toggle('users-open');presenceButton.setAttribute('aria-expanded',String(open))};$('.chat-actions').prepend(presenceButton);
|
||||
|
||||
$('#chat-recipient').addEventListener('change',()=>{$('#chat-input').placeholder=$('#chat-recipient').value?'Messaggio privato a '+$('#chat-recipient').value+'…':'Scrivi alla stanza…';});
|
||||
if(location.hash==='#chat')navigate('chat');
|
||||
|
||||
window.addEventListener('DOMContentLoaded',()=>{for(const target of ['#bbs .mail-list-heading','#winlink .mail-list-heading']){const heading=$(target);if(heading){const tag=document.createElement('small');tag.className='mail-timezone';tag.textContent='Timezone: '+mailTimezone();heading.append(tag);}}});
|
||||
|
||||
function restoreMailPage(){const target=location.hash.slice(1);if(['home','bbs','winlink','chat','network','monitor'].includes(target)&&page!==target&&document.getElementById(target))navigate(target);}
|
||||
window.addEventListener('DOMContentLoaded',restoreMailPage);window.addEventListener('hashchange',restoreMailPage);
|
||||
@@ -0,0 +1,19 @@
|
||||
<!doctype html>
|
||||
<html lang="it"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#101916"><title>ALNODE — Radio & BBS</title><link rel="stylesheet" href="/style.css"><link rel="stylesheet" href="/dark.css"><link rel="stylesheet" href="/mission.css"><script defer src="/app.js"></script><script type="module" src="/enhancements.js"></script><script defer src="/winlink.js"></script><script defer src="/mission.js"></script><script defer src="/attachments.js"></script><link rel="stylesheet" href="/monitor.css"><script defer src="/monitor.js"></script></head>
|
||||
<body>
|
||||
<section id="login" class="login-screen"><div class="login-art"><span class="eyebrow">SENAGO · JN45NN</span><h1>ALNODE<br><em>Radio Console</em></h1><div class="signal-art"><i></i><i></i><i></i><i></i><b>IU2EUG</b></div><p>IU2EUG · Senago · JN45NN</p></div><form id="login-form" class="login-card"><span class="brand">◉ ALNODE<span>CONSOLE</span></span><h2>Benvenuto in stazione.</h2><p>Accedi con l’utente e la password Telnet del tuo BPQ.</p><label>Utente<input name="user" autocomplete="username" required placeholder="Il tuo utente BPQ"></label><label>Password<input name="password" type="password" autocomplete="current-password" required></label><button class="primary" type="submit">Entra nel pannello <span>→</span></button><div id="login-error" class="error" role="alert"></div><small>Accesso sysop IU2EUG · PC e rete locale</small></form></section>
|
||||
<div id="shell" hidden><aside class="sidebar"><a class="brand" href="#home">◉ ALNODE<span>RADIO CONSOLE</span></a><div class="side-label">LA TUA STAZIONE</div><nav><button data-page="home" class="active"><span>▦</span> Panoramica</button><button data-page="bbs"><span>▤</span> BBS <b id="nav-count">—</b></button><button data-page="network"><span>⌘</span> Rete & nodi</button></nav><div class="side-station"><span class="dot"></span> IU2EUG-7<small>Senago, Italia · JN45NN</small><div class="side-frequency">40 m <span>7.050 MHz</span><br>20 m <span>14.122 MHz</span></div><small>USB · VARA HF 2300<br>07:00 — 00:00 · Roma</small></div><div class="profile"><div class="avatar">AE</div><div>Alberto<small>IU2EUG · Sysop</small></div><button id="logout" title="Esci" aria-label="Esci dal pannello">↗</button></div></aside>
|
||||
<main><header class="topbar"><span id="breadcrumb">Stazione / Panoramica</span><div><span id="connection" class="live-badge">● Collegamento…</span><button id="refresh" class="icon-button" aria-label="Aggiorna dati">↻</button><span id="clock"></span></div></header><div id="notice" hidden class="notice" role="status"></div>
|
||||
<section id="home" class="page"><div class="page-heading"><div><span class="eyebrow">IL TUO PUNTO SULLA RETE</span><h1>Panoramica</h1><p>Radio, messaggi e collegamenti. Tutto nello stesso posto.</p></div><button class="primary compose-button">+ Nuovo messaggio</button></div>
|
||||
<div class="metrics"><article><span>Messaggi nella BBS</span><strong id="k-messages">—</strong><small id="k-message-detail">In attesa di BPQ</small><i>▤</i></article><article><span>Nodi conosciuti</span><strong id="k-nodes">—</strong><small>Destinazioni NET/ROM</small><i>⌘</i></article><article><span>Collegamenti attivi</span><strong id="k-routes">—</strong><small>Vicini sulla rete AXUDP</small><i>↔</i></article><article><span>Ultimo sync BBS</span><strong id="k-sync">—</strong><small id="k-sync-detail">Nessuno rilevato oggi</small><i>↻</i></article></div>
|
||||
<div class="overview-grid"><article class="radio-card"><div class="card-header"><span class="eyebrow">ON AIR / FT-991A</span><span id="radio-status" class="tag">—</span></div><div class="radio-frequency"><span id="radio-freq">—</span><small>MHz / USB</small></div><div class="waveform" aria-hidden="true"></div><div class="radio-details"><div><span>Modem</span><b id="radio-modem">—</b></div><div><span>Canale</span><b id="radio-channel">—</b></div><div><span>S/N ultima sessione</span><b id="radio-snr">—</b></div></div><footer><span id="radio-scan">—</span><span>40 m ↔ 20 m</span></footer></article>
|
||||
<article class="card services-card"><div class="card-header"><h2>Servizi della stazione</h2><span class="muted">IU2EUG</span></div><button data-page="bbs" class="service"><span class="service-icon">▤</span><div><b>BBS & bollettini</b><small>Leggi, scrivi e condividi via radio</small></div><span class="service-call">IU2EUG-11 ↗</span></button><div class="service"><span class="service-icon">◇</span><div><b>Chat di rete</b><small>Accesso dal nodo con CHAT</small></div><span class="service-call">IU2EUG-12</span></div><div class="service"><span class="service-icon">↗</span><div><b>Gateway Winlink</b><small>Posta radio verso il CMS</small></div><span class="service-call">IU2EUG</span></div><div class="service"><span class="service-icon">⌘</span><div><b>Nodo interattivo</b><small>NET/ROM, ARICHAT e DX Cluster</small></div><span class="service-call">IU2EUG-7</span></div></article></div>
|
||||
<div class="bottom-grid"><article class="card"><div class="card-header"><h2>Arrivati nella BBS</h2><button data-page="bbs" class="text-button">Apri BBS →</button></div><div id="recent-list" class="recent-list"></div></article><article class="card"><div class="card-header"><h2>Attività forwarding</h2><span class="tag">OGGI</span></div><div id="activity-list" class="activity-list"></div><button id="sync-open" class="secondary full">↻ Sincronizza con IW2OHX</button></article></div>
|
||||
<footer class="page-footer">ALNODE · IU2EUG · Senago <span id="updated">—</span></footer></section>
|
||||
<section id="bbs" class="page" hidden><div class="page-heading"><div><span class="eyebrow">ALBBS / IU2EUG-11</span><h1>BBS</h1><p>Bollettini dalla rete e messaggi personali, finalmente leggibili.</p></div><button class="primary compose-button">+ Nuovo messaggio</button></div><div class="mail-toolbar"><div class="tabs"><button class="active" data-filter="all">Tutti</button><button data-filter="B">Bollettini</button><button data-filter="P">Personali</button><button data-filter="sent">Inviati</button></div><input id="search" type="search" placeholder="Cerca oggetto, nominativo o categoria…" aria-label="Cerca messaggi"><select id="category" aria-label="Categoria"><option value="">Tutte le categorie</option></select></div><div class="mail-layout"><div class="card mail-list"><div class="mail-list-heading"><span id="list-count">— messaggi</span><span>Più recenti prima</span></div><div class="mail-columns" aria-hidden="true"><span></span><span>Da</span><span>Oggetto</span><span>Categoria</span><span>Ricevuto · data e ora</span><span>Dimensione</span><span>Stato</span></div><div id="message-list" class="mail-rows"></div></div><article class="card reader" id="reader"><div class="reader-empty"><span>▤</span><h2>Una finestra sulla rete.</h2><p>Scegli un messaggio per leggerlo qui.</p></div></article></div></section>
|
||||
<section id="network" class="page" hidden><div class="page-heading"><div><span class="eyebrow">AXUDP / NET-ROM</span><h1>Rete</h1><p>Collegamenti Internet e destinazioni annunciate al tuo nodo.</p></div></div><article class="card"><div class="card-header"><h2>Rotte verso i vicini</h2><span class="tag">DATI BPQ</span></div><div class="table-wrap"><table><thead><tr><th>Nodo</th><th>Stato</th><th>Porta</th><th>Qualità</th><th>Destinazioni</th><th>Frame</th><th>Retry</th></tr></thead><tbody id="routes"></tbody></table></div></article><article class="card nodes-card"><div class="card-header"><h2>Destinazioni conosciute</h2><span id="node-total" class="muted"></span></div><div id="nodes" class="node-grid"></div></article><p class="network-note">Le tabelle viaggiano su AXUDP. Il forwarding BBS con IW2OHX usa invece VARA HF.</p></section>
|
||||
</main></div>
|
||||
<dialog id="compose"><form id="compose-form"><div class="dialog-heading"><div><span class="eyebrow">ALBBS / IU2EUG</span><h2>Nuovo messaggio</h2></div><button type="button" class="icon-button close-compose" aria-label="Chiudi">×</button></div><div class="compose-row"><label>Destinatario<input name="to" required maxlength="80" placeholder="IW2OHX oppure [email protected]"></label><label>Tipo<select name="type"><option value="P">Messaggio personale</option><option value="B">Bollettino</option></select></label></div><label>Oggetto<input name="subject" required maxlength="80" placeholder="Di cosa vuoi parlare?"></label><label>Messaggio<textarea name="text" required rows="11" placeholder="Scrivi il tuo messaggio…"></textarea></label><p class="compose-help">Il messaggio sarà salvato nella BBS come IU2EUG. L’inoltro segue le rotte configurate in BPQ.</p><div id="compose-error" class="error" role="alert"></div><footer><button type="button" class="secondary close-compose">Annulla</button><button id="send-button" class="primary" type="submit">Salva e metti in coda →</button></footer></form></dialog>
|
||||
<dialog id="sync-dialog"><h2>Chiamare IW2OHX via radio?</h2><p>BPQ eseguirà il profilo di forwarding sui 20 metri. Questo comando avvia una trasmissione radio e usa i parametri configurati, incluso OVERRIDEBUSY.</p><footer><button class="secondary" id="sync-cancel">Annulla</button><button class="primary" id="sync-confirm">Avvia chiamata</button></footer></dialog>
|
||||
<div id="toast" role="status" hidden></div>
|
||||
</body></html>
|
||||
@@ -0,0 +1,33 @@
|
||||
#home{background:radial-gradient(ellipse at 35% 0%,#172a4033,transparent 60%)}.mission-heading{display:flex;justify-content:space-between;align-items:center;margin:8px 0 31px;gap:20px}.mission-kicker{color:#6f9fce;font-size:9px;letter-spacing:3px;font-weight:600}.mission-heading h1{font:500 35px/1.3 Consolas,monospace;letter-spacing:1px;margin-top:10px;color:#e4edf7}.mission-heading h1 span{font-size:19px;color:#627c98}.mission-location{font:10px Consolas,monospace;color:#9eb4cc;text-align:right;letter-spacing:.7px}.mission-location small{display:block;color:#596e86;font-size:9px;margin-top:12px}.overview-grid{grid-template-columns:1.5fr 1fr}.radio-card{background:linear-gradient(150deg,#132336,#101a29 65%,#141e30);border-color:#304861;box-shadow:0 18px 50px #0003,0 0 60px #274b7220}.modem-top{display:flex;align-items:center;justify-content:space-between;padding:21px 24px;border-bottom:1px solid #2a3b4f}.modem-brand{font-size:18px;font-weight:700;letter-spacing:4px;color:#d6e6f5}.modem-brand small{font-size:9px;letter-spacing:1.2px;color:#7991ab;margin-left:10px;font-weight:400}.modem-session{padding:27px 24px 23px;background:radial-gradient(ellipse at 50% 10%,#395b8527,transparent 80%);border-bottom:1px solid #2a3b4f}.session-label{font-size:9px;letter-spacing:2.5px;color:#81a6c9}.callsign-pair{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:19px 0 12px}.callsign-pair b{font:500 clamp(20px,2.5vw,35px) Consolas,monospace;letter-spacing:.5px;text-shadow:0 0 25px #75b8e940;color:#deedfa}.callsign-pair>span{font-size:25px;color:#688aae}.modem-session.connected .session-label{color:#a7d3bd}.modem-session.connected .callsign-pair b{color:#c7f0df;text-shadow:0 0 24px #76d3a752}.modem-session.idle .callsign-pair b:last-child{color:#557494}.modem-session #session-detail{font-size:10px;color:#657e99;letter-spacing:.5px}.modem-frequency{display:flex;align-items:center;gap:17px;padding:15px 24px}.modem-frequency>div{margin-right:auto}.modem-frequency #radio-freq{font:28px Consolas,monospace;color:#c0d9ee}.modem-frequency small{font-size:9px;color:#6d8aa7;margin-left:9px}.modem-frequency>span{font-size:9px;color:#7c9cb8}.telemetry-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#2b3b4d;border-top:1px solid #2b3b4d;border-bottom:1px solid #2b3b4d}.telemetry-grid article{background:#111c2b;padding:14px 17px 0;min-width:0}.telemetry-grid article header{display:flex;justify-content:space-between;align-items:center;gap:10px}.telemetry-grid header>span{font-size:8px;letter-spacing:1.1px;color:#7a91a9}.telemetry-grid header b{font:16px Consolas,monospace;font-weight:400;color:#b7d6f0}.telemetry-grid header b small{font-size:8px;color:#7290ad}.telemetry-chart{height:68px;margin-top:10px}.telemetry-chart svg{width:100%;height:100%;overflow:visible}.graph-line{fill:none;stroke:#8fbce5;stroke-width:1.8;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 0 3px #95bfe54a)}.graph-line.line-1{stroke:#91cbb4}.graph-grid{stroke:#284057;stroke-width:.5;stroke-dasharray:3 7;fill:none}.telemetry-grid article footer{padding:8px 0 10px;border:0;display:flex;justify-content:initial;gap:10px;color:#5e7690;font-size:8px}.telemetry-grid article footer span:last-child{margin-left:auto}.tx-key{color:#8fbce5!important}.rx-key{color:#91cbb4!important}.graph-empty{height:100%;display:grid;place-items:center;font-size:9px;color:#526b85}.modem-bottom{display:flex;justify-content:space-between;gap:10px;padding:13px 20px;font-size:8px;color:#6e86a0}.modem-bottom b{color:#9eb7d1;font-weight:400}.services-card{align-self:stretch;background:linear-gradient(180deg,#151f2c,#101720)}.services-card .card-header{padding:23px}.services-card .service{padding:24px 22px;background:transparent}.services-card .service-icon{width:40px;height:40px;border-radius:11px}.services-card .service b{font-size:13px}.services-card .service small{font-size:10px;line-height:1.7;margin-top:7px}.metrics article{background:linear-gradient(135deg,#192433,#121923);border-color:#293c52;box-shadow:0 8px 25px #0002}.metrics strong{font-family:Consolas,monospace;color:#cadff2}.metrics i{color:#4d749a}.card{border-color:#29384a}.live-badge{box-shadow:0 0 15px #669dce15}@media(max-width:1150px){.overview-grid{grid-template-columns:1fr}.services-card .service{padding:18px 22px}.callsign-pair b{font-size:32px}}@media(max-width:600px){.mission-heading{align-items:flex-start;gap:12px}.mission-heading h1{font-size:29px}.mission-heading h1 span{display:block;font-size:13px;margin-top:6px}.mission-location{font-size:8px;margin-top:10px}.mission-location small{font-size:7px}.modem-frequency{gap:12px;flex-wrap:wrap}.modem-frequency>span{font-size:8px}.callsign-pair b{font-size:23px}.modem-bottom{flex-wrap:wrap;font-size:8px}.telemetry-grid header b{font-size:14px}.telemetry-grid article{padding:12px 12px 0}}
|
||||
.callsign-pair>div{display:flex;flex-direction:column;gap:11px}.callsign-pair>div:last-child{text-align:right}.callsign-pair small{font-size:8px;letter-spacing:1.5px;color:#617d9b}.modem-session.idle .callsign-pair>div:first-child b{color:#deedfa}.modem-session.connected .callsign-pair small{color:#7daa9b}
|
||||
@media(min-width:1200px) and (min-height:820px){
|
||||
body:has(#home:not([hidden])) .topbar{height:64px}
|
||||
#home{height:calc(100dvh - 64px);max-width:none;display:grid;grid-template-rows:56px 100px minmax(380px,1fr) minmax(100px,.42fr) 14px;gap:14px;padding:18px 28px 14px}
|
||||
#home .mission-heading,#home .metrics,#home .overview-grid,#home .page-footer{margin:0}
|
||||
#home .mission-heading h1{font-size:28px;margin-top:6px}
|
||||
#home .metrics article{min-height:0;padding:15px 20px}
|
||||
#home .metrics strong{font-size:27px;margin:7px 0 3px}
|
||||
#home .overview-grid,#home .bottom-grid{min-height:0;gap:18px}
|
||||
#home .radio-card{display:flex;flex-direction:column;min-height:0}
|
||||
#home .modem-top{padding:13px 20px;flex-shrink:0}
|
||||
#home .modem-session{padding:15px 20px 12px;flex-shrink:0}
|
||||
#home .callsign-pair{margin:11px 0 8px}
|
||||
#home .callsign-pair>div{gap:7px}
|
||||
#home .callsign-pair b{font-size:32px}
|
||||
#home .modem-frequency{padding:10px 20px;flex-shrink:0}
|
||||
#home .telemetry-grid{flex:1;min-height:0;grid-template-rows:1fr 1fr}
|
||||
#home .telemetry-grid article{display:flex;flex-direction:column;padding:10px 16px 0;min-height:0}
|
||||
#home .telemetry-chart{flex:1;min-height:20px;height:auto;margin-top:6px}
|
||||
#home .telemetry-grid article footer{padding:5px 0 7px;flex-shrink:0}
|
||||
#home .modem-bottom{padding:9px 18px;flex-shrink:0}
|
||||
#home .services-card{display:flex;flex-direction:column;min-height:0}
|
||||
#home .services-card .card-header{padding:16px 20px;flex-shrink:0}
|
||||
#home .services-card .service{flex:1;padding:10px 20px;min-height:0}
|
||||
#home .bottom-grid>.card{display:flex;flex-direction:column;min-height:0}
|
||||
#home .bottom-grid .card-header{padding:12px 18px;flex-shrink:0}
|
||||
#home .bottom-grid .card-header h2{font-size:14px}
|
||||
#home .recent-list,#home .activity-list{flex:1;min-height:0;overflow:auto;height:auto}
|
||||
#home .recent-item{padding:10px 18px}
|
||||
#home .bottom-grid .full{padding:8px;width:calc(100% - 36px);margin:7px 18px 10px;flex-shrink:0}
|
||||
#home .page-footer{font-size:8px;align-items:center}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
let modemTelemetry=null,modemPolling=false;
|
||||
const radioCard=$('.radio-card');radioCard.innerHTML=`<div class="modem-top"><span class="modem-brand">VARA <small>HF / FT-991A</small></span><span id="radio-status" class="tag">—</span></div><div id="modem-session" class="modem-session idle"><span class="session-label" id="session-label">STAZIONE IN ASCOLTO</span><div class="callsign-pair"><div><small id="caller-label">NODO LOCALE</small><b id="caller-call">IU2EUG</b></div><span id="call-arrow">◉</span><div><small id="called-label">ALIAS</small><b id="called-call">ALNODE</b></div></div><div id="session-detail">40 m / 20 m · USB</div></div><div class="modem-frequency"><div><span id="radio-freq">—</span><small>MHz</small></div><span id="radio-scan">—</span><span id="radio-channel">—</span></div><div class="telemetry-grid"><article><header><span>BITRATE VARA</span><b><span id="bps-value">—</span><small> bit/s</small></b></header><div id="bps-chart" class="telemetry-chart"></div><footer><span class="tx-key">TX</span><span class="rx-key">RX</span><span id="bps-caption">Velocità del modem</span></footer></article><article><header><span>SNR / BPQ</span><b id="snr-value">—</b></header><div id="snr-chart" class="telemetry-chart"></div><footer><span id="snr-caption">Campioni durante le connessioni</span></footer></article><article><header><span>CPU VARA</span><b id="vara-cpu-value">—</b></header><div id="vara-cpu-chart" class="telemetry-chart"></div><footer><span>Processo modem · ogni 5 s</span></footer></article><article><header><span>CPU SISTEMA</span><b id="system-cpu-value">—</b></header><div id="system-cpu-chart" class="telemetry-chart"></div><footer><span>Carico totale del PC</span></footer></article></div><div class="modem-bottom"><span id="radio-modem">VARA HF 2300</span><span>SNR ultima sessione <b id="radio-snr">—</b></span><span id="modem-traffic">TX — / RX —</span></div>`;
|
||||
const missionHead=document.createElement('div');missionHead.className='mission-heading';missionHead.innerHTML='<div><span class="mission-kicker">RADIO OPERATIONS</span><h1>IU2EUG<span> / ALNODE</span></h1></div><div class="mission-location"><span class="dot"></span> SENAGO · JN45NN <small>07:00 — 00:00 ROMA</small></div>';
|
||||
$('#home .page-heading').replaceWith(missionHead);
|
||||
function graph(history,keys,id,minimum=1){const width=350,height=85,pad=5;const values=history.flatMap(s=>keys.map(k=>s[k])).filter(v=>typeof v==='number'&&Number.isFinite(v));if(!values.length)return '<div class="graph-empty">Nessun campione disponibile</div>';const min=Math.min(0,...values),max=Math.max(minimum,...values),range=max-min||1;const x=i=>pad+i*(width-pad*2)/Math.max(1,history.length-1),y=v=>height-pad-(v-min)*(height-pad*2)/range;const lines=keys.map((key,j)=>{let path='',breakLine=true;history.forEach((s,i)=>{const value=s[key];if(typeof value!=='number'||!Number.isFinite(value)){breakLine=true;return;}path+=(breakLine?'M':'L')+x(i).toFixed(2)+' '+y(value).toFixed(2)+' ';breakLine=false;});return `<path class="graph-line line-${j}" d="${path}"/>`}).join('');return `<svg viewBox="0 0 ${width} ${height}" preserveAspectRatio="none" role="img" aria-label="Grafico ${esc(id)}"><path class="graph-grid" d="M0 20 H350 M0 45 H350 M0 70 H350"/>${lines}</svg>`;}
|
||||
function renderTelemetry(data){modemTelemetry=data;const c=data.current;if(!c)return;const history=data.history.slice(-120);$('#radio-status').textContent=!c.available?'OFFLINE':c.active?'LINK ATTIVO':'IN ASCOLTO';$('#modem-session').classList.toggle('idle',!c.active);$('#modem-session').classList.toggle('connected',!!c.active);$('#session-label').textContent=c.connecting?'CHIAMATA IN CORSO':c.active?'CONNESSIONE RADIO':'STAZIONE IN ASCOLTO';$('#caller-call').textContent=c.active?c.caller||'—':'IU2EUG';$('#called-call').textContent=c.active?c.called||'—':'ALNODE';$('#call-arrow').textContent=c.active?'→':'◉';$('#caller-label').textContent=c.active?'CHIAMANTE':'NODO LOCALE';$('#called-label').textContent=c.active?'CHIAMATO':'ALIAS';$('#session-detail').textContent=c.active?(c.connecting?'Attendo risposta':/^IU2EUG/i.test(c.caller||'')?'Chiamata in uscita':'Chiamata in ingresso'):'VARA HF · scansione 40 / 20 metri';$('#radio-freq').textContent=c.frequency||'—';$('#radio-scan').textContent=c.scan?'● Scansione attiva':c.active?'● Frequenza bloccata':'—';$('#radio-channel').textContent=c.available?(c.busy?'Canale occupato':'Canale libero'):'—';$('#radio-modem').textContent=c.available?'VARA HF 2300':'Modem non disponibile';$('#radio-snr').textContent=c.lastSnr!=null?c.lastSnr.toFixed(1)+' dB':'—';$('#bps-value').textContent=c.nativeRate?.bps!=null?Math.round(c.nativeRate.bps).toLocaleString('it-IT'):c.available&&!c.active?'0':'—';$('#bps-caption').textContent=!c.nativeRate?.listening?'Telemetria VARA non disponibile':!c.active?'In attesa della connessione':c.nativeRate?.bps==null?'In attesa del bitrate VARA':(c.nativeRate.direction||'Modem')+(c.nativeRate.level?' · livello '+c.nativeRate.level:'');$('#snr-value').textContent=c.snr!=null?c.snr.toFixed(1)+' dB':'—';$('#vara-cpu-value').textContent=c.varaCpu!=null?c.varaCpu.toFixed(1)+'%':'—';$('#system-cpu-value').textContent=c.cpu!=null?c.cpu.toFixed(1)+'%':'—';$('#snr-caption').textContent=c.active?'SNR esposto da BPQ':'In attesa della prossima connessione';$('#modem-traffic').textContent='TX '+size(c.sent||0)+' / RX '+size(c.received||0);$('#bps-chart').innerHTML=graph(history,['varaTxBps','varaRxBps'],'bitrate VARA TX RX',100);$('#snr-chart').innerHTML=graph(history,['snr'],'SNR',10);$('#vara-cpu-chart').innerHTML=graph(history,['varaCpu'],'CPU VARA',5);$('#system-cpu-chart').innerHTML=graph(history,['cpu'],'CPU sistema',10);}
|
||||
async function pollTelemetry(){if(!csrf||modemPolling)return;modemPolling=true;try{renderTelemetry(await api('/telemetry'))}catch{}finally{modemPolling=false}}
|
||||
const missionDashboard=loadDashboard;loadDashboard=async function(){await missionDashboard();if(modemTelemetry)renderTelemetry(modemTelemetry);pollTelemetry();};setInterval(()=>{if(csrf&&!document.hidden)pollTelemetry()},2000);pollTelemetry();
|
||||
const fullscreenButton=document.createElement('button');fullscreenButton.id='fullscreen-toggle';fullscreenButton.className='icon-button';fullscreenButton.textContent='⛶';fullscreenButton.setAttribute('aria-label','Schermo intero');fullscreenButton.title='Schermo intero';$('#refresh').after(fullscreenButton);
|
||||
fullscreenButton.onclick=async()=>{try{if(document.fullscreenElement)await document.exitFullscreen();else await document.documentElement.requestFullscreen();}catch{toast('Schermo intero non disponibile in questo browser. Prova F11.');}};
|
||||
document.addEventListener('fullscreenchange',()=>{const active=!!document.fullscreenElement;fullscreenButton.textContent=active?'⊡':'⛶';fullscreenButton.title=active?'Torna alla finestra':'Schermo intero';fullscreenButton.setAttribute('aria-label',fullscreenButton.title);fullscreenButton.setAttribute('aria-pressed',String(active));});
|
||||
@@ -0,0 +1 @@
|
||||
.monitor-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}.monitor-heading h1{margin:0}.monitor-heading>div{display:flex;align-items:center;gap:12px}.monitor-tools{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:16px}.monitor-tools label{font-size:11px;color:#95a2b8;display:grid;gap:7px}.monitor-tools select{min-width:130px;max-width:290px}.monitor-tools input[type=search]{flex:1;min-width:160px}.monitor-console{height:calc(100dvh - 310px);min-height:360px;overflow:auto;background:#090e18;border:1px solid #253247;border-radius:14px;padding:16px;scrollbar-color:#334155 #090e18}.monitor-frame{display:grid;grid-template-columns:75px minmax(0,1fr);gap:16px;padding:11px 0;border-bottom:1px solid #182133}.monitor-frame>div{display:flex;gap:7px;align-items:start;font:11px ui-monospace,Consolas,monospace;padding-top:2px}.monitor-direction{padding:2px 4px;border-radius:4px;background:#0d302c;color:#73ddc2}.monitor-frame.tx .monitor-direction{background:#182d50;color:#90baff}.monitor-port{color:#8593ac;padding-top:2px}.monitor-frame pre{font:12px/1.6 ui-monospace,Consolas,monospace;color:#bed7ce;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.monitor-frame.tx pre{color:#a8c6f2}.monitor-footer{display:flex;justify-content:space-between;align-items:center;gap:15px;font-size:11px;color:#8a99b0;padding-top:14px}.monitor-footer label{display:flex;gap:7px;align-items:center}.monitor-footer input{width:auto}.monitor-empty{color:#8292aa;font-size:13px;padding:18px}.monitor-tools button{white-space:nowrap}@media(max-width:900px){.monitor-heading{gap:10px;flex-wrap:wrap}.monitor-tools input[type=search]{flex-basis:100%}.monitor-console{height:60dvh}.monitor-footer{flex-wrap:wrap}.monitor-frame{grid-template-columns:60px minmax(0,1fr);gap:10px}}
|
||||
@@ -0,0 +1,19 @@
|
||||
(() => {
|
||||
const nav=document.createElement('button');nav.dataset.page='monitor';nav.innerHTML='<span>≋</span> Monitor';nav.onclick=()=>navigate('monitor');$('nav').append(nav);
|
||||
const section=document.createElement('section');section.id='monitor';section.className='page';section.hidden=true;section.innerHTML=`<div class="monitor-heading"><h1>Monitor</h1><div><span id="monitor-state" class="chat-status">Disconnesso</span><button id="monitor-connect" class="primary">Avvia monitor</button><button id="monitor-stop" class="secondary" hidden>Ferma</button></div></div><div class="monitor-tools"><label>Porta<select id="monitor-port"><option value="">Tutte le porte</option></select></label><label>Direzione<select id="monitor-direction"><option value="">RX + TX</option><option>RX</option><option>TX</option></select></label><input id="monitor-search" type="search" placeholder="Cerca nominativo o testo…" aria-label="Cerca nel traffico"><button id="monitor-pause" class="secondary">Pausa</button><button id="monitor-clear" class="secondary">Pulisci</button><button id="monitor-export" class="secondary">Scarica registro</button></div><div class="monitor-console" id="monitor-console" tabindex="0" aria-label="Traffico BPQ"><p class="monitor-empty">Avvia il monitor per seguire il traffico BPQ.</p></div><footer class="monitor-footer"><span id="monitor-count">0 frame</span><span>Monitor BPQ · sola lettura · orari originali BPQ</span><label><input id="monitor-follow" type="checkbox" checked> Scorrimento automatico</label></footer>`;$('main').append(section);
|
||||
let events=[],cursor=0,paused=false,busy=false,state='offline',displayedCursor=0;
|
||||
const originalNavigate=navigate;navigate=function(next){originalNavigate(next);if(next==='monitor'){$('#breadcrumb').textContent='Stazione / Monitor';poll();}};
|
||||
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);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';};
|
||||
$('#monitor-clear').onclick=()=>{events=[];render();};
|
||||
for(const id of ['monitor-port','monitor-direction','monitor-search'])$('#'+id).addEventListener('input',()=>{if(!paused)render()});
|
||||
$('#monitor-export').onclick=()=>{const list=filtered();if(!list.length){toast('Nessun frame da scaricare');return;}const blob=new Blob([list.map(e=>`[${e.at}] ${e.direction} P${e.port||'?'}\n${e.text}\n`).join('\n')],{type:'text/plain;charset=utf-8'}),url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='ALNODE-monitor-'+new Date().toISOString().replace(/[:.]/g,'-')+'.txt';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);};
|
||||
setInterval(()=>{if(csrf&&page==='monitor')poll()},1000);
|
||||
window.addEventListener('hashchange',()=>{if(location.hash==='#monitor')navigate('monitor')});
|
||||
if(location.hash==='#monitor')navigate('monitor');
|
||||
})();
|
||||
@@ -0,0 +1,5 @@
|
||||
export function incoming(messages,known,call='IU2EUG'){
|
||||
if(!known)return {bulletins:[],mail:[]};
|
||||
const fresh=messages.filter(m=>!known.has(m.id)&&m.from!==call);
|
||||
return {bulletins:fresh.filter(m=>m.type==='B'),mail:fresh.filter(m=>m.type==='P'||m.type==='T')};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
@import url('data:text/css,');
|
||||
:root{--bg:#f5f6f1;--ink:#192b23;--muted:#77817a;--green:#2d6249;--line:#e4e8df;--white:#fff;--lime:#c8eaa6}*{box-sizing:border-box}body{margin:0;font:14px 'Segoe UI',Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}button:focus-visible,a:focus-visible{outline:3px solid #80b862;outline-offset:3px}[hidden]{display:none!important}h1,h2,p{margin:0}h1{font-size:32px;line-height:1.25;letter-spacing:-1.1px;font-weight:600}h2{font-size:17px;font-weight:600}p{line-height:1.7}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px;color:var(--green)}.muted{color:var(--muted);font-size:12px}.primary,.secondary{border-radius:8px;padding:12px 18px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:10px;border:1px solid transparent}.primary{background:var(--green);color:#fff}.primary:hover{background:#204b37}.secondary{background:#fff;border-color:var(--line);color:var(--ink)}.secondary:hover{background:#f0f4ed}.text-button{background:none;border:0;color:var(--green);font-size:12px;font-weight:600}.icon-button{border:1px solid var(--line);background:#fff;border-radius:7px;width:34px;height:34px;font-size:21px;color:var(--ink)}.full{width:100%}.brand{font-size:23px;font-weight:700;letter-spacing:-1px;text-decoration:none;color:inherit}.brand>span{display:block;font-size:9px;font-weight:500;letter-spacing:3px;margin:7px 0 0 31px}.sidebar{width:230px;position:fixed;inset:0 auto 0 0;background:#11241b;color:#e7eddf;padding:32px 23px;display:flex;flex-direction:column;z-index:4}.sidebar .brand{margin-bottom:45px}.side-label{font-size:9px;letter-spacing:2px;color:#82998a;margin:0 10px 14px}nav button{display:flex;align-items:center;gap:12px;width:100%;border:0;background:none;color:#aec1b3;padding:14px 12px;text-align:left;border-radius:8px;margin-bottom:6px}nav button span{font-size:18px;width:18px}nav button.active{background:#294532;color:#e2f5c9}nav button:hover{background:#223e2d}nav b{font-size:10px;background:#466143;border-radius:4px;padding:2px 6px;margin-left:auto}.side-station{margin-top:auto;padding:24px 10px;color:#d5e6d5;font-weight:600;border-top:1px solid #304333}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--lime);margin-right:8px}.side-station small{display:block;color:#94aa99;font-size:11px;font-weight:400;line-height:1.8;margin-top:7px}.side-frequency{font-size:11px;line-height:2.2;margin:18px 0}.side-frequency span{float:right;font-family:Consolas,monospace;color:#cadcbe}.profile{display:flex;gap:10px;align-items:center;border-top:1px solid #304333;padding-top:20px;font-size:12px}.profile small{display:block;color:#92a696;font-size:10px;margin-top:4px}.profile button{margin-left:auto;background:none;border:0;color:#aec1b3;font-size:22px}.avatar{background:#c5dea8;color:#23452e;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:700}main{margin-left:230px}.topbar{height:76px;padding:0 40px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);font-size:11px;color:var(--muted)}.topbar>div{display:flex;align-items:center;gap:18px}.live-badge{color:var(--green);background:#e9f0e1;padding:7px 10px;border-radius:20px;font-size:10px;font-weight:600}#clock{font-family:Consolas,monospace}.page{padding:35px 40px 20px;max-width:1600px;margin:auto}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}.page-heading .eyebrow{display:block;margin-bottom:10px}.page-heading p{color:var(--muted);margin-top:10px;font-size:13px}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.metrics article{position:relative;background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;min-height:137px}.metrics article>span{font-size:11px;color:var(--muted)}.metrics strong{display:block;font-size:32px;font-weight:600;letter-spacing:-1px;margin:10px 0 5px}.metrics small{font-size:10px;color:var(--muted)}.metrics i{position:absolute;right:18px;top:16px;font-style:normal;color:#9ab18d;font-size:19px}.overview-grid{display:grid;grid-template-columns:1fr 1.15fr;gap:22px;margin-bottom:22px}.card{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}.card-header{display:flex;align-items:center;justify-content:space-between;padding:20px 22px;gap:10px}.tag{font-size:9px;letter-spacing:1px;background:#eff3ea;padding:5px 8px;border-radius:4px;color:var(--green);white-space:nowrap}.radio-card{border-radius:12px;background:#203e2d;color:#eaf1e0;overflow:hidden;position:relative}.radio-card .eyebrow{color:#c1dba7}.radio-card .tag{background:#3c5d40;color:#d2eab8}.radio-frequency{display:flex;align-items:baseline;gap:15px;margin:8px 25px 0}.radio-frequency>span{font:54px Consolas,monospace;leLine truncated
|
||||
.routing-trace{font:11px/1.7 Consolas,monospace;border:1px solid #e1e8d9;background:#f7faf3;border-radius:7px;padding:10px 13px;margin:0 0 22px;color:#76866a;white-space:normal}.routing-trace summary{cursor:pointer;font:11px Segoe UI,Arial,sans-serif}.routing-trace pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0 0}
|
||||
Vendored
+177
@@ -0,0 +1,177 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+3
@@ -0,0 +1,3 @@
|
||||
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||
All rights reserved.
|
||||
See ./LICENSEáCNS2-H
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+3
@@ -0,0 +1,3 @@
|
||||
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||
All rights reserved.
|
||||
See ./LICENSEá ETen-B5-H` ^
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||
All rights reserved.
|
||||
See ./LICENSE!!�º]aX!!]`�21�> �p�z�$]‚�"R‚d�-Uƒ7�*„␍4„%�+ „Z „{�/…%…<�9K…b�1]†.�"‡‰`]‡,�"]ˆ
|
||||
�"]ˆh�"]‰F�"]Š$�"]‹�"]‹`�"]Œ>�"]��"]�z�"]ŽX�"]�6�"]��"]�r�"]‘P�"]’.�"]“�"]“j�"]”H�"]•&�"]–�"]–b�"]—@�"]˜�"]˜|�"]™Z�"]š8�"]›�"]›t�"]œR�"]�0�"]ž�"]žl�"]ŸJ�"] (�"]¡�"]¡d�"]¢B�"]£ �"X£~�']¤W�"]¥5�"]¦�"]¦q�"]§O�"]¨-�"]©�"]©i�"]ªG�"]«%�"]¬�"]¬a�"]?�"]®�"]®{�"]¯Y�"]°7�"]±�"]±s�"]²Q�"]³/�"]´␍�"]´k�"]µI�"]¶'�"]·�"]·c�"]¸A�"]¹�"]¹}�"]º[�"]»9
|
||||
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Loaded 100 of 213 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user