diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx
index c85afffb..060f3bc1 100644
--- a/react-ui/src/components/IFramePage/index.tsx
+++ b/react-ui/src/components/IFramePage/index.tsx
@@ -12,32 +12,36 @@ export enum IframePageType {
DatasetAnnotation = 'DatasetAnnotation', // 数据标注
AppDevelopment = 'AppDevelopment', // 应用开发
DevEnv = 'DevEnv', // 开发环境
- GitLink = 'GitLink',
+ GitLink = 'GitLink', // git link
}
const getRequestAPI = (type: IframePageType): (() => Promise
) => {
switch (type) {
- case IframePageType.DatasetAnnotation:
+ case IframePageType.DatasetAnnotation: // 数据标注
return () => Promise.resolve({ code: 200, data: 'http://172.20.32.181:18888/oauth/login' }); //getLabelStudioUrl;
- case IframePageType.AppDevelopment:
+ case IframePageType.AppDevelopment: // 应用开发
return () => Promise.resolve({ code: 200, data: 'http://172.20.32.185:30080/' });
- case IframePageType.DevEnv:
+ case IframePageType.DevEnv: // 开发环境
return () =>
Promise.resolve({
code: 200,
data: SessionStorage.getItem(SessionStorage.editorUrlKey) || '',
});
- case IframePageType.GitLink:
+ case IframePageType.GitLink: // git link
return () => Promise.resolve({ code: 200, data: 'http://172.20.32.201:4000' });
}
};
type IframePageProps = {
+ /** 子系统 */
type: IframePageType;
+ /** 自定义样式类名 */
className?: string;
+ /** 自定义样式 */
style?: React.CSSProperties;
};
+/** 系统内嵌 iframe,目前系统有数据标注、应用开发、开发环境、GitLink 四个子系统,使用时可以添加其他子系统 */
function IframePage({ type, className, style }: IframePageProps) {
const [iframeUrl, setIframeUrl] = useState('');
const [loading, setLoading] = useState(false);
diff --git a/react-ui/src/components/InfoGroupTitle/index.less b/react-ui/src/components/InfoGroup/InfoGroupTitle.less
similarity index 100%
rename from react-ui/src/components/InfoGroupTitle/index.less
rename to react-ui/src/components/InfoGroup/InfoGroupTitle.less
diff --git a/react-ui/src/components/InfoGroupTitle/index.tsx b/react-ui/src/components/InfoGroup/InfoGroupTitle.tsx
similarity index 95%
rename from react-ui/src/components/InfoGroupTitle/index.tsx
rename to react-ui/src/components/InfoGroup/InfoGroupTitle.tsx
index 7524a9f0..bde57b3f 100644
--- a/react-ui/src/components/InfoGroupTitle/index.tsx
+++ b/react-ui/src/components/InfoGroup/InfoGroupTitle.tsx
@@ -1,6 +1,6 @@
import { Flex } from 'antd';
import classNames from 'classnames';
-import './index.less';
+import './InfoGroupTitle.less';
type InfoGroupTitleProps = {
/** 标题 */
diff --git a/react-ui/src/components/InfoGroup/index.tsx b/react-ui/src/components/InfoGroup/index.tsx
index 01e8c01b..0f2a3b42 100644
--- a/react-ui/src/components/InfoGroup/index.tsx
+++ b/react-ui/src/components/InfoGroup/index.tsx
@@ -1,5 +1,5 @@
import classNames from 'classnames';
-import InfoGroupTitle from '../InfoGroupTitle';
+import InfoGroupTitle from './InfoGroupTitle';
import './index.less';
type InfoGroupProps = {
diff --git a/react-ui/src/components/KFModal/index.tsx b/react-ui/src/components/KFModal/index.tsx
index 4cb6a9c3..ec1b7717 100644
--- a/react-ui/src/components/KFModal/index.tsx
+++ b/react-ui/src/components/KFModal/index.tsx
@@ -10,6 +10,7 @@ import KFModalTitle from './KFModalTitle';
import './index.less';
export interface KFModalProps extends ModalProps {
+ /** 标题图片 */
image?: string;
}
diff --git a/react-ui/src/pages/ModelDeployment/components/VersionBasicInfo/index.tsx b/react-ui/src/pages/ModelDeployment/components/VersionBasicInfo/index.tsx
index fde42ea7..4eacca04 100644
--- a/react-ui/src/pages/ModelDeployment/components/VersionBasicInfo/index.tsx
+++ b/react-ui/src/pages/ModelDeployment/components/VersionBasicInfo/index.tsx
@@ -18,7 +18,7 @@ const formatStatus = (status?: ServiceRunStatus) => {
}
return (
-
+
{ModelDeployStatusCell(status)}
);
diff --git a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx
index f2624a58..de041c72 100644
--- a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx
+++ b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx
@@ -1,3 +1,4 @@
+import CodeSelectorModal from '@/components/CodeSelectorModal';
import KFIcon from '@/components/KFIcon';
import ParameterInput, { requiredValidator } from '@/components/ParameterInput';
import ParameterSelect from '@/components/ParameterSelect';
@@ -21,7 +22,6 @@ import { INode } from '@antv/g6';
import { Button, Drawer, Form, Input, MenuProps, Select } from 'antd';
import { NamePath } from 'antd/es/form/interface';
import { forwardRef, useImperativeHandle, useState } from 'react';
-import CodeSelectorModal from '../CodeSelectorModal';
import PropsLabel from '../PropsLabel';
import styles from './index.less';
const { TextArea } = Input;
diff --git a/react-ui/src/stories/IFramePage.stories.tsx b/react-ui/src/stories/IFramePage.stories.tsx
new file mode 100644
index 00000000..3d1714e8
--- /dev/null
+++ b/react-ui/src/stories/IFramePage.stories.tsx
@@ -0,0 +1,31 @@
+import IFramePage, { IframePageType } from '@/components/IFramePage';
+import type { Meta, StoryObj } from '@storybook/react';
+
+// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
+const meta = {
+ title: 'Components/IFramePage',
+ component: IFramePage,
+ parameters: {
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
+ // layout: 'centered',
+ },
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
+ tags: ['autodocs'],
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
+ argTypes: {
+ type: { control: 'select', options: Object.values(IframePageType) },
+ },
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ // args: { onClick: fn() },
+} satisfies Meta;
+
+export default meta;
+type Story = StoryObj;
+
+// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
+export const Primary: Story = {
+ args: {
+ type: IframePageType.GitLink,
+ style: { height: '500px' },
+ },
+};
diff --git a/react-ui/src/stories/KFModal.stories.tsx b/react-ui/src/stories/KFModal.stories.tsx
index ebebe0b3..455108c7 100644
--- a/react-ui/src/stories/KFModal.stories.tsx
+++ b/react-ui/src/stories/KFModal.stories.tsx
@@ -18,6 +18,12 @@ const meta = {
// More on argTypes: https://storybook.js.org/docs/api/argtypes
argTypes: {
// backgroundColor: { control: 'color' },
+ title: {
+ description: '标题',
+ },
+ open: {
+ description: '对话框是否可见',
+ },
},
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
args: { onCancel: fn(), onOk: fn() },
diff --git a/react-ui/src/stories/InfoGroupTitle.stories.tsx b/react-ui/src/stories/ParameterSelect.stories.tsx
similarity index 80%
rename from react-ui/src/stories/InfoGroupTitle.stories.tsx
rename to react-ui/src/stories/ParameterSelect.stories.tsx
index c37ff07e..4a1907ee 100644
--- a/react-ui/src/stories/InfoGroupTitle.stories.tsx
+++ b/react-ui/src/stories/ParameterSelect.stories.tsx
@@ -1,10 +1,11 @@
-import InfoGroupTitle from '@/components/InfoGroupTitle';
+import MirrorBasic from '@/assets/img/mirror-basic.png';
+import ParameterSelect from '@/components/ParameterSelect';
import type { Meta, StoryObj } from '@storybook/react';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
- title: 'Components/InfoGroupTitle',
- component: InfoGroupTitle,
+ title: 'Components/ParameterSelect',
+ component: ParameterSelect,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
// layout: 'centered',
@@ -17,7 +18,7 @@ const meta = {
},
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
// args: { onClick: fn() },
-} satisfies Meta;
+} satisfies Meta;
export default meta;
type Story = StoryObj;
@@ -26,5 +27,6 @@ type Story = StoryObj;
export const Primary: Story = {
args: {
title: '基本信息',
+ image: MirrorBasic,
},
};
diff --git a/react-ui/src/styles/theme.less b/react-ui/src/styles/theme.less
index cf1daced..ff7813f9 100644
--- a/react-ui/src/styles/theme.less
+++ b/react-ui/src/styles/theme.less
@@ -49,7 +49,7 @@
// padding
@content-padding: 25px;
-// 函数
+// 函数,hex 添加 alpha 值
.addAlpha(@color, @alpha) {
@red: red(@color);
@green: green(@color);
@@ -58,6 +58,7 @@
}
// 混合
+// 单行
.singleLine() {
overflow: hidden;
white-space: nowrap;
@@ -65,6 +66,7 @@
word-break: break-all;
}
+// 多行
.multiLine(@line) {
display: -webkit-box;
overflow: hidden;
diff --git a/react-ui/tsconfig.json b/react-ui/tsconfig.json
index 0afa8788..55ce7f74 100644
--- a/react-ui/tsconfig.json
+++ b/react-ui/tsconfig.json
@@ -9,7 +9,7 @@
"strict": true, // 启用所有严格类型检查选项
"forceConsistentCasingInFileNames": false, // 允许对同一文件的引用使用不一致的大小写
"module": "esnext", // 指定模块代码生成
- "moduleResolution": "node", // 使用Node.js样式解析模块
+ "moduleResolution": "bundler", // 使用bundlers样式解析模块
"isolatedModules": true, // 无条件地为未解析的文件发出导入
"resolveJsonModule": true, // 包含.json扩展名的模块
"noEmit": true, // 不发出输出(即不编译代码,只进行类型检查)