chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import LabelSelector from '@/components/label-selector';
|
||||
import ListInput from '@/components/list-input';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealTextArea from '@/components/seal-form/seal-textarea';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import {
|
||||
Input as CInput,
|
||||
LabelSelector,
|
||||
ListInput,
|
||||
Textarea as SealTextArea
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import { useEffect } from 'react';
|
||||
@@ -39,7 +41,7 @@ const BasicForm = () => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
trim
|
||||
addAfter={
|
||||
backendSource === BackendSourceValueMap.CUSTOM ? '-custom' : null
|
||||
@@ -47,10 +49,10 @@ const BasicForm = () => {
|
||||
disabled={action === PageAction.EDIT}
|
||||
label={intl.formatMessage({ id: 'common.table.name' })}
|
||||
required
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> hidden name="backend_source">
|
||||
<SealInput.Input></SealInput.Input>
|
||||
<CInput.Input></CInput.Input>
|
||||
</Form.Item>
|
||||
{backendSource !== BackendSourceValueMap.BUILTIN && (
|
||||
<>
|
||||
@@ -58,11 +60,11 @@ const BasicForm = () => {
|
||||
name="health_check_path"
|
||||
rules={[{ required: false }]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
trim
|
||||
placeholder={`/v1/models`}
|
||||
label={intl.formatMessage({ id: 'backend.form.healthCheckPath' })}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item name="default_run_command">
|
||||
<SealTextArea
|
||||
@@ -113,10 +115,10 @@ const BasicForm = () => {
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<FormData> name="description" rules={[{ required: false }]}>
|
||||
<SealInput.TextArea
|
||||
<CInput.TextArea
|
||||
scaleSize={true}
|
||||
label={intl.formatMessage({ id: 'common.table.description' })}
|
||||
></SealInput.TextArea>
|
||||
></CInput.TextArea>
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import CopyButton from '@/components/copy-button';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import {
|
||||
AutoTooltip,
|
||||
BaseSelect,
|
||||
CopyButton,
|
||||
ThemeTag
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Empty, Typography } from 'antd';
|
||||
import { useState } from 'react';
|
||||
@@ -14,7 +16,6 @@ import {
|
||||
TagColorMap
|
||||
} from '../config';
|
||||
import { VersionListItem } from '../config/types';
|
||||
|
||||
const ItemWrapper = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import CollapsibleContainer from '@/components/collapse-container';
|
||||
import LabelSelector from '@/components/label-selector';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import SealTextArea from '@/components/seal-form/seal-textarea';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
BaseSelect,
|
||||
Input as CInput,
|
||||
CollapseContainer,
|
||||
LabelSelector,
|
||||
Select as SealSelect,
|
||||
Textarea as SealTextArea
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form, Tag } from 'antd';
|
||||
import React, { useEffect, useMemo } from 'react';
|
||||
@@ -14,7 +16,6 @@ import styled from 'styled-components';
|
||||
import { BackendSourceValueMap, frameworks } from '../config';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { ListItem } from '../config/types';
|
||||
|
||||
// version must be endwith '-custom'
|
||||
|
||||
const Box = styled.div`
|
||||
@@ -263,7 +264,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
border: '1px solid var(--ant-color-split)'
|
||||
}}
|
||||
>
|
||||
<CollapsibleContainer
|
||||
<CollapseContainer
|
||||
collapsible={true}
|
||||
showExpandIcon={true}
|
||||
key={name}
|
||||
@@ -289,7 +290,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
)}
|
||||
</Label>
|
||||
}
|
||||
onToggle={(open) => onToggle(open, name)}
|
||||
onToggle={(open: boolean) => onToggle(open, name)}
|
||||
deleteBtn={false}
|
||||
right={
|
||||
<div className="flex-center gap-8">
|
||||
@@ -328,13 +329,13 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
trim
|
||||
addAfter={showCustomSuffix ? '-custom' : null}
|
||||
onChange={handleVersionChange}
|
||||
label={intl.formatMessage({ id: 'backend.version' })}
|
||||
required
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={[name, 'image_name']}
|
||||
@@ -345,7 +346,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
trim
|
||||
required
|
||||
placeholder={intl.formatMessage(
|
||||
@@ -353,7 +354,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
{ content: 'vllm/vllm-openai:v0.12.0' }
|
||||
)}
|
||||
label={intl.formatMessage({ id: 'backend.imageName' })}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
</Box>
|
||||
<Form.Item
|
||||
@@ -374,7 +375,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name={[name, 'entrypoint']}>
|
||||
<SealInput.TextArea
|
||||
<CInput.TextArea
|
||||
allowClear
|
||||
description={intl.formatMessage({
|
||||
id: 'backend.entrypoint.tips'
|
||||
@@ -382,7 +383,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
label={intl.formatMessage({
|
||||
id: 'backend.replaceEntrypoint'
|
||||
})}
|
||||
></SealInput.TextArea>
|
||||
></CInput.TextArea>
|
||||
</Form.Item>
|
||||
<Form.Item name={[name, 'run_command']}>
|
||||
<SealTextArea
|
||||
@@ -413,7 +414,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
}
|
||||
></LabelSelector>
|
||||
</Form.Item>
|
||||
</CollapsibleContainer>
|
||||
</CollapseContainer>
|
||||
</div>
|
||||
));
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user