style: scroller
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
import { PageActionType } from '@/config/types';
|
import { PageActionType } from '@/config/types';
|
||||||
import Separator from '@/pages/llmodels/components/separator';
|
import Separator from '@/pages/llmodels/components/separator';
|
||||||
|
import { SearchOutlined } from '@ant-design/icons';
|
||||||
import { ColumnWrapper, GSDrawer, ModalFooter } from '@gpustack/core-ui';
|
import { ColumnWrapper, GSDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||||
import { useRef } from 'react';
|
import { Empty, Input, Typography } from 'antd';
|
||||||
|
import { useMemo, useRef, useState } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import { mockTemplateData } from '../../templates/config/mock-data';
|
||||||
|
import { instanceTypeOptions } from '../config';
|
||||||
import { FormData, ListItem } from '../config/types';
|
import { FormData, ListItem } from '../config/types';
|
||||||
import GPUServiceInstanceForm from '../forms';
|
import GPUServiceInstanceForm from '../forms';
|
||||||
import { TemplateSelector } from '../forms/template-overlay';
|
import TemplateSelector from '../forms/template-selector';
|
||||||
import InstanceTypeList from './instance-type-list';
|
import InstanceTypeList from './instance-type-list';
|
||||||
|
|
||||||
const Container = styled.div`
|
const Container = styled.div`
|
||||||
@@ -21,6 +25,14 @@ const ColWrapper = styled.div`
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const PanelBody = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
`;
|
||||||
|
|
||||||
const FormWrapper = styled.div`
|
const FormWrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -46,6 +58,42 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
onCancel
|
onCancel
|
||||||
}) => {
|
}) => {
|
||||||
const form = useRef<any>(null);
|
const form = useRef<any>(null);
|
||||||
|
const [instanceTypeId, setInstanceTypeId] = useState<number>();
|
||||||
|
const [templateId, setTemplateId] = useState<number>();
|
||||||
|
const [instanceKeyword, setInstanceKeyword] = useState('');
|
||||||
|
const [templateKeyword, setTemplateKeyword] = useState('');
|
||||||
|
|
||||||
|
const filteredInstanceTypes = useMemo(() => {
|
||||||
|
const keyword = instanceKeyword.trim().toLowerCase();
|
||||||
|
if (!keyword) {
|
||||||
|
return instanceTypeOptions;
|
||||||
|
}
|
||||||
|
return instanceTypeOptions.filter((item) =>
|
||||||
|
[
|
||||||
|
item.name,
|
||||||
|
String(item.gpu_count),
|
||||||
|
String(item.vram),
|
||||||
|
String(item.ram),
|
||||||
|
String(item.vCPU)
|
||||||
|
].some((text) => text.toLowerCase().includes(keyword))
|
||||||
|
);
|
||||||
|
}, [instanceKeyword]);
|
||||||
|
|
||||||
|
const filteredTemplates = useMemo(() => {
|
||||||
|
const keyword = templateKeyword.trim().toLowerCase();
|
||||||
|
if (!keyword) {
|
||||||
|
return mockTemplateData;
|
||||||
|
}
|
||||||
|
return mockTemplateData.filter((item) =>
|
||||||
|
[
|
||||||
|
item.name,
|
||||||
|
item.image,
|
||||||
|
item.vendor,
|
||||||
|
item.volume_mount_path,
|
||||||
|
String(item.volume_size_gb ?? '')
|
||||||
|
].some((text) => (text || '').toLowerCase().includes(keyword))
|
||||||
|
);
|
||||||
|
}, [templateKeyword]);
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
form.current?.submit();
|
form.current?.submit();
|
||||||
@@ -82,13 +130,65 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
<Container>
|
<Container>
|
||||||
<ColWrapper>
|
<ColWrapper>
|
||||||
<ColumnWrapper styles={{ container: { paddingBlock: 0 } }}>
|
<ColumnWrapper styles={{ container: { paddingBlock: 0 } }}>
|
||||||
<InstanceTypeList />
|
<PanelBody>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'sticky',
|
||||||
|
top: 0,
|
||||||
|
zIndex: 10,
|
||||||
|
backgroundColor: 'var(--ant-color-bg-elevated)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
allowClear
|
||||||
|
prefix={<SearchOutlined className="text-tertiary" />}
|
||||||
|
placeholder="搜索名称、GPU、显存、内存或 vCPU"
|
||||||
|
value={instanceKeyword}
|
||||||
|
onChange={(e) => setInstanceKeyword(e.target.value)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{filteredInstanceTypes.length > 0 ? (
|
||||||
|
<InstanceTypeList
|
||||||
|
value={instanceTypeId}
|
||||||
|
dataList={filteredInstanceTypes}
|
||||||
|
onChange={setInstanceTypeId}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||||
|
)}
|
||||||
|
</PanelBody>
|
||||||
</ColumnWrapper>
|
</ColumnWrapper>
|
||||||
<Separator></Separator>
|
<Separator></Separator>
|
||||||
</ColWrapper>
|
</ColWrapper>
|
||||||
<ColWrapper>
|
<ColWrapper>
|
||||||
<ColumnWrapper styles={{ container: { paddingBlock: 0 } }}>
|
<ColumnWrapper styles={{ container: { paddingBlock: 0 } }}>
|
||||||
<TemplateSelector></TemplateSelector>
|
<PanelBody>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'sticky',
|
||||||
|
top: 0,
|
||||||
|
zIndex: 10,
|
||||||
|
backgroundColor: 'var(--ant-color-bg-elevated)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
allowClear
|
||||||
|
prefix={<SearchOutlined className="text-tertiary" />}
|
||||||
|
placeholder="搜索模板名称、镜像、厂商或挂载路径"
|
||||||
|
value={templateKeyword}
|
||||||
|
onChange={(e) => setTemplateKeyword(e.target.value)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{filteredTemplates.length > 0 ? (
|
||||||
|
<TemplateSelector
|
||||||
|
value={templateId}
|
||||||
|
dataList={filteredTemplates}
|
||||||
|
onChange={setTemplateId}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||||
|
)}
|
||||||
|
</PanelBody>
|
||||||
</ColumnWrapper>
|
</ColumnWrapper>
|
||||||
<Separator></Separator>
|
<Separator></Separator>
|
||||||
</ColWrapper>
|
</ColWrapper>
|
||||||
@@ -107,13 +207,30 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<GPUServiceInstanceForm
|
<>
|
||||||
ref={form}
|
<Typography.Title
|
||||||
action={action}
|
level={3}
|
||||||
currentData={data}
|
style={{
|
||||||
onFinish={onFinish}
|
fontSize: 14,
|
||||||
open={open}
|
paddingTop: 10,
|
||||||
/>
|
paddingBottom: 16,
|
||||||
|
margin: 0,
|
||||||
|
position: 'sticky',
|
||||||
|
top: 0,
|
||||||
|
zIndex: 100,
|
||||||
|
backgroundColor: 'var(--ant-color-bg-elevated)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Configuration
|
||||||
|
</Typography.Title>
|
||||||
|
<GPUServiceInstanceForm
|
||||||
|
ref={form}
|
||||||
|
action={action}
|
||||||
|
currentData={data}
|
||||||
|
onFinish={onFinish}
|
||||||
|
open={open}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
</ColumnWrapper>
|
</ColumnWrapper>
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
</Container>
|
</Container>
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import { FormData } from '../config/types';
|
|||||||
|
|
||||||
const Basic = () => {
|
const Basic = () => {
|
||||||
return (
|
return (
|
||||||
<div data-field="name">
|
<>
|
||||||
<Form.Item<FormData>
|
<Form.Item<FormData>
|
||||||
|
data-field="name"
|
||||||
name="name"
|
name="name"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -19,7 +20,7 @@ const Basic = () => {
|
|||||||
<Form.Item<FormData> name="description">
|
<Form.Item<FormData> name="description">
|
||||||
<CInput.TextArea label="描述" scaleSize />
|
<CInput.TextArea label="描述" scaleSize />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ const GPUServiceInstanceForm: React.FC<InstanceFormProps> = forwardRef(
|
|||||||
value: TABKeysMap.TEMPLATE,
|
value: TABKeysMap.TEMPLATE,
|
||||||
label: '实例模板',
|
label: '实例模板',
|
||||||
icon: <IconFont type="icon-model" />,
|
icon: <IconFont type="icon-model" />,
|
||||||
field: 'template'
|
field: 'vendor'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: TABKeysMap.STORAGE,
|
value: TABKeysMap.STORAGE,
|
||||||
@@ -168,8 +168,8 @@ const GPUServiceInstanceForm: React.FC<InstanceFormProps> = forwardRef(
|
|||||||
activeKey={activeKey}
|
activeKey={activeKey}
|
||||||
setActiveKey={handleActiveChange}
|
setActiveKey={handleActiveChange}
|
||||||
segmentedTop={{
|
segmentedTop={{
|
||||||
top: 0,
|
top: 40,
|
||||||
offsetTop: 96
|
offsetTop: 130
|
||||||
}}
|
}}
|
||||||
getScrollElementScrollableHeight={getScrollElementScrollableHeight}
|
getScrollElementScrollableHeight={getScrollElementScrollableHeight}
|
||||||
>
|
>
|
||||||
@@ -196,7 +196,7 @@ const GPUServiceInstanceForm: React.FC<InstanceFormProps> = forwardRef(
|
|||||||
key: TABKeysMap.TEMPLATE,
|
key: TABKeysMap.TEMPLATE,
|
||||||
label: '实例模板',
|
label: '实例模板',
|
||||||
forceRender: true,
|
forceRender: true,
|
||||||
children: <TemplateBasicForm />
|
children: <TemplateBasicForm page="instance" />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: TABKeysMap.STORAGE,
|
key: TABKeysMap.STORAGE,
|
||||||
|
|||||||
@@ -1,49 +1,10 @@
|
|||||||
import FormOverlayView from '@/pages/_components/form-overlay-view';
|
import FormOverlayView from '@/pages/_components/form-overlay-view';
|
||||||
import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
|
import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
|
||||||
import { AutoTooltip, IconFont, TemplateCard } from '@gpustack/core-ui';
|
|
||||||
import { Button, Empty, Flex, Input } from 'antd';
|
import { Button, Empty, Flex, Input } from 'antd';
|
||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { mockTemplateData } from '../../templates/config/mock-data';
|
import { mockTemplateData } from '../../templates/config/mock-data';
|
||||||
import { ListItem as TemplateItem } from '../../templates/config/types';
|
import TemplateSelector from './template-selector';
|
||||||
|
|
||||||
const TemplateGrid = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TemplateContent = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
color: var(--ant-color-text-secondary);
|
|
||||||
|
|
||||||
.name {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
color: var(--ant-color-text);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: max-content minmax(0, 1fr);
|
|
||||||
gap: 8px;
|
|
||||||
color: var(--ant-color-text-tertiary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
color: var(--ant-color-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
color: var(--ant-color-text-quaternary);
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const DrawerBody = styled.div`
|
const DrawerBody = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -51,12 +12,6 @@ const DrawerBody = styled.div`
|
|||||||
gap: 16px;
|
gap: 16px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
interface TemplateSelectorProps {
|
|
||||||
value?: number;
|
|
||||||
onChange?: (value: number) => void;
|
|
||||||
dataList?: TemplateItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TemplateOverlayProps {
|
interface TemplateOverlayProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
value?: number;
|
value?: number;
|
||||||
@@ -65,56 +20,6 @@ interface TemplateOverlayProps {
|
|||||||
onCreate?: () => void;
|
onCreate?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TemplateSelector: React.FC<TemplateSelectorProps> = ({
|
|
||||||
value,
|
|
||||||
onChange,
|
|
||||||
dataList = mockTemplateData
|
|
||||||
}) => {
|
|
||||||
return (
|
|
||||||
<TemplateGrid>
|
|
||||||
{dataList.map((item: TemplateItem) => (
|
|
||||||
<TemplateCard
|
|
||||||
key={item.id}
|
|
||||||
clickable
|
|
||||||
ghost
|
|
||||||
hoverable
|
|
||||||
height={102}
|
|
||||||
active={value === item.id}
|
|
||||||
disabled={item.status !== 'enabled'}
|
|
||||||
onClick={() => onChange?.(item.id)}
|
|
||||||
>
|
|
||||||
<TemplateContent>
|
|
||||||
<div className="name">
|
|
||||||
<AutoTooltip ghost minWidth={20}>
|
|
||||||
{item.name}
|
|
||||||
</AutoTooltip>
|
|
||||||
{/* <Tag color={item.status === 'enabled' ? 'success' : 'default'}>
|
|
||||||
{item.status === 'enabled' ? '启用' : '停用'}
|
|
||||||
</Tag> */}
|
|
||||||
</div>
|
|
||||||
<div className="info">
|
|
||||||
<span>
|
|
||||||
<IconFont className="icon" type="icon-model" /> 镜像:
|
|
||||||
</span>
|
|
||||||
<AutoTooltip ghost minWidth={20}>
|
|
||||||
<span className="value">{item.image || '-'}</span>
|
|
||||||
</AutoTooltip>
|
|
||||||
</div>
|
|
||||||
<div className="info">
|
|
||||||
<span>
|
|
||||||
<IconFont className="icon" type="icon-storage-outlined" /> 存储:
|
|
||||||
</span>
|
|
||||||
<span className="value">
|
|
||||||
{item.volume_size_gb ?? '-'} GB {item.volume_mount_path || '-'}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</TemplateContent>
|
|
||||||
</TemplateCard>
|
|
||||||
))}
|
|
||||||
</TemplateGrid>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const TemplateOverlay: React.FC<TemplateOverlayProps> = ({
|
const TemplateOverlay: React.FC<TemplateOverlayProps> = ({
|
||||||
open,
|
open,
|
||||||
value,
|
value,
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
import { AutoTooltip, IconFont, TemplateCard } from '@gpustack/core-ui';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { mockTemplateData } from '../../templates/config/mock-data';
|
||||||
|
import { ListItem as TemplateItem } from '../../templates/config/types';
|
||||||
|
|
||||||
|
const TemplateGrid = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const TemplateContent = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
|
||||||
|
.name {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: max-content minmax(0, 1fr);
|
||||||
|
gap: 8px;
|
||||||
|
color: var(--ant-color-text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
color: var(--ant-color-text-quaternary);
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
interface TemplateSelectorProps {
|
||||||
|
value?: number;
|
||||||
|
onChange?: (value: number) => void;
|
||||||
|
dataList?: TemplateItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const TemplateSelector: React.FC<TemplateSelectorProps> = ({
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
dataList = mockTemplateData
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<TemplateGrid>
|
||||||
|
{dataList.map((item: TemplateItem) => (
|
||||||
|
<TemplateCard
|
||||||
|
key={item.id}
|
||||||
|
clickable
|
||||||
|
ghost
|
||||||
|
hoverable
|
||||||
|
height={102}
|
||||||
|
active={value === item.id}
|
||||||
|
disabled={item.status !== 'enabled'}
|
||||||
|
onClick={() => onChange?.(item.id)}
|
||||||
|
>
|
||||||
|
<TemplateContent>
|
||||||
|
<div className="name">
|
||||||
|
<AutoTooltip ghost minWidth={20}>
|
||||||
|
{item.name}
|
||||||
|
</AutoTooltip>
|
||||||
|
</div>
|
||||||
|
<div className="info">
|
||||||
|
<span>
|
||||||
|
<IconFont className="icon" type="icon-model" /> 镜像:
|
||||||
|
</span>
|
||||||
|
<AutoTooltip ghost minWidth={20}>
|
||||||
|
<span className="value">{item.image || '-'}</span>
|
||||||
|
</AutoTooltip>
|
||||||
|
</div>
|
||||||
|
<div className="info">
|
||||||
|
<span>
|
||||||
|
<IconFont className="icon" type="icon-storage-outlined" /> 存储:
|
||||||
|
</span>
|
||||||
|
<span className="value">
|
||||||
|
{item.volume_size_gb ?? '-'} GB {item.volume_mount_path || '-'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</TemplateContent>
|
||||||
|
</TemplateCard>
|
||||||
|
))}
|
||||||
|
</TemplateGrid>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TemplateSelector;
|
||||||
@@ -6,34 +6,36 @@ import {
|
|||||||
Select as SealSelect,
|
Select as SealSelect,
|
||||||
Textarea
|
Textarea
|
||||||
} from '@gpustack/core-ui';
|
} from '@gpustack/core-ui';
|
||||||
import { Form, Select } from 'antd';
|
import { Form } from 'antd';
|
||||||
import { FormData } from '../config/types';
|
import { FormData } from '../config/types';
|
||||||
import Ports from './ports';
|
import Ports from './ports';
|
||||||
|
|
||||||
const Basic = () => {
|
interface BasicProps {
|
||||||
const form = Form.useFormInstance<FormData>();
|
page: 'template' | 'instance';
|
||||||
const envs = Form.useWatch('env', form);
|
}
|
||||||
const gpuVendorOptions = Object.values(GPUsConfigs);
|
|
||||||
|
|
||||||
const handleEnvChange = (labels: Record<string, any>) => {
|
const Basic: React.FC<BasicProps> = ({ page = 'template' }) => {
|
||||||
form.setFieldValue('env', labels);
|
const form = Form.useFormInstance<FormData>();
|
||||||
};
|
const gpuVendorOptions = Object.values(GPUsConfigs);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form.Item<FormData>
|
{page === 'template' && (
|
||||||
name="name"
|
<Form.Item<FormData>
|
||||||
rules={[
|
name="name"
|
||||||
{
|
rules={[
|
||||||
required: true,
|
{
|
||||||
message: '请输入模板名称'
|
required: true,
|
||||||
}
|
message: '请输入模板名称'
|
||||||
]}
|
}
|
||||||
>
|
]}
|
||||||
<CInput.Input label="名称" required />
|
>
|
||||||
</Form.Item>
|
<CInput.Input label="名称" required />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
<Form.Item<FormData>
|
<Form.Item<FormData>
|
||||||
name="vendor"
|
name="vendor"
|
||||||
|
data-field="vendor"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -41,13 +43,11 @@ const Basic = () => {
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<SealSelect label="适用设备厂商" required>
|
<SealSelect
|
||||||
{gpuVendorOptions.map((item) => (
|
label="适用设备厂商"
|
||||||
<Select.Option value={item.value} key={item.value}>
|
required
|
||||||
{item.label}
|
options={[...gpuVendorOptions, { label: 'CPU', value: 'cpu' }]}
|
||||||
</Select.Option>
|
></SealSelect>
|
||||||
))}
|
|
||||||
</SealSelect>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item<FormData>
|
<Form.Item<FormData>
|
||||||
name="image"
|
name="image"
|
||||||
@@ -60,17 +60,6 @@ const Basic = () => {
|
|||||||
>
|
>
|
||||||
<CInput.Input label="容器镜像" required />
|
<CInput.Input label="容器镜像" required />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* <Form.Item<FormData> name="image_pull_policy">
|
|
||||||
<SealSelect
|
|
||||||
allowClear
|
|
||||||
label="镜像拉取策略"
|
|
||||||
options={[
|
|
||||||
{ label: 'IfNotPresent', value: 'IfNotPresent' },
|
|
||||||
{ label: 'Always', value: 'Always' },
|
|
||||||
{ label: 'Never', value: 'Never' }
|
|
||||||
]}
|
|
||||||
></SealSelect>
|
|
||||||
</Form.Item> */}
|
|
||||||
<Form.Item<FormData> name="run_command">
|
<Form.Item<FormData> name="run_command">
|
||||||
<Textarea
|
<Textarea
|
||||||
label="容器启动命令"
|
label="容器启动命令"
|
||||||
@@ -83,26 +72,9 @@ const Basic = () => {
|
|||||||
<Form.Item<FormData> name="boot_disk_size_gb">
|
<Form.Item<FormData> name="boot_disk_size_gb">
|
||||||
<CInputNumber min={1} precision={0} label="容器启动盘大小 (GB)" />
|
<CInputNumber min={1} precision={0} label="容器启动盘大小 (GB)" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* <div style={{ display: 'flex', gap: 16 }}>
|
|
||||||
<div style={{ flex: 1 }}>
|
|
||||||
<Form.Item<FormData> name="volume_size_gb">
|
|
||||||
<CInputNumber min={1} precision={0} label="存储卷大小 (GB)" />
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
<div style={{ flex: 2 }}>
|
|
||||||
<Form.Item<FormData> name="volume_mount_path">
|
|
||||||
<CInput.Input label="存储卷挂载路径" placeholder="例如:/data" />
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
<Ports />
|
<Ports />
|
||||||
<Form.Item<FormData> name="env">
|
<Form.Item<FormData> name="env">
|
||||||
<LabelSelector
|
<LabelSelector label="环境变量" btnText="添加变量" />
|
||||||
label="环境变量"
|
|
||||||
labels={envs || {}}
|
|
||||||
btnText="添加变量"
|
|
||||||
onChange={handleEnvChange}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user