Polish dashboard layout and stabilize live map refreshes

Preserve map markers, zoom and open details during polling; consolidate technical notes and align interface spacing. Fix empty English translations inserting undefined text and add regression coverage.
This commit is contained in:
alberto committed 2026-10-18 21:14:35 +02:00
1 parent c8941dc199
commit 33f1294405
17 files changed
+277 -50

No files matched your search

+15 -1
View File
@@ -2,6 +2,19 @@
(() => {
'use strict';
const entries=`
Dal|Since
Dettagli del registro|Log details
Seleziona un messaggio|Select a message
Mappa delle stazioni|Station map
Seleziona un collegamento|Select a connection
Traffico, servizio ed eventi della sessione.|Session traffic, service and events.
Seleziona una stazione|Select a station
Copertura parziale dei dati|Partial data coverage
Informazioni sulla mappa|About this map
Informazioni sulla programmazione|About scheduling
Dettagli dei dati|Data details
Fonti|Sources
La tua stazione, in un unico pannello.|Your station, in one dashboard.
Benvenuto in stazione.|Welcome to your station.
Accedi con l’utente e la password Telnet del tuo BPQ.|Sign in with your BPQ Telnet username and password.
@@ -694,7 +707,7 @@ Configurazione APRS applicata|APRS configuration applied
Configurato · lascia vuoto per mantenerlo|Configured · leave blank to keep it
Non configurato|Not configured
Stazione / APRS|Station / APRS`;
const dictionary=new Map((entries.trim()+'\n'+uploadCopy+'\n'+sizeCopy+'\n'+deleteCopy+'\n'+portCopy+'\n'+aprsCopy).split('\n').map(line=>line.split('|')));
const dictionary=new Map((entries+'\n'+uploadCopy+'\n'+sizeCopy+'\n'+deleteCopy+'\n'+portCopy+'\n'+aprsCopy).split(/\r?\n/).map(line=>line.split('|')).filter(([source,target])=>source?.trim()&&typeof target==='string'&&target.trim()));
function resolveLanguage(preference=null,languages=[]){
if(preference==='it'||preference==='en')return preference;
// The first browser language is the user's preferred UI language; English is the fallback.
@@ -731,6 +744,7 @@ Stazione / APRS|Station / APRS`;
[/^Stessa coda e stesse regole del partner (\S+)\. Nessun timer automatico per questo percorso\. (.+)$/,m=>'Same queue and rules as partner '+m[1]+'. No automatic timer for this route. '+translate(m[2])],
];
function translate(text){
if(!text.trim())return text;
if(dictionary.has(text))return dictionary.get(text);
for(const [pattern,render]of patterns){const match=text.match(pattern);if(match)return render(match);}
if(text.includes(' · '))return text.split(' · ').map(translate).join(' · ');