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
+3
-3
@@ -51,13 +51,13 @@ export class Forwarding{
|
||||
}
|
||||
this.cached={profiles:out,updatedAt:new Date().toISOString(),scheduleTimezone:profiles.some(p=>p.timesLocal)?'Locale server BPQ':'UTC',radio:this.radio(),errors};this.cachedAt=Date.now();return this.cached;
|
||||
});}
|
||||
start(peer){return this.exclusive(async()=>{
|
||||
if(this.lockedPeers.has(peer))throw new Error(this.lockedPeers.get(peer));
|
||||
start(peer,{signal}={}){return this.exclusive(async()=>{
|
||||
signal?.throwIfAborted();if(this.lockedPeers.has(peer))throw new Error(this.lockedPeers.get(peer));
|
||||
const p=(await this.profiles()).find(p=>p.call===peer);if(!p?.configured)throw new Error('Profilo di forwarding non configurato');
|
||||
if(Date.now()-(this.requested.get(peer)||0)<30000)throw new Error('Sincronizzazione già richiesta: attendi 30 secondi');
|
||||
const last=forwardingHistory(await this.logs().catch(()=>''),peer)[0];if(last&&!last.endedAt&&['calling','connected'].includes(last.status))throw new Error('Forwarding già in corso per questo partner');
|
||||
const radio=this.radio();if(p.transport==='Radio'&&radio?.txSuspended)throw Error('Trasmissioni radio sospese dalla console');if(p.transport==='Radio'&&(radio?.active||radio?.connecting))throw new Error('Modem occupato da una connessione: riprova al termine');
|
||||
const key=await this.context();await this.bpq('/Mail/FwdDetails?'+key,{method:'POST',body:peer});await this.bpq('/Mail/FWDSave?'+key,{method:'POST',body:'StartForward'});
|
||||
const key=await this.context();await this.bpq('/Mail/FwdDetails?'+key,{method:'POST',body:peer});signal?.throwIfAborted();await this.bpq('/Mail/FWDSave?'+key,{method:'POST',body:'StartForward'});
|
||||
this.requested.set(peer,Date.now());this.cached=null;return {ok:true,peer,requestedAt:new Date().toISOString()};
|
||||
});}
|
||||
}
|
||||
Reference in new issue
Block a user