|
|
|
|
@ -129,6 +129,10 @@ export const useFlowCallbacks = (
|
|
|
|
|
return getCurrentAppKey(currentAppData) || initialData?.appId;
|
|
|
|
|
}, [initialData]);
|
|
|
|
|
|
|
|
|
|
const refreshAppList = useCallback(() => {
|
|
|
|
|
document.dispatchEvent(new CustomEvent('refreshAppList'));
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// region 画布操作
|
|
|
|
|
// 节点变更处理,添加防抖机制
|
|
|
|
|
const onNodesChange = useCallback(
|
|
|
|
|
@ -1406,6 +1410,7 @@ export const useFlowCallbacks = (
|
|
|
|
|
|
|
|
|
|
// 更新运行ID
|
|
|
|
|
dispatch(updateRuntimeId(res.data));
|
|
|
|
|
refreshAppList();
|
|
|
|
|
|
|
|
|
|
// 开始运行时动画
|
|
|
|
|
setEdges((eds) =>
|
|
|
|
|
@ -1439,6 +1444,7 @@ export const useFlowCallbacks = (
|
|
|
|
|
|
|
|
|
|
// 更新运行ID
|
|
|
|
|
dispatch(updateRuntimeId(res.data));
|
|
|
|
|
refreshAppList();
|
|
|
|
|
|
|
|
|
|
// 开始运行时动画
|
|
|
|
|
setEdges((eds) =>
|
|
|
|
|
@ -1467,9 +1473,8 @@ export const useFlowCallbacks = (
|
|
|
|
|
} else {
|
|
|
|
|
// 特殊停止逻辑,持久化运行的应用使用这里的入参
|
|
|
|
|
await stopApp(currentAppData.instanceId);
|
|
|
|
|
// 特殊停止完成后触发事件,通知刷新应用列表
|
|
|
|
|
document.dispatchEvent(new CustomEvent('refreshAppList'));
|
|
|
|
|
}
|
|
|
|
|
refreshAppList();
|
|
|
|
|
|
|
|
|
|
// 重置节点状态
|
|
|
|
|
dispatch(resetNodeStatus());
|
|
|
|
|
@ -1495,7 +1500,7 @@ export const useFlowCallbacks = (
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
[getCurrentFlowAppKey]
|
|
|
|
|
[getCurrentFlowAppKey, refreshAppList]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 暂停/恢复应用
|
|
|
|
|
|