Merge branch 'dev'
This commit is contained in:
commit
21b8a24267
|
|
@ -384,20 +384,25 @@ export class FolkBlender extends FolkShape {
|
||||||
this.#renderResult();
|
this.#renderResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Health check
|
// Health check with retry (container may still be starting)
|
||||||
fetch("/api/blender-gen/health").then(r => r.json()).then((h: any) => {
|
const checkHealth = (attempt = 0) => {
|
||||||
if (!h.available && this.#generateBtn) {
|
fetch("/api/blender-gen/health").then(r => r.json()).then((h: any) => {
|
||||||
this.#generateBtn.disabled = true;
|
if (!h.available && this.#generateBtn) {
|
||||||
this.#generateBtn.title = (h.issues || []).join(", ") || "Blender service unavailable";
|
if (attempt < 2) { setTimeout(() => checkHealth(attempt + 1), 3000); return; }
|
||||||
} else if (h.warnings?.length && this.#generateBtn) {
|
this.#generateBtn.disabled = true;
|
||||||
this.#generateBtn.title = h.warnings.join(", ");
|
this.#generateBtn.title = (h.issues || []).join(", ") || "Blender service unavailable";
|
||||||
}
|
} else if (h.warnings?.length && this.#generateBtn) {
|
||||||
}).catch(() => {
|
this.#generateBtn.title = h.warnings.join(", ");
|
||||||
if (this.#generateBtn) {
|
}
|
||||||
this.#generateBtn.disabled = true;
|
}).catch(() => {
|
||||||
this.#generateBtn.title = "Cannot reach Blender health endpoint";
|
if (attempt < 2) { setTimeout(() => checkHealth(attempt + 1), 3000); return; }
|
||||||
}
|
if (this.#generateBtn) {
|
||||||
});
|
this.#generateBtn.disabled = true;
|
||||||
|
this.#generateBtn.title = "Cannot reach Blender health endpoint";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
checkHealth();
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,18 +311,23 @@ export class FolkFreeCAD extends FolkShape {
|
||||||
this.#renderResult();
|
this.#renderResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Health check
|
// Health check with retry (container may still be starting)
|
||||||
fetch("/api/freecad/health").then(r => r.json()).then((h: any) => {
|
const checkHealth = (attempt = 0) => {
|
||||||
if (!h.available && this.#generateBtn) {
|
fetch("/api/freecad/health").then(r => r.json()).then((h: any) => {
|
||||||
this.#generateBtn.disabled = true;
|
if (!h.available && this.#generateBtn) {
|
||||||
this.#generateBtn.title = h.error || "FreeCAD MCP server unavailable";
|
if (attempt < 2) { setTimeout(() => checkHealth(attempt + 1), 3000); return; }
|
||||||
}
|
this.#generateBtn.disabled = true;
|
||||||
}).catch(() => {
|
this.#generateBtn.title = h.error || "FreeCAD MCP server unavailable";
|
||||||
if (this.#generateBtn) {
|
}
|
||||||
this.#generateBtn.disabled = true;
|
}).catch(() => {
|
||||||
this.#generateBtn.title = "Cannot reach FreeCAD health endpoint";
|
if (attempt < 2) { setTimeout(() => checkHealth(attempt + 1), 3000); return; }
|
||||||
}
|
if (this.#generateBtn) {
|
||||||
});
|
this.#generateBtn.disabled = true;
|
||||||
|
this.#generateBtn.title = "Cannot reach FreeCAD health endpoint";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
checkHealth();
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -397,18 +397,23 @@ export class FolkKiCAD extends FolkShape {
|
||||||
this.#showExports();
|
this.#showExports();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Health check
|
// Health check with retry (container may still be starting)
|
||||||
fetch("/api/kicad/health").then(r => r.json()).then((h: any) => {
|
const checkHealth = (attempt = 0) => {
|
||||||
if (!h.available && this.#generateBtn) {
|
fetch("/api/kicad/health").then(r => r.json()).then((h: any) => {
|
||||||
this.#generateBtn.disabled = true;
|
if (!h.available && this.#generateBtn) {
|
||||||
this.#generateBtn.title = h.error || "KiCAD MCP server unavailable";
|
if (attempt < 2) { setTimeout(() => checkHealth(attempt + 1), 3000); return; }
|
||||||
}
|
this.#generateBtn.disabled = true;
|
||||||
}).catch(() => {
|
this.#generateBtn.title = h.error || "KiCAD MCP server unavailable";
|
||||||
if (this.#generateBtn) {
|
}
|
||||||
this.#generateBtn.disabled = true;
|
}).catch(() => {
|
||||||
this.#generateBtn.title = "Cannot reach KiCAD health endpoint";
|
if (attempt < 2) { setTimeout(() => checkHealth(attempt + 1), 3000); return; }
|
||||||
}
|
if (this.#generateBtn) {
|
||||||
});
|
this.#generateBtn.disabled = true;
|
||||||
|
this.#generateBtn.title = "Cannot reach KiCAD health endpoint";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
checkHealth();
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
cascadePermissions,
|
cascadePermissions,
|
||||||
listCommunities,
|
listCommunities,
|
||||||
deleteCommunity,
|
deleteCommunity,
|
||||||
|
updateSpaceMeta,
|
||||||
} from "./community-store";
|
} from "./community-store";
|
||||||
import type { NestPermissions, SpaceRefFilter } from "./community-store";
|
import type { NestPermissions, SpaceRefFilter } from "./community-store";
|
||||||
import { ensureDemoCommunity } from "./seed-demo";
|
import { ensureDemoCommunity } from "./seed-demo";
|
||||||
|
|
@ -3696,7 +3697,7 @@ loadAllDocs(syncServer)
|
||||||
})
|
})
|
||||||
.catch((e) => console.error("[DocStore] Startup load failed:", e));
|
.catch((e) => console.error("[DocStore] Startup load failed:", e));
|
||||||
|
|
||||||
// Restore relay mode for encrypted spaces
|
// Restore relay mode for encrypted spaces + one-shot visibility fixes
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const slugs = await listCommunities();
|
const slugs = await listCommunities();
|
||||||
|
|
@ -3712,6 +3713,16 @@ loadAllDocs(syncServer)
|
||||||
if (relayCount > 0) {
|
if (relayCount > 0) {
|
||||||
console.log(`[Encryption] ${relayCount} space(s) set to relay mode (encrypted)`);
|
console.log(`[Encryption] ${relayCount} space(s) set to relay mode (encrypted)`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// One-shot: fix spaces that should be permissioned
|
||||||
|
const fixPermissioned = ["clf", "bcrg"];
|
||||||
|
for (const slug of fixPermissioned) {
|
||||||
|
const data = getDocumentData(slug);
|
||||||
|
if (data && data.meta?.visibility !== "permissioned") {
|
||||||
|
updateSpaceMeta(slug, { visibility: "permissioned" });
|
||||||
|
console.log(`[VisFix] Set ${slug} to permissioned (was: ${data.meta?.visibility})`);
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("[Encryption] Failed to restore relay modes:", e);
|
console.error("[Encryption] Failed to restore relay modes:", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue