Align mail columns and add live sync dialogs with targeted cancellation
This commit is contained in:
1 parent
e536f0939c
commit
573e0aa24e
15 files changed
+133
-20
No files matched your search
@@ -15,7 +15,7 @@ toggle.onclick=()=>{expanded=!expanded;gatewayPanel.hidden=!expanded;toggle.setA
|
||||
$('#wl-gateway-refresh').onclick=()=>load(true);for(const id of ['wl-gateway-search','wl-gateway-band','wl-gateway-open','wl-gateway-sort'])$('#'+id).oninput=render;
|
||||
gatewayPanel.addEventListener('click',e=>{const row=e.target.closest('[data-channel]');if(!row)return;const c=directory.channels.find(c=>c.id===row.dataset.channel);if(!available(c))return;selectedId=c.id;render();});
|
||||
gatewayPanel.addEventListener('change',e=>{if(e.target.matches('input[name="wl-channel"]')){selectedId=e.target.closest('[data-channel]').dataset.channel;render();}});
|
||||
$('#wl-radio-connect').onclick=async()=>{if(requesting||!selectedId)return;requesting=true;selection();try{session=await api('/winlink/radio/sync',{method:'POST',body:JSON.stringify({channelId:selectedId})});toast('Sync radio richiesto verso '+session.channel.call);updateSession();setTimeout(wlLoad,1200);}catch(e){$('#wl-directory-error').hidden=false;$('#wl-directory-error').textContent=e.message;toast(e.message);}finally{requesting=false;selection();}};
|
||||
$('#wl-radio-connect').onclick=async()=>{if(requesting||!selectedId)return;requesting=true;selection();try{await window.bpqSync.start({kind:'winlink-radio',channelId:selectedId});updateSession();setTimeout(wlLoad,1200);}catch(e){$('#wl-directory-error').hidden=false;$('#wl-directory-error').textContent=e.message;toast(e.message);}finally{requesting=false;selection();}};
|
||||
function updateSession(){session=wlData?.radioSession||session;const active=session?.restoring;restore.hidden=!(active&&['conflict','error'].includes(session.state));$('#wl-sync').disabled=Boolean(active);$('#wl-transport-label').textContent=wlData?.transport==='radio'||active?'Radio · '+(session?.channel.call||'RMS'):'CMS · Internet';const box=$('#wl-radio-progress');box.hidden=!session;if(session){const label={preparing:'Preparazione modem packet e frequenza',requested:'Richiesta inviata a BPQ',calling:'Chiamata radio in corso',connected:'Collegato · scambio posta',complete:'Sync radio completato',ended:'Profilo Internet ripristinato',failed:'Collegamento non riuscito',incomplete:'Sessione interrotta',error:'Errore nella richiesta',conflict:'Ripristino da verificare'}[session.state]||session.state;box.className='wl-radio-progress '+(active?'running':session.state==='complete'?'complete':'');box.textContent=(active?'◉ ':'')+label+' · '+session.channel.call+' · '+hz(session.channel.dialHz)+(session.sent!=null?' · TX '+session.sent+' / RX '+session.received:'')+(active?' · profilo Internet sospeso':session.endedAt?' · '+time(session.endedAt):'')+(session.error?' · '+session.error:'');}selection();}
|
||||
setInterval(()=>{if(expanded&&csrf&&!document.hidden)load();},60000);
|
||||
const restore=document.createElement('button');restore.className='secondary wl-radio-restore';restore.textContent='Ripristina profilo Internet';restore.hidden=true;$('#wl-radio-progress').after(restore);restore.onclick=async()=>{restore.disabled=true;try{session=await api('/winlink/radio/restore',{method:'POST',body:'{}'});await wlLoad();}catch(e){toast(e.message);}finally{restore.disabled=false;}};
|
||||
|
||||
Reference in new issue
Block a user