fix: overlay真正集成(CRLF换行导致正则替换全部失效) showRunOverlay/hideRunOverlay/overlayBroadcast实际调用, nodeLabel/total字段补上

This commit is contained in:
yu committed 2026-11-03 14:01:45 +08:00
1 parent 9bfa4ac107
commit 0d429e5175
2 files changed
+14 -1

No files matched your search

+12 -1
View File
@@ -28,12 +28,22 @@ export function startRun(flow: FlowDefinition, sender: WebContents): { runId: st
const controller = new AbortController();
active.set(runId, controller);
currentRunId = runId;
showRunOverlay(getMainWindow());
const catalog = loadCatalog();
const components = new Map(catalog.components.map((item) => [item.id, item]));
const nodeLabels = new Map<string, string>();
for (const node of flow.nodes) {
nodeLabels.set(node.id, node.label || node.componentId);
}
const emit = (event: Omit<RunEvent, "runId">) => {
if (!sender.isDestroyed()) sender.send("run:event", { ...event, runId });
const enriched = { ...event, runId } as RunEvent;
if (event.type === "node.started" && event.nodeId) {
enriched.nodeLabel = nodeLabels.get(event.nodeId);
}
if (!sender.isDestroyed()) sender.send("run:event", enriched);
overlayBroadcast(enriched);
};
const log: (message: string, level?: "info" | "warn" | "error", nodeId?: string) => void = (
message,
@@ -63,6 +73,7 @@ export function startRun(flow: FlowDefinition, sender: WebContents): { runId: st
} finally {
active.delete(runId);
if (currentRunId === runId) currentRunId = null;
hideRunOverlay(getMainWindow());
}
})();