chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import AlertBlockInfo from '@/components/alert-info/block';
|
||||
import TooltipList from '@/components/tooltip-list';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import TransferInner from '@/pages/_components/transfer';
|
||||
import { RouteItem } from '@/pages/model-routes/config/types';
|
||||
import { queryUsersList } from '@/pages/users/apis';
|
||||
import { DownOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AlertBlockInfo,
|
||||
TooltipList,
|
||||
Transfer as TransferInner
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import {
|
||||
Checkbox,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
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 { RouteItem } from '@/pages/model-routes/config/types';
|
||||
import { AlertBlockInfo, FormDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { message } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import CopyButton from '@/components/copy-button';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import { OPENAI_COMPATIBLE } from '@/config/settings';
|
||||
import {
|
||||
AUDIO_SPEECH_TO_TEXT_API,
|
||||
@@ -13,6 +9,12 @@ import {
|
||||
RERANKER_API
|
||||
} from '@/pages/playground/apis';
|
||||
import { BulbOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
CopyButton,
|
||||
IconFont,
|
||||
ScrollerModal
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { Button, Tag } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -21,7 +23,6 @@ import styled from 'styled-components';
|
||||
import { modelCategoriesMap } from '../config';
|
||||
import { ListItem } from '../config/types';
|
||||
import useGenericProxy from '../hooks/use-generic-proxy';
|
||||
|
||||
const API_MAP: Record<string, { api: string }> = {
|
||||
[modelCategoriesMap.embedding]: {
|
||||
api: EMBEDDING_API
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import fallbackImg from '@/assets/images/img.png';
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import { categoryConfig } from '@/pages/_components/model-tag';
|
||||
import { AutoTooltip, IconFont, ThemeTag } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Typography } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
@@ -11,7 +9,6 @@ import React, { useCallback, useMemo } from 'react';
|
||||
import { modelCategories } from '../../config';
|
||||
import { CatalogItem as CatalogItemType } from '../../config/types';
|
||||
import '../../style/catalog-item.less';
|
||||
|
||||
interface CatalogItemProps {
|
||||
activeId: number;
|
||||
data: CatalogItemType;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import ResizeContainer from '@/components/resize-container';
|
||||
import CatalogSkelton from '@/components/templates/card-skelton';
|
||||
import InfiniteScroller from '@/pages/_components/infinite-scroller';
|
||||
import { useScrollerContext } from '@/pages/_components/infinite-scroller/use-scroller-context';
|
||||
import {
|
||||
InfiniteScroller,
|
||||
ResizeContainer,
|
||||
TemplateCardSkeleton
|
||||
} from '@gpustack/core-ui';
|
||||
import { useScrollerContext } from '@gpustack/core-ui/lib/components/infinite-scroller/use-scroller-context';
|
||||
import { Spin } from 'antd';
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
@@ -45,7 +47,7 @@ const ListSkeleton: React.FC<{
|
||||
root: 'skelton-wrapper'
|
||||
}}
|
||||
>
|
||||
{isFirst && <CatalogSkelton></CatalogSkelton>}
|
||||
{isFirst && <TemplateCardSkeleton></TemplateCardSkeleton>}
|
||||
</Spin>
|
||||
</SpinWrapper>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import AlertBlockInfo from '@/components/alert-info/block';
|
||||
import { CloseOutlined } from '@ant-design/icons';
|
||||
import { AlertBlockInfo } from '@gpustack/core-ui';
|
||||
import { Button } from 'antd';
|
||||
import { isArray } from 'lodash';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import { createAxiosToken } from '@/hooks/use-chunk-request';
|
||||
import ColumnWrapper from '@/pages/_components/column-wrapper';
|
||||
import { ClusterStatusValueMap } from '@/pages/cluster-management/config';
|
||||
import { ColumnWrapper, GSDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, message } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { getRequestId } from '@/atoms/models';
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useDeferredRequest from '@/hooks/use-deferred-request';
|
||||
import { ClusterStatusValueMap } from '@/pages/cluster-management/config';
|
||||
import { GSDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { Button } from 'antd';
|
||||
@@ -349,7 +348,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
|
||||
updateSelectedModel(item);
|
||||
|
||||
let warningStatus: MessageStatus = {
|
||||
const warningStatus: MessageStatus = {
|
||||
show: true,
|
||||
title: '',
|
||||
type: 'transition',
|
||||
@@ -496,7 +495,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
source: source
|
||||
});
|
||||
} else {
|
||||
let backend = checkOnlyAscendNPU(gpuOptions)
|
||||
const backend = checkOnlyAscendNPU(gpuOptions)
|
||||
? backendOptionsMap.ascendMindie
|
||||
: backendOptionsMap.vllm;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import ColumnWrapper from '@/pages/_components/column-wrapper';
|
||||
import { ColumnWrapper, GSDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import _ from 'lodash';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { ProviderValueMap } from '@/pages/cluster-management/config';
|
||||
import { GSDrawer, ModalFooter } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { debounce } from 'lodash';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import SealCascader from '@/components/seal-form/seal-cascader';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import TooltipList from '@/components/tooltip-list';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { ModelFileFormData as FormData } from '@/pages/resources/config/types';
|
||||
import {
|
||||
Input as CInput,
|
||||
Cascader as SealCascader,
|
||||
Select as SealSelect,
|
||||
TooltipList
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -131,12 +133,12 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required
|
||||
label={intl.formatMessage({ id: 'models.form.filePath' })}
|
||||
onBlur={handleOnLocalPathBlur}
|
||||
description={<TooltipList list={localPathTipsList}></TooltipList>}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
@@ -222,7 +224,7 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
description={
|
||||
<span
|
||||
dangerouslySetInnerHTML={{
|
||||
@@ -235,7 +237,7 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
|
||||
label={intl.formatMessage({
|
||||
id: 'resources.modelfiles.form.localdir'
|
||||
})}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
)}
|
||||
</Form>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { AutoTooltip } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import '../style/gpu-card.less';
|
||||
|
||||
const CardWrapper = styled.div`
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
||||
import { LoadingOutlined, WarningOutlined } from '@ant-design/icons';
|
||||
import { TooltipOverlayScroller } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tag, Tooltip } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { HandlerOptions } from '@/hooks/use-chunk-fetch';
|
||||
import useDownloadStream from '@/hooks/use-download-stream';
|
||||
import { useBenchmarkTargetInstance } from '@/pages/llmodels/hooks/use-run-benchmark';
|
||||
import { DeleteOutlined, DownloadOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
DropdownButtons,
|
||||
IconFont,
|
||||
useDownloadStream
|
||||
} from '@gpustack/core-ui';
|
||||
import { HandlerOptions } from '@gpustack/core-ui/lib/hooks/use-chunk-fetch';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Progress, notification } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import InfoColumn from '@/components/simple-table/info-column';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||
import { InfoColumn, ThemeTag } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tooltip } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
||||
import SimpleTabel, { ColumnProps } from '@/components/simple-table';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import { ListItem as WorkerListItem } from '@/pages/resources/config/types';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
SimpleTable,
|
||||
ThemeTag,
|
||||
TooltipOverlayScroller,
|
||||
type ColumnProps
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
@@ -114,11 +117,11 @@ const DistributedServerList: React.FC<DistributeInfoCellProps> = ({
|
||||
|
||||
return (
|
||||
<div>
|
||||
<SimpleTabel
|
||||
<SimpleTable
|
||||
rowKey="worker_name"
|
||||
columns={distributeCols}
|
||||
dataSource={[...mainWorker, ...list]}
|
||||
></SimpleTabel>
|
||||
></SimpleTable>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SimpleTabel, { ColumnProps } from '@/components/simple-table';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { ListItem as WorkerListItem } from '@/pages/resources/config/types';
|
||||
import { SimpleTable, StatusTag } from '@gpustack/core-ui';
|
||||
import { type ColumnProps } from '@gpustack/core-ui/lib/components/simple-table';
|
||||
import { Progress, Tooltip } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { InstanceStatusMap, status } from '../../config';
|
||||
@@ -102,21 +102,21 @@ const DownloadingTips = (props: {
|
||||
return (
|
||||
<div>
|
||||
{severList.length > 0 && (
|
||||
<SimpleTabel
|
||||
<SimpleTable
|
||||
columns={downloadList}
|
||||
dataSource={[...mainWorker, ...list]}
|
||||
rowKey="worker_name"
|
||||
theme="light"
|
||||
></SimpleTabel>
|
||||
></SimpleTable>
|
||||
)}
|
||||
|
||||
{draftModelList.length > 0 && (
|
||||
<SimpleTabel
|
||||
<SimpleTable
|
||||
columns={draftModelDownloadList}
|
||||
dataSource={[...draftModelList]}
|
||||
rowKey="worker_name"
|
||||
theme="light"
|
||||
></SimpleTabel>
|
||||
></SimpleTable>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { StatusTag } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import {
|
||||
HddFilled,
|
||||
@@ -7,13 +5,13 @@ import {
|
||||
PieChartFilled,
|
||||
ThunderboltFilled
|
||||
} from '@ant-design/icons';
|
||||
import { AutoTooltip, IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tooltip } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, { useEffect } from 'react';
|
||||
import { ModelInstanceListItem } from '../../config/types';
|
||||
import '../../style/instance-item.less';
|
||||
|
||||
export interface NameCellProps {
|
||||
record: ModelInstanceListItem;
|
||||
modelData: any;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import RowChildren from '@/components/seal-table/components/row-children';
|
||||
import { ListItem as WorkerListItem } from '@/pages/resources/config/types';
|
||||
import { AutoTooltip, RowChildren } from '@gpustack/core-ui';
|
||||
import { Col, Row } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import React from 'react';
|
||||
@@ -12,7 +11,6 @@ import DistributeInfoCell from '../instance-cells/distribute-info-cell';
|
||||
import DownloadingStatusCell from '../instance-cells/downloading-status-cell';
|
||||
import InstanceStatusCell from '../instance-cells/instance-status-cell';
|
||||
import NameCell from '../instance-cells/name-cell';
|
||||
|
||||
interface InstanceItemProps {
|
||||
instanceData: ModelInstanceListItem;
|
||||
workerList: WorkerListItem[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FiltersButton } from '@/components/page-tools/index';
|
||||
import { SearchOutlined, SyncOutlined } from '@ant-design/icons';
|
||||
import { FiltersButton } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Input, Space } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import TagWrapper from '@/components/tags-wrapper';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import Card from '@/components/templates/card';
|
||||
import {
|
||||
IconFont,
|
||||
StatusTag,
|
||||
TagsWrapper,
|
||||
TemplateCard,
|
||||
ThemeTag
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -163,7 +165,7 @@ const ModelItem: React.FC<{
|
||||
|
||||
return (
|
||||
<CardWrapper>
|
||||
<Card
|
||||
<TemplateCard
|
||||
height={140}
|
||||
onClick={() => onClick(model)}
|
||||
clickable={false}
|
||||
@@ -222,11 +224,11 @@ const ModelItem: React.FC<{
|
||||
{model.meta?.voices?.length > 0 && (
|
||||
<>
|
||||
<Dot></Dot>
|
||||
<TagWrapper
|
||||
<TagsWrapper
|
||||
gap={8}
|
||||
dataList={model.meta?.voices}
|
||||
renderTag={renderTag}
|
||||
></TagWrapper>
|
||||
></TagsWrapper>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -243,7 +245,7 @@ const ModelItem: React.FC<{
|
||||
</div>
|
||||
</div>
|
||||
</ModelItemContent>
|
||||
</Card>
|
||||
</TemplateCard>
|
||||
</CardWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { getRequestId } from '@/atoms/models';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import SimpleOverlay from '@/components/simple-overlay';
|
||||
import { BaseSelect, SimpleOverlay } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Empty, Spin } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -22,7 +21,6 @@ import '../../style/hf-model-file.less';
|
||||
import TitleWrapper from '../title-wrapper';
|
||||
import FileSkeleton from './file-skeleton';
|
||||
import ModelFileItem from './model-file-item';
|
||||
|
||||
const ItemFileWrapper = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { formatNumber } from '@/utils';
|
||||
import { DownloadOutlined, HeartOutlined } from '@ant-design/icons';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import classNames from 'classnames';
|
||||
import dayjs from 'dayjs';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import MarkdownViewer from '@/components/markdown-viewer';
|
||||
import SimpleOverlay from '@/components/simple-overlay';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import useRequestToken from '@/hooks/use-request-token';
|
||||
import {
|
||||
@@ -9,6 +5,12 @@ import {
|
||||
FileMarkdownOutlined,
|
||||
RightOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
IconFont,
|
||||
MarkdownViewer,
|
||||
SimpleOverlay,
|
||||
ThemeTag
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Empty, Spin, Tooltip } from 'antd';
|
||||
import { some } from 'lodash';
|
||||
@@ -131,7 +133,7 @@ const ModelCard: React.FC<{
|
||||
};
|
||||
|
||||
const removeMetadata = useCallback((str: string) => {
|
||||
let indexes = [];
|
||||
const indexes = [];
|
||||
let index = str.indexOf('---');
|
||||
|
||||
while (index !== -1) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||
import { ThemeTag, TooltipOverlayScroller } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import classNames from 'classnames';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import hotkeys from '@/config/hotkeys';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Input } from 'antd';
|
||||
import React, { useRef } from 'react';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { getRequestId, setRquestId } from '@/atoms/models';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import { createAxiosToken } from '@/hooks/use-chunk-request';
|
||||
import ColumnWrapper from '@/pages/_components/column-wrapper';
|
||||
import { BaseSelect, ColumnWrapper } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Pagination } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -23,7 +22,6 @@ import useRecognizeAudio from '../../hooks/use-recognize-audio';
|
||||
import SearchStyle from '../../style/search-result.less';
|
||||
import SearchInput from './search-input';
|
||||
import SearchResult from './search-result';
|
||||
|
||||
const filterOptions = [
|
||||
{ label: 'FP8', value: 'fp8' },
|
||||
{ label: 'AWQ', value: 'awq' },
|
||||
@@ -173,7 +171,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
||||
if (getRequestId() !== currentSearchId) {
|
||||
throw 'new request has been sent';
|
||||
}
|
||||
let list = _.map(data || [], (item: any) => {
|
||||
const list = _.map(data || [], (item: any) => {
|
||||
return {
|
||||
...item,
|
||||
value: item.name,
|
||||
@@ -210,28 +208,31 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
||||
throw 'new request has been sent';
|
||||
}
|
||||
|
||||
let list = _.map(_.get(data, 'Data.Model.Models') || [], (item: any) => {
|
||||
return {
|
||||
path: item.Path,
|
||||
name: `${item.Path}/${item.Name}`,
|
||||
downloads: item.Downloads,
|
||||
id: `${item.Path}/${item.Name}`,
|
||||
updatedAt: item.LastUpdatedTime * 1000,
|
||||
likes: item.Stars,
|
||||
value: item.Name,
|
||||
label: item.Name,
|
||||
revision: item.Revision,
|
||||
task: item.Tasks?.map((sItem: any) => sItem.Name).join(','),
|
||||
tags: item.Tags,
|
||||
libraries: item.Libraries,
|
||||
avatar: item.Avatar,
|
||||
isGGUF: checkIsGGUF({
|
||||
const list = _.map(
|
||||
_.get(data, 'Data.Model.Models') || [],
|
||||
(item: any) => {
|
||||
return {
|
||||
path: item.Path,
|
||||
name: `${item.Path}/${item.Name}`,
|
||||
downloads: item.Downloads,
|
||||
id: `${item.Path}/${item.Name}`,
|
||||
updatedAt: item.LastUpdatedTime * 1000,
|
||||
likes: item.Stars,
|
||||
value: item.Name,
|
||||
label: item.Name,
|
||||
revision: item.Revision,
|
||||
task: item.Tasks?.map((sItem: any) => sItem.Name).join(','),
|
||||
tags: item.Tags,
|
||||
libraries: item.Libraries
|
||||
}),
|
||||
source: modelSource
|
||||
};
|
||||
});
|
||||
libraries: item.Libraries,
|
||||
avatar: item.Avatar,
|
||||
isGGUF: checkIsGGUF({
|
||||
tags: item.Tags,
|
||||
libraries: item.Libraries
|
||||
}),
|
||||
source: modelSource
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
setPaginationInfo((prev) => {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Empty, Spin } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
import SealInputNumber from '@/components/seal-form/input-number';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Checkbox, Form, Tooltip } from 'antd';
|
||||
import { CheckboxChangeEvent } from 'antd/es/checkbox';
|
||||
import React from 'react';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
|
||||
const scheduleTypeTips = [
|
||||
{
|
||||
title: {
|
||||
text: 'models.form.scheduletype.auto',
|
||||
locale: true
|
||||
},
|
||||
tips: 'models.form.scheduletype.auto.tips'
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: 'models.form.scheduletype.manual',
|
||||
locale: true
|
||||
},
|
||||
tips: 'models.form.scheduletype.manual.tips'
|
||||
}
|
||||
];
|
||||
|
||||
const CheckboxField: React.FC<{
|
||||
title: string;
|
||||
label: string;
|
||||
checked?: boolean;
|
||||
onChange?: (e: CheckboxChangeEvent) => void;
|
||||
}> = ({ title, label, checked, onChange }) => {
|
||||
return (
|
||||
<Checkbox className="p-l-6" checked={checked} onChange={onChange}>
|
||||
<Tooltip title={title}>
|
||||
<span style={{ color: 'var(--ant-color-text-tertiary)' }}>{label}</span>
|
||||
<QuestionCircleOutlined
|
||||
className="m-l-4"
|
||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Checkbox>
|
||||
);
|
||||
};
|
||||
|
||||
const Scaling: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const { onValuesChange } = useFormContext();
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
const form = Form.useFormInstance();
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ paddingBottom: 22, paddingLeft: 10 }}>
|
||||
<Form.Item<FormData>
|
||||
name="enable_auto_scaling"
|
||||
valuePropName="checked"
|
||||
style={{ padding: '0 10px', marginBottom: 0 }}
|
||||
noStyle
|
||||
>
|
||||
<CheckboxField
|
||||
title="Enable auto scaling tips"
|
||||
label="Enable Auto Scaling"
|
||||
></CheckboxField>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<Form.Item<FormData>
|
||||
name="min_replicas"
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
min={0}
|
||||
style={{ width: '100%' }}
|
||||
label="Min Replicas"
|
||||
required
|
||||
></SealInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="max_replicas"
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
min={0}
|
||||
style={{ width: '100%' }}
|
||||
label="Max Replicas"
|
||||
required
|
||||
></SealInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="scale_to_zero_window"
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
min={0}
|
||||
style={{ width: '100%' }}
|
||||
label="Scale to Zero Window"
|
||||
required
|
||||
></SealInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="scale_down_window"
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
min={0}
|
||||
style={{ width: '100%' }}
|
||||
label="Scale Down Window"
|
||||
required
|
||||
></SealInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="scale_up_window"
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
min={0}
|
||||
style={{ width: '100%' }}
|
||||
label="Scale Up Window"
|
||||
required
|
||||
></SealInputNumber>
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Scaling;
|
||||
@@ -1,10 +1,4 @@
|
||||
import { modelsExpandKeysAtom, modelsSessionAtom } from '@/atoms/models';
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import DropDownActions from '@/components/drop-down-actions';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import PageTools from '@/components/page-tools';
|
||||
import SealTable from '@/components/seal-table';
|
||||
import { TableOrder } from '@/components/seal-table/types';
|
||||
import { PageAction } from '@/config';
|
||||
import { TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import { PageActionType } from '@/config/types';
|
||||
@@ -19,6 +13,14 @@ import useOpenPlayground from '@/pages/model-routes/hooks/use-open-playground';
|
||||
import useGranfanaLink from '@/pages/resources/hooks/use-grafana-link';
|
||||
import { handleBatchRequest } from '@/utils';
|
||||
import { DownOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
DeleteModal,
|
||||
DropdownActions,
|
||||
DropdownButtons,
|
||||
PageTools,
|
||||
Table as SealTable
|
||||
} from '@gpustack/core-ui';
|
||||
import { TableOrder } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl, useNavigate, useSearchParams } from '@umijs/max';
|
||||
import { useMemoizedFn, useToggle } from 'ahooks';
|
||||
import { Button, Space, message } from 'antd';
|
||||
@@ -164,7 +166,6 @@ const Models: React.FC<ModelsProps> = ({
|
||||
type: 'model'
|
||||
});
|
||||
|
||||
const [openLogModal, setOpenLogModal] = useState(false);
|
||||
const [openDeployModal, setOpenDeployModal] = useState<{
|
||||
show: boolean;
|
||||
width: number | string;
|
||||
@@ -599,23 +600,21 @@ const Models: React.FC<ModelsProps> = ({
|
||||
right={
|
||||
<Space size={16}>
|
||||
{ActionButton()}
|
||||
{page !== 'clusters' && (
|
||||
<DropDownActions
|
||||
menu={{
|
||||
items: sourceOptions,
|
||||
onClick: handleClickDropdown
|
||||
}}
|
||||
placement="bottomRight"
|
||||
<DropdownActions
|
||||
menu={{
|
||||
items: sourceOptions,
|
||||
onClick: handleClickDropdown
|
||||
}}
|
||||
placement="bottomRight"
|
||||
>
|
||||
<Button
|
||||
icon={<DownOutlined></DownOutlined>}
|
||||
type="primary"
|
||||
iconPlacement="end"
|
||||
>
|
||||
<Button
|
||||
icon={<DownOutlined></DownOutlined>}
|
||||
type="primary"
|
||||
iconPlacement="end"
|
||||
>
|
||||
{intl?.formatMessage?.({ id: 'models.button.deploy' })}
|
||||
</Button>
|
||||
</DropDownActions>
|
||||
)}
|
||||
{intl?.formatMessage?.({ id: 'models.button.deploy' })}
|
||||
</Button>
|
||||
</DropdownActions>
|
||||
<DropdownButtons
|
||||
items={ButtonList}
|
||||
extra={
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import LogsViewer from '@/components/logs-viewer/virtual-log-list';
|
||||
import useSetChunkRequest from '@/hooks/use-chunk-request';
|
||||
import { LogsViewer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Modal } from 'antd';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
Reference in New Issue
Block a user