chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { modelsExpandKeysAtom, modelsSessionAtom } from '@/atoms/models';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import { PageAction } from '@/config';
|
||||
import useBodyScroll from '@/hooks/use-body-scroll';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { ScrollerContext } from '@/pages/_components/infinite-scroller/use-scroller-context';
|
||||
import { IS_FIRST_LOGIN, writeState } from '@/utils/localstore/index';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
FilterBar,
|
||||
IconFont,
|
||||
InfiniteScrollerProvider
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { message } from 'antd';
|
||||
import { useAtom } from 'jotai';
|
||||
@@ -143,7 +145,7 @@ const Catalog: React.FC = () => {
|
||||
buttonIcon={<SearchOutlined />}
|
||||
widths={{ input: 230, select: 200 }}
|
||||
></FilterBar>
|
||||
<ScrollerContext.Provider
|
||||
<InfiniteScrollerProvider
|
||||
value={{
|
||||
total: dataSource.totalPage,
|
||||
current: queryParams.page,
|
||||
@@ -171,7 +173,7 @@ const Catalog: React.FC = () => {
|
||||
title={intl.formatMessage({ id: 'noresult.catalog.title' })}
|
||||
subTitle={intl.formatMessage({ id: 'noresult.catalog.subTitle' })}
|
||||
></NoResult>
|
||||
</ScrollerContext.Provider>
|
||||
</InfiniteScrollerProvider>
|
||||
<DelopyBuiltInModal
|
||||
open={openDeployModal.show}
|
||||
action={PageAction.CREATE}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import HotKeys from '@/config/hotkeys';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
import React from 'react';
|
||||
import { modelCategoriesMap, modelSourceMap } from './index';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import TableContext from '@/components/seal-table/table-context';
|
||||
import { TableOrder } from '@/components/seal-table/types';
|
||||
import { PaginationKey } from '@/config/settings';
|
||||
import useSetChunkRequest from '@/hooks/use-chunk-request';
|
||||
import { usePaginationStatus } from '@/hooks/use-pagination-status';
|
||||
import { useTableMultiSort } from '@/hooks/use-table-sort';
|
||||
import useUpdateChunkedList from '@/hooks/use-update-chunk-list';
|
||||
import { TableProvider } from '@gpustack/core-ui';
|
||||
import { TableOrder } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import _ from 'lodash';
|
||||
import qs from 'query-string';
|
||||
@@ -337,7 +337,7 @@ const Models = forwardRef((props, ref) => {
|
||||
};
|
||||
|
||||
const handleOnSortChange = (order: TableOrder | Array<TableOrder>) => {
|
||||
let orderList = Array.isArray(order) ? order : [order];
|
||||
const orderList = Array.isArray(order) ? order : [order];
|
||||
if (orderList[0].columnKey === 'replicas') {
|
||||
orderList.push({
|
||||
columnKey: 'ready_replicas',
|
||||
@@ -439,7 +439,7 @@ const Models = forwardRef((props, ref) => {
|
||||
}));
|
||||
|
||||
return (
|
||||
<TableContext.Provider
|
||||
<TableProvider
|
||||
value={{
|
||||
allChildren: modelInstances,
|
||||
setDisableExpand: setDisableExpand
|
||||
@@ -470,7 +470,7 @@ const Models = forwardRef((props, ref) => {
|
||||
deleteIds={dataSource.deletedIds}
|
||||
filterValues={filterValues}
|
||||
></TableList>
|
||||
</TableContext.Provider>
|
||||
</TableProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import FilterForm from '@/pages/_components/filter-form';
|
||||
import { BaseSelect, FilterForm } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import { forwardRef, useImperativeHandle, useRef } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { modelCategories } from '../config';
|
||||
import useFilterStatus from '../hooks/use-filter-status';
|
||||
|
||||
const Content = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -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,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';
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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,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();
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -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'
|
||||
})}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import CommandViewer from '@/pages/_components/command-viewer';
|
||||
import {
|
||||
AUDIO_SPEECH_TO_TEXT_API,
|
||||
AUDIO_TEXT_TO_SPEECH_API,
|
||||
@@ -16,6 +15,7 @@ import { generateEmbeddingCurlCode } from '@/pages/playground/view-code/embeddin
|
||||
import { generateImageCurlCode } from '@/pages/playground/view-code/image';
|
||||
import { generateLLmCurlCode } from '@/pages/playground/view-code/llm';
|
||||
import { generateRerankCurlCode } from '@/pages/playground/view-code/rerank';
|
||||
import { CommandViewer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { useState } from 'react';
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// columns.ts
|
||||
import { systemConfigAtom } from '@/atoms/system';
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import { SealColumnProps } from '@/components/seal-table/types';
|
||||
import { OPENAI_COMPATIBLE, tableSorter } from '@/config/settings';
|
||||
import GrafanaIcon from '@/pages/_components/grafana-icon';
|
||||
import { TargetStatusValueMap } from '@/pages/model-routes/config';
|
||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import { AutoTooltip, DropdownButtons, GrafanaIcon } from '@gpustack/core-ui';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
import { ColumnProps } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { Tooltip } from 'antd';
|
||||
@@ -18,7 +16,6 @@ import { useMemo } from 'react';
|
||||
import ModelTag from '../../_components/model-tag';
|
||||
import { generateSource } from '../config/button-actions';
|
||||
import { ListItem } from '../config/types';
|
||||
|
||||
interface ActionItem {
|
||||
label: string;
|
||||
key: string;
|
||||
@@ -101,7 +98,7 @@ const useModelsColumns = ({
|
||||
clusterList,
|
||||
sortOrder,
|
||||
targetList
|
||||
}: ModelsColumnsHookProps & { targetList: any[] }): SealColumnProps[] => {
|
||||
}: ModelsColumnsHookProps & { targetList: any[] }): ColumnProps[] => {
|
||||
const intl = useIntl();
|
||||
const systemConfig = useAtomValue(systemConfigAtom);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { clusterSessionAtom } from '@/atoms/clusters';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import NoResult from '@/pages/_components/no-result';
|
||||
import { IconFont, NoResult } from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { useAtom } from 'jotai';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PageSize } from '@/components/logs-viewer/config';
|
||||
import useBodyScroll from '@/hooks/use-body-scroll';
|
||||
import { PageSize } from '@gpustack/core-ui/lib/components/logs-viewer/config';
|
||||
import { useState } from 'react';
|
||||
import { MODEL_INSTANCE_API } from '../apis';
|
||||
import { InstanceRealtimeLogStatus } from '../config';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { PageContainerInner } from '@/pages/_components/page-box';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { Segmented, Tabs } from 'antd';
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import NoResult from '@/pages/_components/no-result';
|
||||
import PageBox from '@/pages/_components/page-box';
|
||||
import { DeleteModal, FilterBar, IconFont, NoResult } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { ConfigProvider, Table } from 'antd';
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import { ListItem as workerListItem } from '@/pages/resources/config/types';
|
||||
import { SearchOutlined, SyncOutlined } from '@ant-design/icons';
|
||||
import { BaseSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Input, Space } from 'antd';
|
||||
import React from 'react';
|
||||
import useFilterStatus from '../hooks/use-filter-status';
|
||||
|
||||
interface LeftFiltersProps {
|
||||
handleNameChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
handleClusterChange: (value: number) => void;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// columns.ts
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { ListItem as workerListItem } from '@/pages/resources/config/types';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { ThunderboltFilled } from '@ant-design/icons';
|
||||
import { AutoTooltip, IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
import dayjs from 'dayjs';
|
||||
@@ -19,7 +18,6 @@ import NameCell, {
|
||||
} from '../components/instance-cells/name-cell';
|
||||
import { ModelInstanceListItem as ListItem } from '../config/types';
|
||||
import { calcTotalVram } from '../utils';
|
||||
|
||||
const WorkerInfoContent: React.FC<NameCellProps> = ({ record, modelData }) => {
|
||||
let workerIp = '-';
|
||||
if (record.worker_ip) {
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import PageTools from '@/components/page-tools';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import CardList from '@/components/templates/card-list';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { SyncOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
BaseSelect,
|
||||
IconFont,
|
||||
InfiniteScrollerProvider,
|
||||
NoResult,
|
||||
PageTools,
|
||||
TemplateCardList
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import useMemoizedFn from 'ahooks/lib/useMemoizedFn';
|
||||
import { Button, Input, Space } from 'antd';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { ScrollerContext } from '../_components/infinite-scroller/use-scroller-context';
|
||||
import NoResult from '../_components/no-result';
|
||||
import PageBox from '../_components/page-box';
|
||||
import { MY_MODELS_API, queryMyModels } from './apis';
|
||||
import ModelItem from './components/model-item';
|
||||
@@ -19,7 +21,6 @@ import {
|
||||
MyModelsStatusValueMap
|
||||
} from './config';
|
||||
import { categoryToPathMap } from './config/button-actions';
|
||||
|
||||
const Dot = ({ color }: { color: string }) => {
|
||||
return (
|
||||
<span
|
||||
@@ -222,7 +223,7 @@ const UserModels: React.FC = () => {
|
||||
</Space>
|
||||
}
|
||||
></PageTools>
|
||||
<ScrollerContext.Provider
|
||||
<InfiniteScrollerProvider
|
||||
value={{
|
||||
total: dataSource.totalPage,
|
||||
current: queryParams.page,
|
||||
@@ -230,13 +231,13 @@ const UserModels: React.FC = () => {
|
||||
refresh: loadMore
|
||||
}}
|
||||
>
|
||||
<CardList
|
||||
<TemplateCardList
|
||||
dataList={dataList}
|
||||
loading={dataSource.loading}
|
||||
activeId={false}
|
||||
isFirst={!dataSource.loadend}
|
||||
renderItem={renderCard}
|
||||
></CardList>
|
||||
></TemplateCardList>
|
||||
<NoResult
|
||||
loading={dataSource.loading}
|
||||
loadend={dataSource.loadend}
|
||||
@@ -249,7 +250,7 @@ const UserModels: React.FC = () => {
|
||||
title={intl.formatMessage({ id: 'noresult.mymodels.title' })}
|
||||
subTitle={intl.formatMessage({ id: 'noresult.mymodels.subTitle' })}
|
||||
></NoResult>
|
||||
</ScrollerContext.Provider>
|
||||
</InfiniteScrollerProvider>
|
||||
</PageBox>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user