chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PageActionType } from '@/config/types';
|
||||
import FormDrawer from '@/pages/_components/form-drawer';
|
||||
import { FormDrawer } from '@gpustack/core-ui';
|
||||
import React, { useRef } from 'react';
|
||||
import { FormData, MaasProviderItem as ListItem } from '../config/types';
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import OverlayScroller from '@/components/overlay-scroller';
|
||||
import { CheckCircleOutlined } from '@ant-design/icons';
|
||||
import { AutoTooltip, OverlayScroller } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Flex, Popover, Tag } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import { categoryConfig } from '../../_components/model-tag';
|
||||
import { ProviderModel } from '../config/types';
|
||||
|
||||
interface ProviderModelProps {
|
||||
dataList: ProviderModel[];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import { StatusMaps } from '@/config';
|
||||
import { StatusType } from '@/config/types';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
import { ProviderEnum } from './providers';
|
||||
export { maasProviderLabelMap, maasProviderOptions } from './providers';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// columns.ts
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { AutoTooltip, DropdownButtons } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tag } from 'antd';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
@@ -12,7 +11,6 @@ import ProviderModels from '../components/provider-models';
|
||||
import { rowActionList } from '../config';
|
||||
import { maasProviderLabelMap } from '../config/providers';
|
||||
import { MaasProviderItem, ProviderModel } from '../config/types';
|
||||
|
||||
const useProviderColumns = (
|
||||
handleSelect: (val: string, record: MaasProviderItem) => void,
|
||||
onCellClick?: (record: MaasProviderItem, dataIndex: string) => void
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createAxiosToken } from '@/hooks/use-chunk-request';
|
||||
import ErrorMessageContent from '@/pages/_components/error-message-content';
|
||||
import { ErrorMessage } from '@gpustack/core-ui';
|
||||
import { useRequest } from 'ahooks';
|
||||
import { message } from 'antd';
|
||||
import { CancelTokenSource } from 'axios';
|
||||
@@ -112,9 +112,9 @@ export const useTestProviderModel = () => {
|
||||
if (!response?.accessible) {
|
||||
message.error({
|
||||
content: (
|
||||
<ErrorMessageContent
|
||||
<ErrorMessage
|
||||
errMsg={response?.error_message || 'Test model failed'}
|
||||
></ErrorMessageContent>
|
||||
></ErrorMessage>
|
||||
)
|
||||
});
|
||||
}
|
||||
@@ -122,9 +122,9 @@ export const useTestProviderModel = () => {
|
||||
onError: (error) => {
|
||||
message.error({
|
||||
content: (
|
||||
<ErrorMessageContent
|
||||
<ErrorMessage
|
||||
errMsg={error?.message || 'Test model failed'}
|
||||
></ErrorMessageContent>
|
||||
></ErrorMessage>
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import { PageAction } from '@/config';
|
||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { DeleteModal, FilterBar, IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { ConfigProvider, message, Table } from 'antd';
|
||||
|
||||
Reference in New Issue
Block a user