|
|
|
@@ -27,6 +27,7 @@ function ExperimentText() { |
|
|
|
const [paramsModalOpen, openParamsModal, closeParamsModal] = useVisible(false); |
|
|
|
const [propsDrawerOpen, openPropsDrawer, closePropsDrawer, propsDrawerOpenRef] = |
|
|
|
useVisible(false); |
|
|
|
const [currentDate, setCurrentDate] = useState(); |
|
|
|
const navigate = useNavigate(); |
|
|
|
const evtSourceRef = useRef(); |
|
|
|
const width = 110; |
|
|
|
@@ -59,6 +60,19 @@ function ExperimentText() { |
|
|
|
}; |
|
|
|
}, []); |
|
|
|
|
|
|
|
// 定时刷新耗时 |
|
|
|
useEffect(() => { |
|
|
|
if (experimentIns && !experimentIns.finish_time) { |
|
|
|
const timer = setInterval(() => { |
|
|
|
setCurrentDate(new Date()); |
|
|
|
console.log('定时刷新'); |
|
|
|
}, 1000); |
|
|
|
return () => { |
|
|
|
clearInterval(timer); |
|
|
|
}; |
|
|
|
} |
|
|
|
}, [experimentIns]); |
|
|
|
|
|
|
|
// 获取流水线模版 |
|
|
|
const getWorkflow = async () => { |
|
|
|
const [res] = await to(getWorkflowById(locationParams.workflowId)); |
|
|
|
@@ -85,7 +99,8 @@ function ExperimentText() { |
|
|
|
const [res] = await to(getExperimentIns(locationParams.id)); |
|
|
|
if (res && res.data && workflowRef.current) { |
|
|
|
setExperimentIns(res.data); |
|
|
|
const { status, nodes_status, argo_ins_ns, argo_ins_name } = res.data; |
|
|
|
const { status, nodes_status, argo_ins_ns, argo_ins_name, finish_time } = res.data; |
|
|
|
setCurrentDate(new Date(finish_time)); |
|
|
|
const workflowData = workflowRef.current; |
|
|
|
const experimentStatusObjs = parseJsonText(nodes_status); |
|
|
|
workflowData.nodes.forEach((item) => { |
|
|
|
|