chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import YamlEditor from '@/pages/_components/yaml-editor';
|
||||
import { Input as CInput, IconFont, YamlEditor } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form } from 'antd';
|
||||
import React, { forwardRef, useImperativeHandle } from 'react';
|
||||
@@ -46,7 +44,7 @@ const AdvanceConfig: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.TextArea required={false} trim={false}></SealInput.TextArea>
|
||||
<CInput.TextArea required={false} trim={false}></CInput.TextArea>
|
||||
</Form.Item>
|
||||
<YamlEditor
|
||||
ref={editorRef}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import MetadataList from '@/components/metadata-list';
|
||||
import Password from '@/components/seal-form/password';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { MetadataList, Password } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
|
||||
const AccessToken = () => {
|
||||
const intl = useIntl();
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import Password from '@/components/seal-form/password';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import {
|
||||
Input as CInput,
|
||||
Password,
|
||||
Select as SealSelect
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import ProviderLogo from '../components/provider-logo';
|
||||
@@ -10,7 +12,6 @@ import { useFormContext } from '../config/form-context';
|
||||
import { maasProviderOptions } from '../config/providers';
|
||||
import { FormData } from '../config/types';
|
||||
import ProviderConfigs from './provider-configs';
|
||||
|
||||
const Basic: React.FC<{
|
||||
onAPIKeyBlur?: (e: any) => void;
|
||||
}> = ({ onAPIKeyBlur }) => {
|
||||
@@ -49,7 +50,7 @@ const Basic: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.name'
|
||||
@@ -98,12 +99,12 @@ const Basic: React.FC<{
|
||||
/>
|
||||
</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>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
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 useFinishFailed from '@/pages/_components/scroll-spy-tabs/use-finish-failed';
|
||||
import useScrollActiveChange from '@/pages/_components/scroll-spy-tabs/use-scroll-active-change';
|
||||
import { json2Yaml, yaml2Json } from '@/pages/backends/config';
|
||||
import { CollapsePanel, IconFont, ScrollSpyTabs } from '@gpustack/core-ui';
|
||||
import { useWrapperContext } from '@gpustack/core-ui/lib/components/column-wrapper/use-wrapper-context';
|
||||
import useFinishFailed from '@gpustack/core-ui/lib/components/scroll-spy-tabs/use-finish-failed';
|
||||
import useScrollActiveChange from '@gpustack/core-ui/lib/components/scroll-spy-tabs/use-scroll-active-change';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import AutoComplete from '@/components/seal-form/auto-complete';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import { categoryOptions, modelCategoriesMap } from '@/pages/llmodels/config';
|
||||
import {
|
||||
@@ -7,6 +5,7 @@ import {
|
||||
LoadingOutlined,
|
||||
WarningFilled
|
||||
} from '@ant-design/icons';
|
||||
import { AutoComplete, Select as SealSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form, Tooltip } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import Password from '@/components/seal-form/password';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { Input as CInput, Password } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
|
||||
const ProviderConfigs = () => {
|
||||
const intl = useIntl();
|
||||
const form = Form.useFormInstance<FormData>();
|
||||
@@ -35,12 +33,12 @@ const ProviderConfigs = () => {
|
||||
key={item.name}
|
||||
>
|
||||
{item.type === 'Input' && (
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required={item.required}
|
||||
description={renderDescription(item)}
|
||||
label={renderLabel(item)}
|
||||
placeholder={item.placeholder}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
)}
|
||||
{item.type === 'Password' && (
|
||||
<Password
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import CheckboxField from '@/components/seal-form/checkbox-field';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { CheckboxField, Input as CInput } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React from 'react';
|
||||
@@ -60,17 +59,17 @@ const AdvanceConfig = () => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required
|
||||
label={intl.formatMessage({ id: 'providers.form.proxy.url' })}
|
||||
placeholder="http://proxy.example.com:8080"
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item name="proxy_timeout">
|
||||
<SealInput.Number
|
||||
<CInput.Number
|
||||
label={intl.formatMessage({ id: 'providers.form.proxy.timeout' })}
|
||||
placeholder="30"
|
||||
></SealInput.Number>
|
||||
></CInput.Number>
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import MetadataList from '@/components/metadata-list';
|
||||
import { PageAction } from '@/config';
|
||||
import { MetadataList } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
Reference in New Issue
Block a user