chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user