chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import AlertBlockInfo from '@/components/alert-info/block';
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import FormDrawer from '@/pages/_components/form-drawer';
|
||||
import { AlertBlockInfo, FormDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React, { useRef } from 'react';
|
||||
import { FormData, RouteItem as ListItem } from '../config/types';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import RowChildren from '@/components/seal-table/components/row-children';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import ProviderLogo from '@/pages/maas-provider/components/provider-logo';
|
||||
import { DeleteOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
DropdownButtons,
|
||||
RowChildren,
|
||||
StatusTag
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Col, Row } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
@@ -11,7 +13,6 @@ import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { TargetStatus, TargetStatusLabelMap } from '../config';
|
||||
import { RouteTarget } from '../config/types';
|
||||
|
||||
const CellContent = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -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';
|
||||
|
||||
export const TargetStatusValueMap: Record<string, string> = {
|
||||
Active: 'active',
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import CheckboxField from '@/components/seal-form/checkbox-field';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import CategorySelect from '@/pages/_components/category-select';
|
||||
import DocLink from '@/pages/_components/doc-link';
|
||||
import { categoryOptions } from '@/pages/llmodels/config';
|
||||
import { CheckboxField, Input as CInput } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import { genericReferLink } from '../config';
|
||||
@@ -25,7 +24,7 @@ const Basic = () => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required
|
||||
label={intl.formatMessage({ id: 'common.table.name' })}
|
||||
/>
|
||||
@@ -56,12 +55,12 @@ const Basic = () => {
|
||||
></CategorySelect>
|
||||
</Form.Item>
|
||||
<Form.Item name="description" style={{ marginBottom: 8 }}>
|
||||
<SealInput.TextArea
|
||||
<CInput.TextArea
|
||||
scaleSize={true}
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.description'
|
||||
})}
|
||||
></SealInput.TextArea>
|
||||
></CInput.TextArea>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="generic_proxy"
|
||||
|
||||
@@ -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 { modelCategoriesMap } from '@/pages/llmodels/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';
|
||||
@@ -87,7 +85,7 @@ const AccessForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
|
||||
|
||||
const formatTargets = (values: FormData) => {
|
||||
let targetList = [...(values.targets || [])];
|
||||
let fallbackTarget = values.fallback_target;
|
||||
const fallbackTarget = values.fallback_target;
|
||||
|
||||
if (fallbackTarget) {
|
||||
const exsitinged = targetList.find((ep) => {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import SingleImage from '@/components/auto-image/single-image';
|
||||
import ListInput from '@/components/list-input';
|
||||
import SealInputNumber from '@/components/seal-form/input-number';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import UploadImg from '@/pages/playground/components/upload-img';
|
||||
import {
|
||||
Input as CInput,
|
||||
InputNumber as CInputNumber,
|
||||
ListInput,
|
||||
SingleImage
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form } from 'antd';
|
||||
import styled from 'styled-components';
|
||||
@@ -62,26 +64,26 @@ const MetaData = () => {
|
||||
name={['meta', 'size']}
|
||||
normalize={(v) => (v === 0 ? null : v)}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
label={`${intl.formatMessage({ id: 'routes.form.metadata.size' })} (B)`}
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name={['meta', 'activated_size']}
|
||||
normalize={(v) => (v === 0 ? null : v)}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
label={`${intl.formatMessage({
|
||||
id: 'routes.form.metadata.activeSize'
|
||||
})} (B)`}
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
</SizeWrapper>
|
||||
<SizeWrapper>
|
||||
<Form.Item<FormData> name={['meta', 'max_tokens']}>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'routes.form.metadata.maxTokens'
|
||||
})}
|
||||
@@ -89,24 +91,24 @@ const MetaData = () => {
|
||||
{ id: 'common.help.eg' },
|
||||
{ content: 'context/128k' }
|
||||
)}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name={['meta', 'dimensions']}
|
||||
normalize={(v) => (v === 0 ? null : v)}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
step={1}
|
||||
precision={0}
|
||||
label={intl.formatMessage({
|
||||
id: 'routes.form.metadata.dimension'
|
||||
})}
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
</SizeWrapper>
|
||||
<Form.Item<FormData> name={['meta', 'release_date']}>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'routes.form.metadata.releaseDate'
|
||||
})}
|
||||
@@ -114,7 +116,7 @@ const MetaData = () => {
|
||||
{ id: 'common.help.eg' },
|
||||
{ content: '2025-05-19' }
|
||||
)}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name={['meta', 'tags']} data-field="metadata">
|
||||
<ListInput
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import MetadataList from '@/components/metadata-list';
|
||||
import InputNumber from '@/components/seal-form/input-number';
|
||||
import SealCascader from '@/components/seal-form/seal-cascader';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import ProviderLogo from '@/pages/maas-provider/components/provider-logo';
|
||||
import {
|
||||
AutoTooltip,
|
||||
InputNumber,
|
||||
MetadataList,
|
||||
Cascader as SealCascader
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, Tooltip } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -19,7 +21,6 @@ import styled from 'styled-components';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
import useTargetSourceModels from '../hooks/use-target-source-models';
|
||||
|
||||
const OptionWrapper = styled.span`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
// columns.ts
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { SealColumnProps } from '@/components/seal-table/types';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import ModelTag from '@/pages/_components/model-tag';
|
||||
import { AutoTooltip, DropdownButtons } from '@gpustack/core-ui';
|
||||
import { type ColumnProps } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import dayjs from 'dayjs';
|
||||
import { useMemo } from 'react';
|
||||
import { rowActionList } from '../config';
|
||||
import { RouteItem } from '../config/types';
|
||||
|
||||
const useAccessColumns = (
|
||||
handleSelect: (val: string, record: RouteItem) => void,
|
||||
onCellClick?: (record: RouteItem, dataIndex: string) => void
|
||||
): SealColumnProps[] => {
|
||||
): ColumnProps[] => {
|
||||
const intl = useIntl();
|
||||
|
||||
const filterActions = (record: RouteItem) => {
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import { expandKeysAtom } from '@/atoms/clusters';
|
||||
import { registerRouteConfigAtom } from '@/atoms/routes';
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import SealTable from '@/components/seal-table';
|
||||
import TableContext from '@/components/seal-table/table-context';
|
||||
import { TableOrder } from '@/components/seal-table/types';
|
||||
import { PageAction } from '@/config';
|
||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import useExpandedRowKeys from '@/hooks/use-expanded-row-keys';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import useWatchList from '@/hooks/use-watch-list';
|
||||
import APIAccessInfoModal from '@/pages/llmodels/components/api-access-info';
|
||||
import {
|
||||
DeleteModal,
|
||||
FilterBar,
|
||||
IconFont,
|
||||
Table as SealTable,
|
||||
TableProvider
|
||||
} from '@gpustack/core-ui';
|
||||
import { TableOrder } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { message } from 'antd';
|
||||
@@ -291,7 +293,7 @@ const ModelRoutes: React.FC = () => {
|
||||
handleDeleteByBatch={handleDeleteBatch}
|
||||
handleClickPrimary={handleClickDropdown}
|
||||
></FilterBar>
|
||||
<TableContext.Provider
|
||||
<TableProvider
|
||||
value={{
|
||||
allChildren: allRouteTargets,
|
||||
setDisableExpand: setDisableExpand
|
||||
@@ -342,7 +344,7 @@ const ModelRoutes: React.FC = () => {
|
||||
onChange: handlePageChange
|
||||
}}
|
||||
></SealTable>
|
||||
</TableContext.Provider>
|
||||
</TableProvider>
|
||||
</PageBox>
|
||||
<AddRouteModal
|
||||
open={openRouteModalStatus.open}
|
||||
|
||||
Reference in New Issue
Block a user