| @@ -5,7 +5,7 @@ import { experimentStatusInfo } from '@/pages/Experiment/status'; | |||||
| import { ExperimentInstance, NodeStatus } from '@/types'; | import { ExperimentInstance, NodeStatus } from '@/types'; | ||||
| import { ExperimentCompleted } from '@/utils/constant'; | import { ExperimentCompleted } from '@/utils/constant'; | ||||
| import { formatDate } from '@/utils/date'; | import { formatDate } from '@/utils/date'; | ||||
| import { getExperimentInstanceStatus, getWorkflowStatus } from '@/utils/experiment'; | |||||
| import { getWorkflowStatus } from '@/utils/experiment'; | |||||
| import { Typography } from 'antd'; | import { Typography } from 'antd'; | ||||
| import React, { useCallback } from 'react'; | import React, { useCallback } from 'react'; | ||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| @@ -18,7 +18,7 @@ type ExperimentInstanceComponentProps = { | |||||
| function ExperimentInstanceComponent({ experimentId, instance }: ExperimentInstanceComponentProps) { | function ExperimentInstanceComponent({ experimentId, instance }: ExperimentInstanceComponentProps) { | ||||
| const { id, argo_ins_name, argo_ins_ns, node_status } = instance; | const { id, argo_ins_name, argo_ins_ns, node_status } = instance; | ||||
| const workflowStatus = getWorkflowStatus(node_status) as NodeStatus | undefined; | const workflowStatus = getWorkflowStatus(node_status) as NodeStatus | undefined; | ||||
| const status = getExperimentInstanceStatus(instance.status as ExperimentStatus); | |||||
| const status = instance.status as ExperimentStatus; | |||||
| const createTime = workflowStatus?.startedAt; | const createTime = workflowStatus?.startedAt; | ||||
| const finishTime = workflowStatus?.finishedAt; | const finishTime = workflowStatus?.finishedAt; | ||||
| const statusInfo = experimentStatusInfo[status]; | const statusInfo = experimentStatusInfo[status]; | ||||
| @@ -343,7 +343,7 @@ function ExperimentList({ type }: ExperimentListProps) { | |||||
| return item; | return item; | ||||
| }); | }); | ||||
| }); | }); | ||||
| // 刷新实验列表 | |||||
| // 刷新实验列表和实例列表 | |||||
| refreshExperimentList(true); | refreshExperimentList(true); | ||||
| if (expandedRowKeys.length > 0) { | if (expandedRowKeys.length > 0) { | ||||
| refreshExperimentIns(expandedRowKeys[0]); | refreshExperimentIns(expandedRowKeys[0]); | ||||
| @@ -5,7 +5,7 @@ import { experimentStatusInfo } from '@/pages/Experiment/status'; | |||||
| import { ExperimentInstance, NodeStatus } from '@/types'; | import { ExperimentInstance, NodeStatus } from '@/types'; | ||||
| import { ExperimentCompleted } from '@/utils/constant'; | import { ExperimentCompleted } from '@/utils/constant'; | ||||
| import { formatDate } from '@/utils/date'; | import { formatDate } from '@/utils/date'; | ||||
| import { getExperimentInstanceStatus, getWorkflowStatus } from '@/utils/experiment'; | |||||
| import { getWorkflowStatus } from '@/utils/experiment'; | |||||
| import { Typography } from 'antd'; | import { Typography } from 'antd'; | ||||
| import React, { useCallback } from 'react'; | import React, { useCallback } from 'react'; | ||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| @@ -18,7 +18,7 @@ function ExperimentInstanceComponent({ instance }: ExperimentInstanceComponentPr | |||||
| const { id, experiment_id, argo_ins_name, argo_ins_ns, nodes_status, create_time, finish_time } = | const { id, experiment_id, argo_ins_name, argo_ins_ns, nodes_status, create_time, finish_time } = | ||||
| instance; | instance; | ||||
| const workflowStatus = getWorkflowStatus(nodes_status) as NodeStatus | undefined; | const workflowStatus = getWorkflowStatus(nodes_status) as NodeStatus | undefined; | ||||
| const status = getExperimentInstanceStatus(instance.status as ExperimentStatus); | |||||
| const status = instance.status as ExperimentStatus; | |||||
| const createTime = workflowStatus?.startedAt ?? create_time; | const createTime = workflowStatus?.startedAt ?? create_time; | ||||
| const finishTime = workflowStatus?.finishedAt ?? finish_time; | const finishTime = workflowStatus?.finishedAt ?? finish_time; | ||||
| const statusInfo = experimentStatusInfo[status]; | const statusInfo = experimentStatusInfo[status]; | ||||
| @@ -435,6 +435,7 @@ function Experiment() { | |||||
| // 实验实例终止 | // 实验实例终止 | ||||
| const handleInstanceTerminate = async (experimentIn) => { | const handleInstanceTerminate = async (experimentIn) => { | ||||
| // 修改实例的状态和结束时间 | |||||
| setExperimentInsList((prevList) => { | setExperimentInsList((prevList) => { | ||||
| return prevList.map((item) => { | return prevList.map((item) => { | ||||
| if (item.id === experimentIn.id) { | if (item.id === experimentIn.id) { | ||||
| @@ -447,7 +448,7 @@ function Experiment() { | |||||
| return item; | return item; | ||||
| }); | }); | ||||
| }); | }); | ||||
| // 刷新实验列表 | |||||
| // 刷新实验列表和实例列表 | |||||
| refreshExperimentList(true); | refreshExperimentList(true); | ||||
| refreshExperimentIns(experimentIn.experiment_id); | refreshExperimentIns(experimentIn.experiment_id); | ||||
| }; | }; | ||||
| @@ -474,7 +475,7 @@ function Experiment() { | |||||
| // 加载更多实验实例 | // 加载更多实验实例 | ||||
| const loadMoreExperimentIns = () => { | const loadMoreExperimentIns = () => { | ||||
| const page = Math.round(experimentInsList.length / 5); | const page = Math.round(experimentInsList.length / 5); | ||||
| getExperimentInsList(expandedRowKeys, page, 5); | |||||
| getExperimentInsList(expandedRowKeys[0], page, 5); | |||||
| }; | }; | ||||
| // 处理删除 | // 处理删除 | ||||