chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
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 { useQueryClusterList } from '@/pages/cluster-management/services/use-query-cluster-list';
|
||||
import { FilterBar, IconFont, NoResult } from '@gpustack/core-ui';
|
||||
import { useIntl, useSearchParams } from '@umijs/max';
|
||||
import { ConfigProvider, Table } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import { modelsExpandKeysAtom } from '@/atoms/models';
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import { PageAction } from '@/config';
|
||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import useBodyScroll from '@/hooks/use-body-scroll';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import NoResult from '@/pages/_components/no-result';
|
||||
import PageBox from '@/pages/_components/page-box';
|
||||
import { createModel } from '@/pages/llmodels/apis';
|
||||
import DeployModal from '@/pages/llmodels/components/deployment/deploy-modal';
|
||||
@@ -22,6 +18,7 @@ import { backendOptionsMap } from '@/pages/llmodels/constants/backend-parameters
|
||||
import useCheckBackend from '@/pages/llmodels/hooks/use-check-backend';
|
||||
import { useGenerateWorkerOptions } from '@/pages/llmodels/hooks/use-form-initial-values';
|
||||
import useRecognizeAudio from '@/pages/llmodels/hooks/use-recognize-audio';
|
||||
import { DeleteModal, FilterBar, IconFont, NoResult } from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { ConfigProvider, Table, message } from 'antd';
|
||||
@@ -126,7 +123,7 @@ const ModelFiles = () => {
|
||||
record.resolved_paths?.[0]
|
||||
);
|
||||
|
||||
let name = _.toLower(
|
||||
const name = _.toLower(
|
||||
_.split(
|
||||
record.huggingface_repo_id ||
|
||||
record.ollama_library_model_name ||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import HighlightCode from '@/components/highlight-code';
|
||||
import { HighlightCode } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React, { useMemo } from 'react';
|
||||
import { addWorkerGuide } from '../config';
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import LabelSelector from '@/components/label-selector';
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { LabelSelector, ModalFooter, ScrollerModal } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -66,7 +63,7 @@ const UpdateLabels: React.FC<ViewModalProps> = (props) => {
|
||||
}}
|
||||
>
|
||||
<Form.Item<FormData> name="name">
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.name'
|
||||
})}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { queryClusterList } from '@/pages/cluster-management/apis';
|
||||
import {
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
} from '@/pages/llmodels/apis';
|
||||
import { InstanceStatusMap } from '@/pages/llmodels/config';
|
||||
import { ModelInstanceListItem } from '@/pages/llmodels/config/types';
|
||||
import { FilterBar } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { ConfigProvider, Empty, Table } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { GSDrawer } from '@gpustack/core-ui';
|
||||
import React from 'react';
|
||||
import { ListItem } from '../config/types';
|
||||
import WorkerDetailContent from './worker-detail-content';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import PageBox from '@/pages/_components/page-box';
|
||||
@@ -9,6 +7,7 @@ import useAddWorker from '@/pages/cluster-management/hooks/use-add-worker';
|
||||
import { useQueryClusterList } from '@/pages/cluster-management/services/use-query-cluster-list';
|
||||
import useNoResourceResult from '@/pages/llmodels/hooks/use-no-resource-result';
|
||||
import useGranfanaLink from '@/pages/resources/hooks/use-grafana-link';
|
||||
import { DeleteModal, FilterBar } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { ConfigProvider, Table, message } from 'antd';
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { modelSourceMap } from '@/pages/llmodels/config';
|
||||
import { modelFileActions } from '@/pages/llmodels/config/button-actions';
|
||||
@@ -11,6 +7,12 @@ import {
|
||||
CopyOutlined,
|
||||
InfoCircleOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
DropdownButtons,
|
||||
StatusTag,
|
||||
TooltipOverlayScroller
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tag, Typography } from 'antd';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import ProgressBar from '@/components/progress-bar';
|
||||
import InfoColumn from '@/components/simple-table/info-column';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { AutoTooltip, InfoColumn, ProgressBar } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
import _ from 'lodash';
|
||||
import { useMemo } from 'react';
|
||||
import { GPUDeviceItem } from '../config/types';
|
||||
|
||||
const fieldList = [
|
||||
{
|
||||
label: 'resources.table.total',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { systemConfigAtom } from '@/atoms/system';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import GrafanaIcon from '@/pages/_components/grafana-icon';
|
||||
import { GrafanaIcon } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
import { useAtomValue } from 'jotai';
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
||||
import SimpleTabel, { ColumnProps } from '@/components/simple-table';
|
||||
import InfoColumn from '@/components/simple-table/info-column';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import {
|
||||
InstanceStatusMap,
|
||||
InstanceStatusMapValue,
|
||||
@@ -16,13 +10,21 @@ import {
|
||||
} from '@/pages/llmodels/config/types';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
InfoColumn,
|
||||
SimpleTable,
|
||||
StatusTag,
|
||||
ThemeTag,
|
||||
TooltipOverlayScroller,
|
||||
type ColumnProps
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Tooltip } from 'antd';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
import _ from 'lodash';
|
||||
import { useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const GPUIndexWrapper = styled.span`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -133,11 +135,11 @@ const renderDistributedServer = (
|
||||
|
||||
return (
|
||||
<div>
|
||||
<SimpleTabel
|
||||
<SimpleTable
|
||||
rowKey="worker_name"
|
||||
columns={distributeCols}
|
||||
dataSource={[...mainWorker]}
|
||||
></SimpleTabel>
|
||||
></SimpleTable>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
import { systemConfigAtom } from '@/atoms/system';
|
||||
import { GPUStackVersionAtom } from '@/atoms/user';
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import LabelsCell from '@/components/label-cell';
|
||||
import ProgressBar from '@/components/progress-bar';
|
||||
import InfoColumn from '@/components/simple-table/info-column';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import GrafanaIcon from '@/pages/_components/grafana-icon';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import {
|
||||
DeleteOutlined,
|
||||
@@ -18,6 +10,16 @@ import {
|
||||
SafetyOutlined,
|
||||
ToolOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
DropdownButtons,
|
||||
GrafanaIcon,
|
||||
IconFont,
|
||||
InfoColumn,
|
||||
LabelCell,
|
||||
ProgressBar,
|
||||
StatusTag
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tooltip } from 'antd';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
@@ -29,7 +31,6 @@ import semverGt from 'semver/functions/gt';
|
||||
import { status, WorkerStatusMap, WorkerStatusMapValue } from '../config';
|
||||
import { Filesystem, GPUDeviceItem, ListItem } from '../config/types';
|
||||
import workerCss from '../styles/worker.less';
|
||||
|
||||
const ActionList = [
|
||||
{ label: 'common.button.edit', key: 'edit', icon: <EditOutlined /> },
|
||||
{
|
||||
@@ -400,7 +401,7 @@ const useWorkerColumns = ({
|
||||
title: intl.formatMessage({ id: 'resources.table.labels' }),
|
||||
dataIndex: 'labels',
|
||||
width: 200,
|
||||
render: (_, record) => <LabelsCell labels={record.labels} />
|
||||
render: (_, record) => <LabelCell labels={record.labels} />
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'clusters.title' }),
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealTextArea from '@/components/seal-form/seal-textarea';
|
||||
import {
|
||||
ModalFooter,
|
||||
ScrollerModal,
|
||||
Textarea as SealTextArea
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, message } from 'antd';
|
||||
import React from 'react';
|
||||
@@ -90,7 +91,7 @@ const useWorkerMaintenance = ({ fetchData }: { fetchData: () => void }) => {
|
||||
}}
|
||||
>
|
||||
<Form.Item name="name">
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.name'
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user