Ship War Room UX, CEO inbox, mobile chat, and Agents NAS workspace.
Make A2A togglable, keep reply context while reading, route agent data to //10.4.7.11/share/Agents, and polish themes plus export-intel sync cancel.
This commit is contained in:
@@ -4,6 +4,8 @@ function exportIntelApp() {
|
||||
tabIndicatorTop: 0,
|
||||
tabIndicatorH: 40,
|
||||
busy: false,
|
||||
overlayDismissed: false,
|
||||
syncAbort: null,
|
||||
syncMsg: '',
|
||||
syncMonitor: null,
|
||||
syncMonitorOpen: true,
|
||||
@@ -291,9 +293,30 @@ function exportIntelApp() {
|
||||
},
|
||||
|
||||
isWorking() {
|
||||
if (this.overlayDismissed) return false;
|
||||
return this.busy || this.crmPushBusy || this.mapLoading || this.drawerLoading;
|
||||
},
|
||||
|
||||
dismissOverlay() {
|
||||
this.overlayDismissed = true;
|
||||
},
|
||||
|
||||
async cancelSync() {
|
||||
try {
|
||||
if (this.syncAbort) {
|
||||
try { this.syncAbort.abort(); } catch (e) {}
|
||||
}
|
||||
await fetch('/api/export-intel/sync/cancel', { method: 'POST' });
|
||||
this.syncMsg = 'Sync wordt geannuleerd…';
|
||||
this.busy = false;
|
||||
this.overlayDismissed = true;
|
||||
if (window.Cockpit) Cockpit.toast('Sync annuleren…', 'info');
|
||||
await this.pollSyncStatus();
|
||||
} catch (e) {
|
||||
this.syncMsg = 'Annuleren mislukt: ' + e.message;
|
||||
}
|
||||
},
|
||||
|
||||
progressLabel() {
|
||||
if (this.busy && this.syncMsg) return this.syncMsg;
|
||||
if (this.crmPushBusy) return 'CRM import bezig…';
|
||||
@@ -792,7 +815,9 @@ function exportIntelApp() {
|
||||
return;
|
||||
}
|
||||
this.busy = true;
|
||||
this.overlayDismissed = false;
|
||||
this.syncMsg = kind === 'world' ? 'Wereld-sync gestart…' : 'Sync gestart…';
|
||||
this.syncAbort = (typeof AbortController !== 'undefined') ? new AbortController() : null;
|
||||
try {
|
||||
var body = {
|
||||
country_iso2: this.country || null,
|
||||
@@ -806,20 +831,25 @@ function exportIntelApp() {
|
||||
return;
|
||||
}
|
||||
var endpoint = kind === 'region' ? 'region' : kind;
|
||||
var r = await fetch('/api/export-intel/sync/' + endpoint, {
|
||||
var fetchOpts = {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body),
|
||||
}).then((x) => x.json());
|
||||
};
|
||||
if (this.syncAbort) fetchOpts.signal = this.syncAbort.signal;
|
||||
var r = await fetch('/api/export-intel/sync/' + endpoint, fetchOpts).then((x) => x.json());
|
||||
if (r.error) this.syncMsg = 'Fout: ' + r.error;
|
||||
else if (r.cancelled || (r.result && r.result.cancelled)) this.syncMsg = 'Sync geannuleerd';
|
||||
else if (kind === 'world') this.syncMsg = 'Wereld-sync voltooid — kaart wordt ververst';
|
||||
else if (kind === 'all' || kind === 'region') this.syncMsg = 'Regio-sync voltooid';
|
||||
else this.syncMsg = 'Sync voltooid';
|
||||
await this.refresh();
|
||||
if (!(r.cancelled || (r.result && r.result.cancelled))) await this.refresh();
|
||||
} catch (e) {
|
||||
this.syncMsg = 'Sync mislukt: ' + e.message;
|
||||
if (e && e.name === 'AbortError') this.syncMsg = 'Sync geannuleerd';
|
||||
else this.syncMsg = 'Sync mislukt: ' + e.message;
|
||||
}
|
||||
this.busy = false;
|
||||
this.syncAbort = null;
|
||||
},
|
||||
|
||||
tabCount(id) {
|
||||
|
||||
Reference in New Issue
Block a user