diff --git a/react-ui/src/app.tsx b/react-ui/src/app.tsx index 686c495d..91b0389b 100644 --- a/react-ui/src/app.tsx +++ b/react-ui/src/app.tsx @@ -21,6 +21,7 @@ import { } from './services/session'; import './styles/menu.less'; import { needAuth } from './utils'; +// import { closeAllModals } from './utils/modal'; import { gotoLoginPage } from './utils/ui'; export { requestConfig as request } from './requestConfig'; @@ -96,6 +97,7 @@ export const layout: RuntimeConfig['layout'] = ({ initialState }) => { }, onPageChange: () => { const { location } = history; + // closeAllModals(); // 如果没有登录,重定向到 login if (!initialState?.currentUser && needAuth(location.pathname)) { gotoLoginPage(); diff --git a/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx index edb66534..2bd39c29 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx +++ b/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx @@ -11,9 +11,15 @@ type ExperimentParameterProps = { function ExperimentParameter({ nodeData }: ExperimentParameterProps) { // 控制策略 - const controlStrategyList = Object.entries(nodeData.control_strategy ?? {}).map( - ([key, value]) => ({ key, value }), - ); + // const controlStrategyList = Object.entries(nodeData.control_strategy ?? {}).map( + // ([key, value]) => ({ key, value }), + // ); + const nodeId = nodeData.id; + const hasTaskInfo = + nodeId && + !nodeId.startsWith('git-clone') && + !nodeId.startsWith('dataset-export') && + !nodeId.startsWith('model-export'); // 输入参数 const inParametersList = Object.entries(nodeData.in_parameters ?? {}).map(([key, value]) => ({ @@ -74,54 +80,58 @@ function ExperimentParameter({ nodeData }: ExperimentParameterProps) { > -
- -
- - - - - - + {hasTaskInfo && ( + <> +
+ +
+ + + + + + - - - - - - - - - - - - - {controlStrategyList.map((item) => ( - - - - ))} + + + + + + + {/* + + */} + + + + {/* {controlStrategyList.map((item) => ( + + + + ))} */} + + )}
( {} as PipelineNodeModelSerialize, ); + const nodeId = Form.useWatch('id', form) as string; + const hasTaskInfo = + nodeId && + !nodeId.startsWith('git-clone') && + !nodeId.startsWith('dataset-export') && + !nodeId.startsWith('model-export'); const [open, setOpen] = useState(false); const [menuItems, setMenuItems] = useState([]); @@ -46,10 +52,11 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete const fields = form.getFieldsValue(); // 保存字段顺序 - const control_strategy = { - ...stagingItem.control_strategy, - ...fields.control_strategy, - }; + // const control_strategy = { + // ...stagingItem.control_strategy, + // ...fields.control_strategy, + // }; + const in_parameters = { ...stagingItem.in_parameters, ...fields.in_parameters, @@ -64,7 +71,7 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete const res = { ...stagingItem, ...fields, - control_strategy: JSON.stringify(control_strategy), + // control_strategy: JSON.stringify(control_strategy), in_parameters: JSON.stringify(in_parameters), out_parameters: JSON.stringify(out_parameters), formError: !!error, @@ -91,7 +98,7 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete ...model, in_parameters: JSON.parse(model.in_parameters), out_parameters: JSON.parse(model.out_parameters), - control_strategy: JSON.parse(model.control_strategy), + // control_strategy: JSON.parse(model.control_strategy), }; // console.log('model', nodeData); setStagingItem({ @@ -348,9 +355,9 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete }; // 控制策略 - const controlStrategyList = Object.entries(stagingItem.control_strategy ?? {}).map( - ([key, value]) => ({ key, value }), - ); + // const controlStrategyList = Object.entries(stagingItem.control_strategy ?? {}).map( + // ([key, value]) => ({ key, value }), + // ); // 输入参数 const inParametersList = Object.entries(stagingItem.in_parameters ?? {}).map(([key, value]) => ({ @@ -422,71 +429,73 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete > -
- -
- -
- - + {hasTaskInfo && ( + <> +
+ +
+ +
+ + + + + + +
- - + { + handleParameterClick('working_directory', value); + }} + /> + } + > + -
-
- { - handleParameterClick('working_directory', value); - }} - /> - } - > - - - { - handleParameterClick('command', value); - }} - /> - } - > -