я косяк, поправил веб. Капитан, работайте!

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
влад
2026-07-16 11:06:47 +03:00
co-authored by Cursor
parent 148d645760
commit 2c294424ef
85 changed files with 17410 additions and 110 deletions
@@ -15,6 +15,31 @@
let hubEl = null;
let planMountEl = null;
let multiserverMountEl = null;
let orchContextLoaded = false;
async function ensureOrchContext() {
if (orchContextLoaded || global.__WESP_ORCH__?.enterpriseId) {
orchContextLoaded = true;
return;
}
try {
const resp = await fetch("/api/v1/orchestrator/context");
if (resp.ok) {
const data = await resp.json();
global.__WESP_ORCH__ = Object.assign(global.__WESP_ORCH__ || {}, {
enterpriseId: data.enterpriseId || "",
configured: !!data.configured,
reachable: !!data.reachable,
upstream: data.upstream || "",
hubSiteId: data.hubSiteId || "",
});
}
} catch (_err) {
/* hub may run without orchestrator */
} finally {
orchContextLoaded = true;
}
}
let titleEl = null;
let readAllBtn = null;
let backBtn = null;
@@ -789,7 +814,7 @@
showModal();
}
function openMultiserver() {
async function openMultiserver() {
ensureModal();
updateHeader("multiserver");
hubEl.hidden = true;
@@ -797,6 +822,7 @@
planMountEl.hidden = true;
multiserverMountEl.hidden = false;
destroyDailyPlanPanel();
await ensureOrchContext();
const enterpriseId = global.__WESP_ORCH__?.enterpriseId || "";
if (global.WespMultiserverPanel?.mount) {
global.WespMultiserverPanel.mount(multiserverMountEl, enterpriseId);