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/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/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/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/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/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'; diff --git a/react-ui/src/pages/AutoML/Instance/index.tsx b/react-ui/src/pages/AutoML/Instance/index.tsx index 60cc2142..933b496e 100644 --- a/react-ui/src/pages/AutoML/Instance/index.tsx +++ b/react-ui/src/pages/AutoML/Instance/index.tsx @@ -28,7 +28,6 @@ function AutoMLInstance() { const [autoMLInfo, setAutoMLInfo] = useState(undefined); const [instanceInfo, setInstanceInfo] = useState(undefined); const params = useParams(); - // const autoMLId = safeInvoke(Number)(params.autoMLId); const instanceId = safeInvoke(Number)(params.id); const evtSourceRef = useRef(null); @@ -187,6 +186,7 @@ function AutoMLInstance() { icon: , children: ( diff --git a/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx index 09d0cd6e..0441a623 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx @@ -8,8 +8,9 @@ import TrialStatusCell from '../TrialStatusCell'; import styles from './index.less'; type ExperimentHistoryProps = { - fileUrl?: string; - isClassification: boolean; + calcMetrics?: string; // 计算指标 + fileUrl?: string; // 文件url + isClassification: boolean; // 是否是分类 }; type TableData = { @@ -22,7 +23,7 @@ type TableData = { althorithm?: string; }; -function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps) { +function ExperimentHistory({ calcMetrics, fileUrl, isClassification }: ExperimentHistoryProps) { const [tableData, setTableData] = useState([]); useEffect(() => { // 获取实验运行历史记录 @@ -33,7 +34,7 @@ function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps const list: TableData[] = data.map((item) => { return { id: item[0]?.[0], - accuracy: item[1]?.[5]?.accuracy, + accuracy: calcMetrics ? item[1]?.[5]?.[calcMetrics] : undefined, duration: item[1]?.[5]?.duration, train_loss: item[1]?.[5]?.train_loss, status: item[1]?.[2]?.['__enum__']?.split('.')?.[1], @@ -64,12 +65,6 @@ function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps width: 80, render: tableCellRender(false), }, - { - title: '准确率', - dataIndex: 'accuracy', - key: 'accuracy', - render: tableCellRender(true), - }, { title: '耗时', dataIndex: 'duration', @@ -103,6 +98,15 @@ function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps }, ]; + if (calcMetrics) { + columns.splice(0, 0, { + title: `指标:${calcMetrics}`, + dataIndex: 'accuracy', + key: 'accuracy', + render: tableCellRender(true), + }); + } + return (
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/AutoML/components/ExperimentList/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx index b4e7f24b..e2f9d31c 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx @@ -188,6 +188,7 @@ function ExperimentList({ type }: ExperimentListProps) { if (expanded) { setExpandedRowKeys([record.id]); getExperimentInsList(record.id, 0); + refreshExperimentList(); } else { setExpandedRowKeys([]); } 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} +
diff --git a/react-ui/src/pages/Dataset/components/AddDatasetModal/index.tsx b/react-ui/src/pages/Dataset/components/AddDatasetModal/index.tsx index db05393e..883e20c7 100644 --- a/react-ui/src/pages/Dataset/components/AddDatasetModal/index.tsx +++ b/react-ui/src/pages/Dataset/components/AddDatasetModal/index.tsx @@ -159,27 +159,42 @@ function AddDatasetModal({ typeList, tagList, onOk, ...rest }: AddDatasetModalPr showSearch /> - {/* - @@ -174,33 +180,33 @@ function MirrorCreate() { rules={[ { required: true, - message: '请输入镜像Tag', + message: '请输入镜像版本', }, { pattern: /^[a-zA-Z0-9._-]+$/, - message: '版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', + message: '镜像版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', }, ]} > - + )}