From ef9a78b167c8d2b083e6e44dcd2644820b337b34 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Fri, 23 May 2025 15:31:48 +0800 Subject: [PATCH] =?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({