|
|
|
@ -94,9 +94,9 @@ const ListNode: React.FC<ListNodeProps> = ({ componentData }) => {
|
|
|
|
// 处理启动实例
|
|
|
|
// 处理启动实例
|
|
|
|
const handleStart = async (record) => {
|
|
|
|
const handleStart = async (record) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// 先执行刷新依赖
|
|
|
|
// 先执行编译组件
|
|
|
|
// await refreshInstanceDependency(record.id);
|
|
|
|
// await refreshInstanceDependency(record.id);
|
|
|
|
// 刷新依赖完成后启动
|
|
|
|
// 编译组件完成后启动
|
|
|
|
setStartLoading(true);
|
|
|
|
setStartLoading(true);
|
|
|
|
setStartingId(record.id);
|
|
|
|
setStartingId(record.id);
|
|
|
|
const res: any = await startInstance(record.id);
|
|
|
|
const res: any = await startInstance(record.id);
|
|
|
|
@ -159,7 +159,7 @@ const ListNode: React.FC<ListNodeProps> = ({ componentData }) => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 刷新依赖
|
|
|
|
// 编译组件
|
|
|
|
const handleRefresh = async (record) => {
|
|
|
|
const handleRefresh = async (record) => {
|
|
|
|
// 添加到刷新中的集合
|
|
|
|
// 添加到刷新中的集合
|
|
|
|
setRefreshingIds(prev => new Set(prev).add(record.id));
|
|
|
|
setRefreshingIds(prev => new Set(prev).add(record.id));
|
|
|
|
@ -168,7 +168,7 @@ const ListNode: React.FC<ListNodeProps> = ({ componentData }) => {
|
|
|
|
const messageKey = `refresh_${record.id}`;
|
|
|
|
const messageKey = `refresh_${record.id}`;
|
|
|
|
Message.loading({
|
|
|
|
Message.loading({
|
|
|
|
id: messageKey,
|
|
|
|
id: messageKey,
|
|
|
|
content: '正在刷新依赖,请稍候...',
|
|
|
|
content: '正在编译组件,请稍候...',
|
|
|
|
duration: 0 // 不自动关闭
|
|
|
|
duration: 0 // 不自动关闭
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@ -189,7 +189,7 @@ const ListNode: React.FC<ListNodeProps> = ({ componentData }) => {
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
// 关闭 loading 消息
|
|
|
|
// 关闭 loading 消息
|
|
|
|
Message.clear();
|
|
|
|
Message.clear();
|
|
|
|
console.error('刷新依赖失败:', error);
|
|
|
|
console.error('编译组件失败:', error);
|
|
|
|
Message.error('依赖刷新失败,请稍后重试');
|
|
|
|
Message.error('依赖刷新失败,请稍后重试');
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
// 从刷新中的集合移除
|
|
|
|
// 从刷新中的集合移除
|
|
|
|
@ -392,7 +392,7 @@ const ListNode: React.FC<ListNodeProps> = ({ componentData }) => {
|
|
|
|
loading={isRefreshing}
|
|
|
|
loading={isRefreshing}
|
|
|
|
disabled={isRefreshing}
|
|
|
|
disabled={isRefreshing}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
刷新依赖
|
|
|
|
编译组件
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button type="text" onClick={() => handleOpenLog(record)}>运行日志</Button>
|
|
|
|
<Button type="text" onClick={() => handleOpenLog(record)}>运行日志</Button>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
|