From dd4be07a26ad1db10a0f5bdccd01f2045892dfa8 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Mon, 24 Mar 2025 11:00:23 +0800 Subject: [PATCH 01/13] =?UTF-8?q?chore:=20=E5=AE=89=E8=A3=85=20caniuse-lit?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/package.json | 1 + react-ui/src/components/ResourceSelect/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/react-ui/package.json b/react-ui/package.json index de0314c2..e4d95504 100644 --- a/react-ui/package.json +++ b/react-ui/package.json @@ -67,6 +67,7 @@ "@types/crypto-js": "^4.2.2", "@umijs/route-utils": "^4.0.1", "antd": "~5.21.4", + "caniuse-lite": "~1.0.30001707", "classnames": "^2.3.2", "crypto-js": "^4.2.0", "echarts": "^5.5.0", diff --git a/react-ui/src/components/ResourceSelect/index.tsx b/react-ui/src/components/ResourceSelect/index.tsx index a7e02ce3..ccec75f1 100644 --- a/react-ui/src/components/ResourceSelect/index.tsx +++ b/react-ui/src/components/ResourceSelect/index.tsx @@ -6,7 +6,7 @@ import KFIcon from '@/components/KFIcon'; import ResourceSelectorModal, { - ResourceSelectorResponse, + type ResourceSelectorResponse, ResourceSelectorType, selectorTypeConfig, } from '@/components/ResourceSelectorModal'; From 400108a4b8aed4107357c86e4f9096259918975e Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Mon, 24 Mar 2025 14:29:51 +0800 Subject: [PATCH 02/13] =?UTF-8?q?styles:=20=E5=B7=A5=E4=BD=9C=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/AutoML/components/ExperimentInstance/index.tsx | 2 +- .../pages/Workspace/components/TotalStatistics/index.less | 8 +++++++- react-ui/src/pages/Workspace/index.less | 8 ++++++-- react-ui/src/pages/Workspace/index.tsx | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx index aded5f2a..e7837120 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentInstance/index.tsx @@ -107,7 +107,7 @@ function ExperimentInstanceComponent({ }; if (!experimentInsList || experimentInsList.length === 0) { - return
暂无实验实例
; + return
暂无数据
; } return ( diff --git a/react-ui/src/pages/Workspace/components/TotalStatistics/index.less b/react-ui/src/pages/Workspace/components/TotalStatistics/index.less index 0fdef0b0..34aa2a67 100644 --- a/react-ui/src/pages/Workspace/components/TotalStatistics/index.less +++ b/react-ui/src/pages/Workspace/components/TotalStatistics/index.less @@ -1,12 +1,18 @@ .total-statistics { display: flex; align-items: center; + justify-content: center; height: 140px; padding: 0 16px; + // 媒体查询 + @media screen and (max-width: 1600px) { + flex: 1 1 content; + } + &__icon { width: 63px; - margin-right: 15px; + margin-right: 16px; } &__title { diff --git a/react-ui/src/pages/Workspace/index.less b/react-ui/src/pages/Workspace/index.less index d498e652..59ea0a44 100644 --- a/react-ui/src/pages/Workspace/index.less +++ b/react-ui/src/pages/Workspace/index.less @@ -8,7 +8,6 @@ &__overview { flex: 1; gap: 15px; - margin-bottom: 16px; padding: 20px 30px; background-color: white; border-radius: 4px; @@ -22,7 +21,6 @@ &__content { display: flex; - flex-wrap: wrap; gap: 15px; align-items: center; @@ -35,6 +33,11 @@ rgba(22, 100, 255, 0.02) 58.35% ); border-radius: 4px; + + // 媒体查询 + @media screen and (max-width: 1600px) { + flex: 1 1 content; + } } } } @@ -44,6 +47,7 @@ gap: 15px; align-items: flex-start; width: 100%; + margin-top: 16px; } &__user { diff --git a/react-ui/src/pages/Workspace/index.tsx b/react-ui/src/pages/Workspace/index.tsx index efda7e70..b88f3d58 100644 --- a/react-ui/src/pages/Workspace/index.tsx +++ b/react-ui/src/pages/Workspace/index.tsx @@ -46,7 +46,7 @@ function Workspace() { return (
- +
运行概览
@@ -59,7 +59,7 @@ function Workspace() { Date: Mon, 24 Mar 2025 17:19:51 +0800 Subject: [PATCH 03/13] =?UTF-8?q?feat:=20=E5=AE=9E=E9=AA=8C=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E6=B7=BB=E5=8A=A0message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/public/fonts/font.css | 10 ---------- react-ui/src/components/IFramePage/index.tsx | 3 --- .../components/ExperimentDrawer/index.less | 1 - .../components/ExperimentDrawer/index.tsx | 14 +++++++++++++- react-ui/src/pages/Points/index.tsx | 5 +++++ react-ui/src/types.ts | 1 + 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/react-ui/public/fonts/font.css b/react-ui/public/fonts/font.css index 06af2fdb..012b9f59 100644 --- a/react-ui/public/fonts/font.css +++ b/react-ui/public/fonts/font.css @@ -4,16 +4,6 @@ font-display: swap; } -@font-face { - font-family: 'TaoBaoMaiCaiTi'; - src: url('./TaoBaoMaiCaiTi-Regular.woff2') format('woff2'), /* 最优先使用 woff2 */ - url('./TaoBaoMaiCaiTi-Regular.woff') format('woff'), /* 兼容性较好的 woff */ - url('./TaoBaoMaiCaiTi-Regular.ttf') format('truetype'), /* ttf 作为备选 */ - url('./TaoBaoMaiCaiTi-Regular.otf') format('opentype'); /* otf 作为最后选项 */ - font-display: swap; /* 优化页面加载时的字体显示 */ -} - - @font-face { font-family: 'DingTalk-JinBuTi'; src: url('./DingTalk-JinBuTi.woff2') format('woff2'), /* 最优先使用 woff2 */ diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx index aa292d47..6a1ddbdc 100644 --- a/react-ui/src/components/IFramePage/index.tsx +++ b/react-ui/src/components/IFramePage/index.tsx @@ -48,12 +48,9 @@ function IframePage({ type, className, style }: IframePageProps) { useEffect(() => { const requestIframeUrl = async () => { - setLoading(true); const [res] = await to(getRequestAPI(type)()); if (res && res.data) { setIframeUrl(res.data); - } else { - setLoading(false); } }; diff --git a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less index e524a987..4f45b3f8 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less +++ b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.less @@ -13,7 +13,6 @@ } &__tabs { - height: calc(100% - 169px); :global { .ant-tabs-nav { padding-left: 24px; diff --git a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx index c1a70141..8326ae8d 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx +++ b/react-ui/src/pages/Experiment/components/ExperimentDrawer/index.tsx @@ -129,6 +129,11 @@ const ExperimentDrawer = ({ '--' )}
+ {instanceNodeData.message && ( +
+ 消息:{instanceNodeData.message ?? '--'} +
+ )}
启动时间:{formatDate(instanceNodeStartTime)}
@@ -137,7 +142,14 @@ const ExperimentDrawer = ({ {elapsedTime(instanceNodeStartTime, instanceNodeEndTime)}
- + ); }; diff --git a/react-ui/src/pages/Points/index.tsx b/react-ui/src/pages/Points/index.tsx index 20843820..0fa3a1d8 100644 --- a/react-ui/src/pages/Points/index.tsx +++ b/react-ui/src/pages/Points/index.tsx @@ -216,6 +216,11 @@ function PointsDetail() { label: '进行中', color: themes['primaryColor'], }, + { + value: 0, + label: '准备中', + color: themes['pendingColor'], + }, ]), }, ]; diff --git a/react-ui/src/types.ts b/react-ui/src/types.ts index f9d1734b..e3c219ee 100644 --- a/react-ui/src/types.ts +++ b/react-ui/src/types.ts @@ -71,6 +71,7 @@ export type PipelineNodeModel = { component_label: string; icon_path: string; workflowId?: string; + message?: string; }; // 流水线节点模型数据 From 29e19dfbe405585a134ab605315f68fe108fd7f6 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 09:28:48 +0800 Subject: [PATCH 04/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=8D=E5=8A=A1=E7=89=88=E6=9C=AC=E6=9C=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=95=B0=E9=87=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/ModelDeployment/ServiceInfo/index.less | 1 + .../src/pages/ModelDeployment/ServiceInfo/index.tsx | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less index a8c3ce14..13c224f4 100644 --- a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less +++ b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.less @@ -18,6 +18,7 @@ &__table { flex: 1; + min-height: 0; margin-top: 24px; } } diff --git a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx index 124d4627..57b4bd91 100644 --- a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx @@ -133,17 +133,18 @@ function ServiceInfo() { if (res) { message.success('删除成功'); // 如果是一页的唯一数据,删除时,请求第一页的数据 - // 否则直接刷新这一页的数据 - // 避免回到第一页 - if (tableData.length > 1) { + // 否则直接刷新这一页的数据,避免回到第一页 + if (tableData.length === 1) { setPagination((prev) => ({ ...prev, current: 1, })); } else { - getServiceInfo(); - getServiceVersions(); + setPagination((prev) => ({ + ...prev, + })); } + getServiceInfo(); } }; From 5f05931356e722f23d6c194c59375fbe7d1b97fe Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 09:43:13 +0800 Subject: [PATCH 05/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E9=95=BF0=E5=88=8629=E7=A7=92=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA29=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/utils/date.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/react-ui/src/utils/date.ts b/react-ui/src/utils/date.ts index fbc83e35..97e7f32d 100644 --- a/react-ui/src/utils/date.ts +++ b/react-ui/src/utils/date.ts @@ -41,7 +41,10 @@ export const elapsedTime = (begin?: string | null, end?: string | null): string if (hours !== 0) { return `${hours}小时${minutes}分`; } - return `${minutes}分${seconds}秒`; + if (minutes !== 0) { + return `${minutes}分${seconds}秒`; + } + return `${seconds}秒`; }; /** From f4833d69de2248ab749a20ef6ba8ac7540a9a5b7 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 10:28:40 +0800 Subject: [PATCH 06/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=85=8D=E7=BD=AEtag=E5=A4=AA=E9=95=BF=E6=BA=A2?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/CodeConfigItem/index.tsx | 15 +++++++++++++-- .../components/CodeConfigItem/index.tsx | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/react-ui/src/components/CodeConfigItem/index.tsx b/react-ui/src/components/CodeConfigItem/index.tsx index 673bca40..ff48368c 100644 --- a/react-ui/src/components/CodeConfigItem/index.tsx +++ b/react-ui/src/components/CodeConfigItem/index.tsx @@ -2,6 +2,7 @@ import { AvailableRange } from '@/enums'; import { type CodeConfigData } from '@/pages/CodeConfig/List'; import { Flex, Typography } from 'antd'; import classNames from 'classnames'; +import { useState } from 'react'; import styles from './index.less'; type CodeConfigItemProps = { @@ -10,6 +11,7 @@ type CodeConfigItemProps = { }; function CodeConfigItem({ item, onClick }: CodeConfigItemProps) { + const [isEllipsis, setIsEllipsis] = useState(false); return (
onClick?.(item)}> @@ -32,11 +34,20 @@ function CodeConfigItem({ item, onClick }: CodeConfigItemProps) { setIsEllipsis(ellipsis), + }} > {item.git_url} -
{item.git_branch}
+ + {item.git_branch} +
); } diff --git a/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx b/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx index de903f47..fd9c967d 100644 --- a/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx +++ b/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx @@ -70,7 +70,12 @@ function CodeConfigItem({ item, onClick, onEdit, onRemove }: CodeConfigItemProps > {item.git_url} -
{item.git_branch}
+ + {item.git_branch} +
From 30e7c6193af9deb0bb24626f3028a0bf023b69bc Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 11:45:46 +0800 Subject: [PATCH 07/13] =?UTF-8?q?fix:=20=E9=95=9C=E5=83=8F=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/config/routes.ts | 13 ++++++++++- react-ui/src/pages/Mirror/Create/index.tsx | 20 ++++++++--------- react-ui/src/pages/Mirror/Info/index.tsx | 19 +++++++++++----- react-ui/src/pages/Mirror/List/index.tsx | 6 ++--- react-ui/src/utils/table.tsx | 26 ++++++++++++++-------- 5 files changed, 55 insertions(+), 29 deletions(-) diff --git a/react-ui/config/routes.ts b/react-ui/config/routes.ts index a45883ab..bf51980e 100644 --- a/react-ui/config/routes.ts +++ b/react-ui/config/routes.ts @@ -271,7 +271,18 @@ export default [ { name: '镜像详情', path: 'info/:id', - component: './Mirror/Info', + routes: [ + { + name: '镜像详情', + path: '', + component: './Mirror/Info', + }, + { + name: '新增镜像版本', + path: 'add-version', + component: './Mirror/Create', + }, + ], }, { name: '创建镜像', diff --git a/react-ui/src/pages/Mirror/Create/index.tsx b/react-ui/src/pages/Mirror/Create/index.tsx index 7db2f4d0..cab4289b 100644 --- a/react-ui/src/pages/Mirror/Create/index.tsx +++ b/react-ui/src/pages/Mirror/Create/index.tsx @@ -44,7 +44,7 @@ const mirrorRadioItems: KFRadioItem[] = [ function MirrorCreate() { const navigate = useNavigate(); const [form] = Form.useForm(); - const [nameDisabled, setNameDisabled] = useState(false); + const [isAddVersion, setIsAddVersion] = useState(false); // 是制作镜像还是新增镜像版本 const { message } = App.useApp(); const uploadProps: UploadProps = { @@ -60,7 +60,7 @@ function MirrorCreate() { const name = SessionStorage.getItem(SessionStorage.mirrorNameKey); if (name) { form.setFieldValue('name', name); - setNameDisabled(true); + setIsAddVersion(true); } return () => { SessionStorage.removeItem(SessionStorage.mirrorNameKey); @@ -120,7 +120,7 @@ function MirrorCreate() { return (
- +
@@ -174,22 +174,22 @@ function MirrorCreate() { rules={[ { required: true, - message: '请输入镜像Tag', + message: '请输入镜像版本', }, { pattern: /^[a-zA-Z0-9._-]+$/, - message: '版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', + message: '镜像版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', }, ]} > - + )}