+
);
}
diff --git a/react-ui/src/components/LabelValue/index.less b/react-ui/src/components/LabelValue/index.less
deleted file mode 100644
index 5f1b9b0c..00000000
--- a/react-ui/src/components/LabelValue/index.less
+++ /dev/null
@@ -1,19 +0,0 @@
-.kf-label-value {
- display: flex;
- align-items: flex-start;
- font-size: 16px;
- line-height: 1.6;
-
- &__label {
- flex: none;
- width: 80px;
- color: @text-color-secondary;
- }
-
- &__value {
- flex: 1;
- color: @text-color;
- white-space: pre-line;
- word-break: break-all;
- }
-}
diff --git a/react-ui/src/components/LabelValue/index.tsx b/react-ui/src/components/LabelValue/index.tsx
deleted file mode 100644
index 22b9b3eb..00000000
--- a/react-ui/src/components/LabelValue/index.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import classNames from 'classnames';
-import './index.less';
-
-type labelValueProps = {
- label: string;
- value?: any;
- className?: string;
- style?: React.CSSProperties;
-};
-
-function LabelValue({ label, value, className, style }: labelValueProps) {
- return (
-
-
{label}
-
{value ?? '--'}
-
- );
-}
-
-export default LabelValue;
diff --git a/react-ui/src/components/MenuIconSelector/index.less b/react-ui/src/components/MenuIconSelector/index.less
index 77529762..5a64a8d3 100644
--- a/react-ui/src/components/MenuIconSelector/index.less
+++ b/react-ui/src/components/MenuIconSelector/index.less
@@ -1,5 +1,4 @@
.menu-icon-selector {
- // grid 布局,每行显示 8 个图标
display: grid;
grid-template-columns: repeat(4, 80px);
gap: 20px;
@@ -10,7 +9,7 @@
display: flex;
align-items: center;
justify-content: center;
- width: 80x;
+ width: 80px;
height: 80px;
border: 1px solid transparent;
border-radius: 4px;
diff --git a/react-ui/src/components/MenuIconSelector/index.tsx b/react-ui/src/components/MenuIconSelector/index.tsx
index dd57320e..fa38910b 100644
--- a/react-ui/src/components/MenuIconSelector/index.tsx
+++ b/react-ui/src/components/MenuIconSelector/index.tsx
@@ -12,7 +12,9 @@ import { useEffect, useState } from 'react';
import styles from './index.less';
interface MenuIconSelectorProps extends Omit
{
+ /** 选中的图标 */
selectedIcon?: string;
+ /** 选择回调 */
onOk: (param: string) => void;
}
@@ -21,6 +23,7 @@ type IconObject = {
font_class: string;
};
+/** 菜单图标选择器 */
function MenuIconSelector({ open, selectedIcon, onOk, ...rest }: MenuIconSelectorProps) {
const [icons, setIcons] = useState([]);
useEffect(() => {
diff --git a/react-ui/src/components/PageTitle/index.tsx b/react-ui/src/components/PageTitle/index.tsx
index ca192454..ea8a65de 100644
--- a/react-ui/src/components/PageTitle/index.tsx
+++ b/react-ui/src/components/PageTitle/index.tsx
@@ -8,10 +8,17 @@ import React from 'react';
import './index.less';
type PageTitleProps = {
+ /** 标题 */
title: string;
+ /** 自定义类名 */
className?: string;
+ /** 自定义样式 */
style?: React.CSSProperties;
};
+
+/**
+ * 页面标题
+ */
function PageTitle({ title, style, className = '' }: PageTitleProps) {
return (
diff --git a/react-ui/src/components/RightContent/index.tsx b/react-ui/src/components/RightContent/index.tsx
index 3ecb5777..9b84950a 100644
--- a/react-ui/src/components/RightContent/index.tsx
+++ b/react-ui/src/components/RightContent/index.tsx
@@ -1,9 +1,8 @@
-import { useModel } from '@umijs/max';
-import React from 'react';
-// import KFBreadcrumb from '../KFBreadcrumb';
import KFIcon from '@/components/KFIcon';
import { ProBreadcrumb } from '@ant-design/pro-components';
+import { useModel } from '@umijs/max';
import { Button } from 'antd';
+import React from 'react';
import Avatar from './AvatarDropdown';
import styles from './index.less';
// import { SelectLang } from '@umijs/max';
@@ -44,8 +43,6 @@ const GlobalHeaderRight: React.FC = () => {
- {/*
*/}
-
{/*
*/}
diff --git a/react-ui/src/components/SubAreaTitle/index.tsx b/react-ui/src/components/SubAreaTitle/index.tsx
index cd07b206..4c94deee 100644
--- a/react-ui/src/components/SubAreaTitle/index.tsx
+++ b/react-ui/src/components/SubAreaTitle/index.tsx
@@ -8,13 +8,20 @@ import classNames from 'classnames';
import './index.less';
type SubAreaTitleProps = {
+ /** 标题 */
title: string;
+ /** 图片 */
image?: string;
- style?: React.CSSProperties;
+ /** 自定义类名 */
className?: string;
+ /** 自定义样式 */
+ style?: React.CSSProperties;
};
-function SubAreaTitle({ title, image, style, className }: SubAreaTitleProps) {
+/**
+ * 表单或者详情页的分区标题
+ */
+function SubAreaTitle({ title, image, className, style }: SubAreaTitleProps) {
return (
{image && (
diff --git a/react-ui/src/pages/404.tsx b/react-ui/src/pages/404.tsx
index dbacba53..d6f45451 100644
--- a/react-ui/src/pages/404.tsx
+++ b/react-ui/src/pages/404.tsx
@@ -12,7 +12,7 @@ const NoFoundPage = () => {
content={'很抱歉,您访问的页面地址有误,\n或者该页面不存在。'}
hasFooter={true}
buttonTitle="返回首页"
- onRefresh={() => navigate('/')}
+ onButtonClick={() => navigate('/')}
>
);
};
diff --git a/react-ui/src/pages/CodeConfig/List/index.tsx b/react-ui/src/pages/CodeConfig/List/index.tsx
index 2efef04c..0c484e54 100644
--- a/react-ui/src/pages/CodeConfig/List/index.tsx
+++ b/react-ui/src/pages/CodeConfig/List/index.tsx
@@ -197,7 +197,7 @@ function CodeConfigList() {
title="暂无数据"
content={'很抱歉,没有搜索到您想要的内容\n建议刷新试试'}
hasFooter={true}
- onRefresh={getDataList}
+ onButtonClick={getDataList}
/>
)}
diff --git a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx
index 6f2c7523..9577ad41 100644
--- a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx
+++ b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx
@@ -226,7 +226,7 @@ function ResourceList(
title="暂无数据"
content={'很抱歉,没有搜索到您想要的内容\n建议刷新试试'}
hasFooter={true}
- onRefresh={getDataList}
+ onButtonClick={getDataList}
/>
)}
diff --git a/react-ui/src/pages/DevelopmentEnvironment/Create/index.tsx b/react-ui/src/pages/DevelopmentEnvironment/Create/index.tsx
index 90ad4d15..1a0b9a18 100644
--- a/react-ui/src/pages/DevelopmentEnvironment/Create/index.tsx
+++ b/react-ui/src/pages/DevelopmentEnvironment/Create/index.tsx
@@ -36,13 +36,13 @@ enum ComputingResourceType {
const EditorRadioItems: KFRadioItem[] = [
{
- key: ComputingResourceType.GPU,
title: '英伟达GPU',
+ value: ComputingResourceType.GPU,
icon: