chore: replace components with core-ui, upgrade eslint

This commit is contained in:
jialin
2026-04-24 14:28:30 +08:00
committed by jialin
parent d48aa99dcc
commit 8711c27b78
470 changed files with 1017 additions and 24093 deletions
+5 -3
View File
@@ -1,9 +1,11 @@
import LabelSelector from '@/components/label-selector';
import CheckboxField from '@/components/seal-form/checkbox-field';
import SealSelect from '@/components/seal-form/seal-select';
import { PageAction } from '@/config';
import DocLink from '@/pages/_components/doc-link';
import { genericReferLink } from '@/pages/model-routes/config';
import {
CheckboxField,
LabelSelector,
Select as SealSelect
} from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
@@ -1,4 +1,4 @@
import ListInput from '@/components/list-input';
import { ListInput } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
+1 -2
View File
@@ -1,7 +1,6 @@
import SealSelect from '@/components/seal-form/seal-select';
import TooltipList from '@/components/tooltip-list';
import useAppUtils from '@/hooks/use-app-utils';
import { CaretDownOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { Select as SealSelect, TooltipList } from '@gpustack/core-ui';
import { useIntl, useNavigate } from '@umijs/max';
import { Form, Select } from 'antd';
import React, { useMemo } from 'react';
+11 -10
View File
@@ -1,6 +1,3 @@
import AutoTooltip from '@/components/auto-tooltip';
import SealInput from '@/components/seal-form/seal-input';
import SealSelect from '@/components/seal-form/seal-select';
import { modelNameReg, PageAction } from '@/config';
import { OPENAI_COMPATIBLE } from '@/config/settings';
import useAppUtils from '@/hooks/use-app-utils';
@@ -8,6 +5,11 @@ import {
ClusterStatusLabelMap,
ClusterStatusValueMap
} from '@/pages/cluster-management/config';
import {
AutoTooltip,
Input as CInput,
Select as SealSelect
} from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import { useMemo } from 'react';
@@ -21,7 +23,6 @@ import CustomBackend from './custom-backend';
import LocalPathSource from './local-path-source';
import ModeField from './mode-field';
import OnlineSource from './online-source';
const ClusterOption = styled.span`
display: flex;
padding: 8px 0;
@@ -173,14 +174,14 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
}
]}
>
<SealInput.Input
<CInput.Input
onBlur={handleNameBlur}
description={intl.formatMessage({ id: 'models.form.rules.name' })}
label={intl.formatMessage({
id: 'common.table.name'
})}
required
></SealInput.Input>
></CInput.Input>
</Form.Item>
{fields.includes('source') && (
<Form.Item<FormData>
@@ -240,7 +241,7 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
}
]}
>
<SealInput.Number
<CInput.Number
style={{ width: '100%' }}
label={intl.formatMessage({
id: 'models.form.replicas'
@@ -251,15 +252,15 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
{ api: `${window.location.origin}/${OPENAI_COMPATIBLE}` }
)}
min={0}
></SealInput.Number>
></CInput.Number>
</Form.Item>
<Form.Item<FormData> name="description">
<SealInput.TextArea
<CInput.TextArea
scaleSize={true}
label={intl.formatMessage({
id: 'common.table.description'
})}
></SealInput.TextArea>
></CInput.TextArea>
</Form.Item>
</>
);
+3 -3
View File
@@ -1,5 +1,5 @@
import SealInput from '@/components/seal-form/seal-input';
import useAppUtils from '@/hooks/use-app-utils';
import { Input as CInput } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import React from 'react';
@@ -32,10 +32,10 @@ const CatalogForm: React.FC = () => {
}
]}
>
<SealInput.Input
<CInput.Input
label={intl.formatMessage({ id: 'models.catalog.precision' })}
disabled
></SealInput.Input>
></CInput.Input>
</Form.Item>
</>
);
+3 -4
View File
@@ -1,6 +1,5 @@
import SealInput from '@/components/seal-form/seal-input';
import SealTextArea from '@/components/seal-form/seal-textarea';
import useAppUtils from '@/hooks/use-app-utils';
import { Input as CInput, Textarea as SealTextArea } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import React from 'react';
@@ -44,12 +43,12 @@ const CustomBackend: React.FC = () => {
}
]}
>
<SealInput.Input
<CInput.Input
required
allowClear
onBlur={handleImageNameOnBlur}
label={intl.formatMessage({ id: 'backend.imageName' })}
></SealInput.Input>
></CInput.Input>
</Form.Item>
<Form.Item<FormData>
name="run_command"
@@ -1,6 +1,9 @@
import OverlayScroller from '@/components/overlay-scroller';
import SimpleTabel, { ColumnProps } from '@/components/simple-table';
import { WarningOutlined } from '@ant-design/icons';
import {
OverlayScroller,
SimpleTable,
type ColumnProps
} from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Alert, Button, Popover, Radio } from 'antd';
import React, { useMemo } from 'react';
@@ -128,7 +131,7 @@ const EnvsOverridePopover: React.FC<EnvsOverridePopoverProps> = (props) => {
}
}}
>
<SimpleTabel
<SimpleTable
columns={columns}
dataSource={dataList}
rowKey="env_name"
+3 -5
View File
@@ -1,9 +1,7 @@
import IconFont from '@/components/icon-font';
import { PageAction } from '@/config';
import { PageActionType } from '@/config/types';
import CollapsePanel from '@/pages/_components/collapse-panel';
import { useWrapperContext } from '@/pages/_components/column-wrapper/use-wrapper-context';
import ScrollSpyTabs from '@/pages/_components/scroll-spy-tabs';
import { CollapsePanel, IconFont, ScrollSpyTabs } from '@gpustack/core-ui';
import { useWrapperContext } from '@gpustack/core-ui/lib/components/column-wrapper/use-wrapper-context';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
@@ -212,7 +210,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
// generate the data is available for the backend including the gpu_ids
const handleOk = async (formdata: FormData) => {
let data = _.cloneDeep(formdata);
const data = _.cloneDeep(formdata);
data.categories = data.categories ? [data.categories] : [];
const gpuSelector = generateGPUIds(data);
const allValues = {
+4 -5
View File
@@ -1,5 +1,4 @@
import CheckboxField from '@/components/seal-form/checkbox-field';
import SealInputNumber from '@/components/seal-form/input-number';
import { CheckboxField, InputNumber as CInputNumber } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
@@ -100,7 +99,7 @@ const KVCacheForm = () => {
{kvCacheEnabled && (
<>
<Form.Item<FormData> name={['extended_kv_cache', 'ram_ratio']}>
<SealInputNumber
<CInputNumber
onChange={(value) => handleRamRatioChange(value, 'ram_ratio')}
label={intl.formatMessage({ id: 'models.form.ramRatio' })}
description={intl.formatMessage({
@@ -112,7 +111,7 @@ const KVCacheForm = () => {
/>
</Form.Item>
<Form.Item<FormData> name={['extended_kv_cache', 'ram_size']}>
<SealInputNumber
<CInputNumber
onInput={(value) => handleRamSizeInput(value)}
label={intl.formatMessage({ id: 'models.form.ramSize' })}
description={intl.formatMessage(
@@ -127,7 +126,7 @@ const KVCacheForm = () => {
/>
</Form.Item>
<Form.Item<FormData> name={['extended_kv_cache', 'chunk_size']}>
<SealInputNumber
<CInputNumber
onChange={(value) => handleRamRatioChange(value, 'chunk_size')}
label={intl.formatMessage({ id: 'models.form.chunkSize' })}
description={intl.formatMessage({
@@ -1,6 +1,5 @@
import SealInput from '@/components/seal-form/seal-input';
import TooltipList from '@/components/tooltip-list';
import useAppUtils from '@/hooks/use-app-utils';
import { Input as CInput, TooltipList } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
@@ -91,14 +90,14 @@ const LocalPathForm: React.FC = () => {
}
]}
>
<SealInput.Input
<CInput.Input
allowClear
required
onFocus={handleOnFocus}
onBlur={handleOnBlur}
label={intl.formatMessage({ id: 'models.form.filePath' })}
description={<TooltipList list={localPathTipsList}></TooltipList>}
></SealInput.Input>
></CInput.Input>
</Form.Item>
</>
);
+1 -3
View File
@@ -1,11 +1,9 @@
import AutoTooltip from '@/components/auto-tooltip';
import SealSelect from '@/components/seal-form/seal-select';
import { AutoTooltip, Select as SealSelect } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form, Select } from 'antd';
import React from 'react';
import { DeployFormKeyMap } from '../config';
import { useCatalogFormContext, useFormContext } from '../config/form-context';
const Performance: React.FC = () => {
const intl = useIntl();
const { formKey } = useFormContext();
+9 -9
View File
@@ -1,6 +1,6 @@
import SealInput from '@/components/seal-form/seal-input';
import { PageAction } from '@/config';
import useAppUtils from '@/hooks/use-app-utils';
import { Input as CInput } from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import React from 'react';
@@ -44,22 +44,22 @@ const HuggingFaceForm: React.FC = () => {
}
]}
>
<SealInput.Input
<CInput.Input
label={intl.formatMessage({ id: 'models.form.repoid' })}
required
disabled={action === PageAction.CREATE}
onBlur={handleOnBlur}
></SealInput.Input>
></CInput.Input>
</Form.Item>
{isGGUF && (
<Form.Item<FormData>
name="huggingface_filename"
key="huggingface_filename"
>
<SealInput.Input
<CInput.Input
label={intl.formatMessage({ id: 'models.form.filename' })}
disabled={action === PageAction.CREATE}
></SealInput.Input>
></CInput.Input>
</Form.Item>
)}
</>
@@ -75,22 +75,22 @@ const HuggingFaceForm: React.FC = () => {
}
]}
>
<SealInput.Input
<CInput.Input
required
label={intl.formatMessage({ id: 'models.form.repoid' })}
disabled={action === PageAction.CREATE}
onBlur={handleOnBlur}
></SealInput.Input>
></CInput.Input>
</Form.Item>
{isGGUF && (
<Form.Item<FormData>
name="model_scope_file_path"
key="model_scope_file_path"
>
<SealInput.Input
<CInput.Input
label={intl.formatMessage({ id: 'models.form.filename' })}
disabled={action === PageAction.CREATE}
></SealInput.Input>
></CInput.Input>
</Form.Item>
)}
</>
+9 -9
View File
@@ -1,9 +1,11 @@
import LabelSelector from '@/components/label-selector';
import { LabelSelectorContext } from '@/components/label-selector/context';
import SealCascader from '@/components/seal-form/seal-cascader';
import SealSelect from '@/components/seal-form/seal-select';
import TooltipList from '@/components/tooltip-list';
import useAppUtils from '@/hooks/use-app-utils';
import {
LabelSelector,
LabelSelectorProvider,
Cascader as SealCascader,
Select as SealSelect,
TooltipList
} from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form, InputNumber } from 'antd';
import _ from 'lodash';
@@ -258,9 +260,7 @@ const ScheduleTypeForm: React.FC = () => {
}
></SealSelect>
</Form.Item>
<LabelSelectorContext.Provider
value={{ options: workerLabelOptions }}
>
<LabelSelectorProvider value={{ options: workerLabelOptions }}>
<Form.Item<FormData>
name="worker_selector"
rules={[
@@ -308,7 +308,7 @@ const ScheduleTypeForm: React.FC = () => {
}
></LabelSelector>
</Form.Item>
</LabelSelectorContext.Provider>
</LabelSelectorProvider>
</>
)}
</>
+12 -10
View File
@@ -1,9 +1,11 @@
import AutoComlete from '@/components/seal-form/auto-complete';
import CheckboxField from '@/components/seal-form/checkbox-field';
import SealInputNumber from '@/components/seal-form/input-number';
import SealInput from '@/components/seal-form/seal-input';
import SealSelect from '@/components/seal-form/seal-select';
import useAppUtils from '@/hooks/use-app-utils';
import {
AutoComplete,
CheckboxField,
Input as CInput,
InputNumber as CInputNumber,
Select as SealSelect
} from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
@@ -154,7 +156,7 @@ const SpeculativeDecode = () => {
}
]}
>
<AutoComlete
<AutoComplete
required
allowClear
loading={loading}
@@ -173,14 +175,14 @@ const SpeculativeDecode = () => {
}}
onBlur={handleOnDraftBlur}
onSelect={handleDraftSelect}
></AutoComlete>
></AutoComplete>
</Form.Item>
)}
<Form.Item<FormData>
name={['speculative_config', 'num_draft_tokens']}
>
<SealInputNumber
<CInputNumber
label={intl.formatMessage({ id: 'models.form.numDraftTokens' })}
min={1}
step={1}
@@ -193,7 +195,7 @@ const SpeculativeDecode = () => {
<Form.Item<FormData>
name={['speculative_config', 'ngram_min_match_length']}
>
<SealInputNumber
<CInputNumber
label={intl.formatMessage({
id: 'models.form.ngramMinMatchLength'
})}
@@ -204,7 +206,7 @@ const SpeculativeDecode = () => {
<Form.Item<FormData>
name={['speculative_config', 'ngram_max_match_length']}
>
<SealInput.Input
<CInput.Input
label={intl.formatMessage({
id: 'models.form.ngramMaxMatchLength'
})}