chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PageActionType } from '@/config/types';
|
||||
import FormDrawer from '@/pages/_components/form-drawer';
|
||||
import { FormDrawer } from '@gpustack/core-ui';
|
||||
import React, { useRef } from 'react';
|
||||
import { FormData, BenchmarkListItem as ListItem } from '../config/types';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl, useSearchParams } from '@umijs/max';
|
||||
import { Tabs, TabsProps } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import FormDrawer from '@/pages/_components/form-drawer';
|
||||
import { FormDrawer } from '@gpustack/core-ui';
|
||||
import { BenchmarkListItem } from '../config/types';
|
||||
import DetailContent from './detail-content';
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import RowChildren from '@/components/seal-table/components/row-children';
|
||||
import SealTable from '@/components/seal-table/index';
|
||||
import TableContext from '@/components/seal-table/table-context';
|
||||
import useExpandedRowKeys from '@/hooks/use-expanded-row-keys';
|
||||
import {
|
||||
RowChildren,
|
||||
Table as SealTable,
|
||||
TableProvider
|
||||
} from '@gpustack/core-ui';
|
||||
import useMemoizedFn from 'ahooks/lib/useMemoizedFn';
|
||||
import { Col, Row } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -175,7 +177,7 @@ const Environment: React.FC = () => {
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<TableContext.Provider
|
||||
<TableProvider
|
||||
value={{
|
||||
allChildren: allChildren
|
||||
}}
|
||||
@@ -195,7 +197,7 @@ const Environment: React.FC = () => {
|
||||
columns={workerColumns}
|
||||
expandable={true}
|
||||
></SealTable>
|
||||
</TableContext.Provider>
|
||||
</TableProvider>
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { AutoTooltip } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
|
||||
export default function useGPUColumns(): {
|
||||
title: string;
|
||||
dataIndex: string;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { AutoTooltip } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tag } from 'antd';
|
||||
|
||||
export default function useWorkerColumns(): {
|
||||
title: string;
|
||||
dataIndex: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FiltersButton } from '@/components/page-tools';
|
||||
import { modelCategoriesMap } from '@/pages/llmodels/config';
|
||||
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 _ from 'lodash';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import LogsViewer from '@/components/logs-viewer/virtual-log-list';
|
||||
import { LogsViewer } from '@gpustack/core-ui';
|
||||
import React, { useRef } from 'react';
|
||||
import { BENCHMARKS_API } from '../../apis';
|
||||
import { useDetailContext } from '../../config/detail-context';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { DropdownButtons, IconFont } from '@gpustack/core-ui';
|
||||
import { Button, Space } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import useDownloadLogs from '@/hooks/use-download-logs';
|
||||
import { DownloadOutlined } from '@ant-design/icons';
|
||||
import { DropdownButtons, IconFont } from '@gpustack/core-ui';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
import { BENCHMARKS_API } from '../apis';
|
||||
import { BenchmarkStatusValueMap } from '../config';
|
||||
import { BenchmarkListItem as ListItem } from '../config/types';
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { AutoTooltip } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Descriptions, Flex, Tag } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
import { useDetailContext } from '../../config/detail-context';
|
||||
|
||||
const Instance: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const { detailData } = useDetailContext();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import HeadlessCollapse from '@/components/collapse-container/headless-collapse';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { HeadlessCollapse, IconFont } from '@gpustack/core-ui';
|
||||
import { useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import LogsViewer from '@/components/logs-viewer/virtual-log-list';
|
||||
import { LogsViewer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Modal } from 'antd';
|
||||
import React, { useCallback, useEffect } from 'react';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import { BaseSelect, DeleteModal } from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate, useSearchParams } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
@@ -18,7 +17,6 @@ import useQueryBenchmarkList from './services/use-query-benchmarks';
|
||||
import useQueryDetail from './services/use-query-detail';
|
||||
import useQueryProfiles from './services/use-query-profiles';
|
||||
import useStopBenchmark from './services/use-stop-benchmark';
|
||||
|
||||
const Details: React.FC = () => {
|
||||
const modalRef = useRef<any>(null);
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import FilterForm from '@/pages/_components/filter-form';
|
||||
import { modelCategoriesMap } from '@/pages/llmodels/config';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { BaseSelect, FilterForm } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, Input } from 'antd';
|
||||
import { forwardRef, useImperativeHandle, useRef } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { profileOptions } from '../config';
|
||||
|
||||
const Content = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { modelNameReg, PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { ClusterStatusValueMap } from '@/pages/cluster-management/config';
|
||||
import { useBenchmarkTargetInstance } from '@/pages/llmodels/hooks/use-run-benchmark';
|
||||
import { Input as CInput, Select as SealSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
@@ -60,10 +59,10 @@ const BasicForm: React.FC = () => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({ id: 'common.table.name' })}
|
||||
required
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="cluster_id"
|
||||
@@ -82,22 +81,22 @@ const BasicForm: React.FC = () => {
|
||||
></SealSelect>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="model_name" hidden={true}>
|
||||
<SealInput.Input></SealInput.Input>
|
||||
<CInput.Input></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="model_id" hidden={true}>
|
||||
<SealInput.Input></SealInput.Input>
|
||||
<CInput.Input></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="model_instance_name" hidden={true}>
|
||||
<SealInput.Input></SealInput.Input>
|
||||
<CInput.Input></CInput.Input>
|
||||
</Form.Item>
|
||||
<ModelInstanceForm></ModelInstanceForm>
|
||||
<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,7 +1,6 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { AutoTooltip, Select as SealSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, Select } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -10,7 +9,6 @@ import { ProfileValueMap } from '../config';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
import RandomSettingsForm from './random-settings';
|
||||
|
||||
const DatasetForm: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const form = Form.useFormInstance();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import LabelSelector from '@/components/label-selector';
|
||||
import { LabelSelector } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import SealCascader from '@/components/seal-form/seal-cascader';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import {
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
import { useBenchmarkTargetInstance } from '@/pages/llmodels/hooks/use-run-benchmark';
|
||||
import { useQueryModelInstancesList } from '@/pages/llmodels/services/use-query-model-instances';
|
||||
import { useQueryModelList } from '@/pages/llmodels/services/use-query-model-list';
|
||||
import { Cascader as SealCascader } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, Tooltip } from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import SealInputNumber from '@/components/seal-form/input-number';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import {
|
||||
InputNumber as CInputNumber,
|
||||
Select as SealSelect
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
@@ -62,14 +64,14 @@ const RandomSettingsForm: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
disabled={disabled}
|
||||
label={intl.formatMessage({
|
||||
id: 'benchmark.table.inputTokenLength'
|
||||
})}
|
||||
required
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="dataset_output_tokens"
|
||||
@@ -83,24 +85,24 @@ const RandomSettingsForm: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
disabled={disabled}
|
||||
label={intl.formatMessage({
|
||||
id: 'benchmark.table.outputTokenLength'
|
||||
})}
|
||||
required
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="dataset_seed"
|
||||
getValueProps={(value) => ({ value: value || null })}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
disabled={disabled}
|
||||
label={intl.formatMessage({ id: 'playground.image.params.seed' })}
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
@@ -114,11 +116,11 @@ const RandomSettingsForm: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
disabled={disabled}
|
||||
label={intl.formatMessage({ id: 'benchmark.table.requestRate' })}
|
||||
required
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="total_requests"
|
||||
@@ -129,12 +131,12 @@ const RandomSettingsForm: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
min={0}
|
||||
disabled={disabled}
|
||||
label={intl.formatMessage({ id: 'benchmark.form.totalRequests' })}
|
||||
required
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
// columns.ts
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { AutoTooltip } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Typography } from 'antd';
|
||||
import { ColumnsType } from 'antd/es/table';
|
||||
import { useMemo } from 'react';
|
||||
import RowActions from '../components/row-actions';
|
||||
import { BenchmarkListItem as ListItem } from '../config/types';
|
||||
|
||||
const useBenchmarkColumns = (params: {
|
||||
sortOrder: string[];
|
||||
columns: ColumnsType<ListItem>;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import InfoColumn from '@/components/simple-table/info-column';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import ColumnSettings from '@/pages/_components/column-settings';
|
||||
import {
|
||||
AutoTooltip,
|
||||
ColumnSettings,
|
||||
InfoColumn,
|
||||
StatusTag
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Typography } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
@@ -14,7 +16,6 @@ import {
|
||||
BenchmarkStatusValueMap
|
||||
} from '../config';
|
||||
import { BenchmarkListItem as ListItem } from '../config/types';
|
||||
|
||||
// sort by this order
|
||||
const allFields = [
|
||||
'cluster_id',
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
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 useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { useBenchmarkTargetInstance } from '@/pages/llmodels/hooks/use-run-benchmark';
|
||||
import { useQueryModelList } from '@/pages/llmodels/services/use-query-model-list';
|
||||
import { DeleteModal, FilterBar, IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn, useToggle } from 'ahooks';
|
||||
import { ConfigProvider, Table, message } from 'antd';
|
||||
|
||||
Reference in New Issue
Block a user