From ef9a78b167c8d2b083e6e44dcd2644820b337b34 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Fri, 23 May 2025 15:31:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=9C=80=E8=BF=91=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dataset/components/ResourceItem/index.tsx | 4 +- react-ui/src/pages/Dataset/config.tsx | 1 + .../ModelDeployment/VersionInfo/index.tsx | 48 ++++++++++--------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx b/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx index a9025a98..e3d4d3bb 100644 --- a/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx @@ -14,9 +14,7 @@ type ResourceItemProps = { }; function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) { - const timeAgo = `更新于${ - item.update_time ? formatDate(item.update_time, 'YYYY-MM-DD') : item.time_ago ?? '' - }`; + const timeAgo = `最近更新:${formatDate(item.full_last_update_time, 'YYYY-MM-DD HH:mm')}`; const create_by = item.create_by ?? ''; return (
onClick(item)}> diff --git a/react-ui/src/pages/Dataset/config.tsx b/react-ui/src/pages/Dataset/config.tsx index af1993b9..4799c75c 100644 --- a/react-ui/src/pages/Dataset/config.tsx +++ b/react-ui/src/pages/Dataset/config.tsx @@ -164,6 +164,7 @@ export interface ResourceData { train_task?: TrainTask; // 训练任务 praises_count: number; // 点赞数 praised: boolean; // 是否点赞 + full_last_update_time: string; // 完整的更新时间 } // 数据集数据 diff --git a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx index 0729631d..ad59fd23 100644 --- a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx @@ -52,30 +52,32 @@ function ServiceVersionInfo() { }, ]; - if (versionInfo?.run_state === ServiceRunStatus.Running && versionInfo?.page_path) { - tabItems.push({ - key: ModelDeploymentTabKey.Predict, - label: '预测', - icon: , - children: ( -
- -
- ), - }); - } + if (versionInfo?.run_state === ServiceRunStatus.Running) { + if (versionInfo?.page_path) { + tabItems.push({ + key: ModelDeploymentTabKey.Predict, + label: '预测', + icon: , + children: ( +
+ +
+ ), + }); + } - if (versionInfo?.doc_path) { - tabItems.push({ - key: ModelDeploymentTabKey.Guide, - label: '调用指南', - icon: , - children: ( -
- -
- ), - }); + if (versionInfo?.doc_path) { + tabItems.push({ + key: ModelDeploymentTabKey.Guide, + label: '调用指南', + icon: , + children: ( +
+ +
+ ), + }); + } } tabItems.push({ From 0bace90a2349cccc51e722e8a93697691317792e Mon Sep 17 00:00:00 2001 From: zhaowei Date: Fri, 23 May 2025 15:46:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=85=A8=E5=B1=80=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=84=B1=E6=95=8F=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AddExperimentModal/index.tsx | 19 ++++++------------- .../components/ViewParamsModal/index.tsx | 5 +---- .../components/GlobalParamsDrawer/index.tsx | 4 ++-- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/react-ui/src/pages/Experiment/components/AddExperimentModal/index.tsx b/react-ui/src/pages/Experiment/components/AddExperimentModal/index.tsx index 710a4df4..cdc5d577 100644 --- a/react-ui/src/pages/Experiment/components/AddExperimentModal/index.tsx +++ b/react-ui/src/pages/Experiment/components/AddExperimentModal/index.tsx @@ -30,7 +30,7 @@ interface Workflow { } // 根据参数设置输入组件 -export const getParamComponent = (paramType: number, isSensitive?: number): JSX.Element => { +export const getParamComponent = (paramType: number): JSX.Element => { // 防止后台返回不是 number 类型 if (Number(paramType) === 3) { return ( @@ -40,9 +40,9 @@ export const getParamComponent = (paramType: number, isSensitive?: number): JSX. ); } - if (isSensitive && Number(isSensitive) === 1) { - return ; - } + // if (isSensitive && Number(isSensitive) === 1) { + // return ; + // } return ; }; @@ -202,11 +202,7 @@ function AddExperimentModal({ {globalParam.length > 0 && ( - +
{(fields) => @@ -219,10 +215,7 @@ function AddExperimentModal({ name={[name, 'param_value']} rules={getParamRules(globalParam[name]['param_type'], true)} > - {getParamComponent( - globalParam[name]['param_type'], - globalParam[name]['is_sensitive'], - )} + {getParamComponent(globalParam[name]['param_type'])} )) } diff --git a/react-ui/src/pages/Experiment/components/ViewParamsModal/index.tsx b/react-ui/src/pages/Experiment/components/ViewParamsModal/index.tsx index 8bd49817..3ad671a4 100644 --- a/react-ui/src/pages/Experiment/components/ViewParamsModal/index.tsx +++ b/react-ui/src/pages/Experiment/components/ViewParamsModal/index.tsx @@ -47,10 +47,7 @@ function ParamsModal({ open, onCancel, globalParam = [] }: ParamsModalProps) { name={[name, 'param_value']} label={getParamLabel(globalParam[name])} > - {getParamComponent( - globalParam[name]['param_type'], - globalParam[name]['is_sensitive'], - )} + {getParamComponent(globalParam[name]['param_type'])} )) } diff --git a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx index 669f21aa..da764698 100644 --- a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx +++ b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx @@ -148,7 +148,7 @@ const GlobalParamsDrawer = forwardRef( > {getParamComponent(type)} - {type !== 3 && ( + {/* {type !== 3 && ( - )} + )} */} ); }}