chore: replace components with core-ui, upgrade eslint
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { systemConfigAtom } from '@/atoms/system';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import ColumnWrapper from '@/pages/_components/column-wrapper';
|
||||
import { ColumnWrapper } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useAtom } from 'jotai';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { clusterDetailAtom } from '@/atoms/clusters';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import Deployments from '@/pages/llmodels/deployments';
|
||||
import GPUList from '@/pages/resources/components/gpus';
|
||||
import WorkerList from '@/pages/resources/components/workers';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate, useSearchParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { useAtomValue } from 'jotai';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { PageAction } from '@/config';
|
||||
import { GSDrawer } from '@gpustack/core-ui';
|
||||
import React from 'react';
|
||||
import ClusterCreate from './cluster-create';
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
import { clusterSessionAtom, expandKeysAtom } from '@/atoms/clusters';
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import SealTable from '@/components/seal-table';
|
||||
import TableContext from '@/components/seal-table/table-context';
|
||||
import { TableOrder } from '@/components/seal-table/types';
|
||||
import { PageAction } from '@/config';
|
||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||
import type { PageActionType } from '@/config/types';
|
||||
import useExpandedRowKeys from '@/hooks/use-expanded-row-keys';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import useWatchList from '@/hooks/use-watch-list';
|
||||
import {
|
||||
DeleteModal,
|
||||
FilterBar,
|
||||
IconFont,
|
||||
Table as SealTable,
|
||||
TableProvider
|
||||
} from '@gpustack/core-ui';
|
||||
import { TableOrder } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { message } from 'antd';
|
||||
@@ -354,7 +356,7 @@ const Clusters: React.FC = () => {
|
||||
></RightActions>
|
||||
}
|
||||
></FilterBar>
|
||||
<TableContext.Provider
|
||||
<TableProvider
|
||||
value={{
|
||||
allChildren: allWorkerPoolList,
|
||||
setDisableExpand: setDisableExpand
|
||||
@@ -405,7 +407,7 @@ const Clusters: React.FC = () => {
|
||||
onChange: handlePageChange
|
||||
}}
|
||||
></SealTable>
|
||||
</TableContext.Provider>
|
||||
</TableProvider>
|
||||
</PageBox>
|
||||
<AddCluster
|
||||
provider={openAddModal.provider}
|
||||
|
||||
@@ -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 { ProviderType } from '../config';
|
||||
import {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import FormDrawer from '@/pages/_components/form-drawer';
|
||||
import { Input as CInput, FormDrawer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
@@ -74,10 +73,10 @@ const AddModal: React.FC<AddModalProps> = ({
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({ id: 'common.table.name' })}
|
||||
required
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
{provider === ProviderValueMap.DigitalOcean && (
|
||||
<>
|
||||
@@ -90,7 +89,7 @@ const AddModal: React.FC<AddModalProps> = ({
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Password
|
||||
<CInput.Password
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.credential.token'
|
||||
})}
|
||||
@@ -109,14 +108,14 @@ const AddModal: React.FC<AddModalProps> = ({
|
||||
}}
|
||||
></span>
|
||||
}
|
||||
></SealInput.Password>
|
||||
></CInput.Password>
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
<Form.Item<FormData> name="description" rules={[{ required: false }]}>
|
||||
<SealInput.TextArea
|
||||
<CInput.TextArea
|
||||
label={intl.formatMessage({ id: 'common.table.description' })}
|
||||
></SealInput.TextArea>
|
||||
></CInput.TextArea>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</FormDrawer>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PageActionType } from '@/config/types';
|
||||
import FormDrawer from '@/pages/_components/form-drawer';
|
||||
import { FormDrawer } from '@gpustack/core-ui';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { ProviderType } from '../config';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import HighlightCode from '@/components/highlight-code';
|
||||
import { addWorkerGuide } from '@/pages/resources/config';
|
||||
import { HighlightCode } from '@gpustack/core-ui';
|
||||
import React from 'react';
|
||||
|
||||
type ViewModalProps = {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { createAxiosToken } from '@/hooks/use-chunk-request';
|
||||
import ColumnWrapper from '@/pages/_components/column-wrapper';
|
||||
import useAddWorkerMessage from '@/pages/cluster-management/hooks/use-add-worker-message';
|
||||
import { ColumnWrapper, GSDrawer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Alert } from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BaseSelect from '@/components/seal-form/base/select';
|
||||
import { BaseSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Spin, Typography } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
@@ -6,7 +6,6 @@ import { useAddWorkerContext } from './add-worker-context';
|
||||
import { AddWorkerStepProps, StepNamesMap } from './config';
|
||||
import { Title } from './constainers';
|
||||
import StepCollapse from './step-collapse';
|
||||
|
||||
const SelectCluster: React.FC<AddWorkerStepProps> = ({ disabled }) => {
|
||||
const {
|
||||
clusterList,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import AlertInfoBlock from '@/components/alert-info/block';
|
||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||
import { AlertBlockInfo as AlertInfoBlock } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Input, Switch, Typography } from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import CollapsibleContainer from '@/components/collapse-container';
|
||||
import { CollapseContainer } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
import React from 'react';
|
||||
@@ -72,7 +72,7 @@ const StepCollapse: React.FC<StepItemProps> = ({
|
||||
collapseKey?.has(name) ? 'step-collapse-open' : 'step-collapse'
|
||||
}
|
||||
>
|
||||
<CollapsibleContainer
|
||||
<CollapseContainer
|
||||
collapsible={true}
|
||||
open={collapseKey?.has(name)}
|
||||
iconPlacement="right"
|
||||
@@ -114,7 +114,7 @@ const StepCollapse: React.FC<StepItemProps> = ({
|
||||
</Button>
|
||||
)}
|
||||
</ButtonWrapper>
|
||||
</CollapsibleContainer>
|
||||
</CollapseContainer>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import AlertInfoBlock from '@/components/alert-info/block';
|
||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||
import { AlertBlockInfo } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useAddWorkerContext } from './add-worker-context';
|
||||
import { NotesWrapper } from './constainers';
|
||||
@@ -15,7 +15,7 @@ const VendorNotes = () => {
|
||||
} as { label: string; notes: string[] });
|
||||
|
||||
return (
|
||||
<AlertInfoBlock
|
||||
<AlertBlockInfo
|
||||
maxHeight={200}
|
||||
title={intl.formatMessage(
|
||||
{ id: 'clusters.addworker.vendorNotes.title' },
|
||||
@@ -41,7 +41,7 @@ const VendorNotes = () => {
|
||||
</NotesWrapper>
|
||||
) : null
|
||||
}
|
||||
></AlertInfoBlock>
|
||||
></AlertBlockInfo>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import HighlightCode from '@/components/highlight-code';
|
||||
import { addWorkerGuide } from '@/pages/resources/config';
|
||||
import { HighlightCode } from '@gpustack/core-ui';
|
||||
import React from 'react';
|
||||
import { ProviderType } from '../config';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import DropDownActions from '@/components/drop-down-actions';
|
||||
import ListMap from '@/components/dynamic-form/components/list-map';
|
||||
import { FieldSchema } from '@/components/dynamic-form/config/types';
|
||||
import { DropdownActions } from '@gpustack/core-ui';
|
||||
import ListMap from '@gpustack/core-ui/lib/components/dynamic-form/components/list-map';
|
||||
import { FieldSchema } from '@gpustack/core-ui/lib/components/dynamic-form/config/types';
|
||||
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
@@ -87,14 +88,14 @@ const CloudOptions: React.FC<{
|
||||
return (
|
||||
<>
|
||||
<Title>
|
||||
<DropDownActions menu={menu}>
|
||||
<DropdownActions menu={menu}>
|
||||
<Button variant="filled" color="default">
|
||||
<PlusOutlined />
|
||||
<span>
|
||||
{intl.formatMessage({ id: 'clusters.workerpool.cloudOptions' })}
|
||||
</span>
|
||||
</Button>
|
||||
</DropDownActions>
|
||||
</DropdownActions>
|
||||
</Title>
|
||||
{fieldList.length > 0 &&
|
||||
fieldList.map((field) => (
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { fromClusterCreationAtom } from '@/atoms/clusters';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { Input as CInput, Select as SealSelect } from '@gpustack/core-ui';
|
||||
import { Link, useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import { useAtom } from 'jotai';
|
||||
@@ -193,14 +192,14 @@ const CloudProvider: React.FC<CloudProviderProps> = (props) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
description={intl.formatMessage({
|
||||
id: 'clusters.form.serverUrl.tips'
|
||||
})}
|
||||
label={intl.formatMessage({ id: 'clusters.create.serverUrl' })}
|
||||
required={true}
|
||||
trim={true}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import GSDrawer from '@/components/scroller-modal/gs-drawer';
|
||||
import { GSDrawer } from '@gpustack/core-ui';
|
||||
import React from 'react';
|
||||
import { ClusterListItem } from '../config/types';
|
||||
import ClusterDetailContent from './cluster-metrics';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealTextArea from '@/components/seal-form/seal-textarea';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import CollapsePanel from '@/pages/_components/collapse-panel';
|
||||
import { json2Yaml, yaml2Json } from '@/pages/backends/config';
|
||||
import {
|
||||
Input as CInput,
|
||||
CollapsePanel,
|
||||
Textarea as SealTextArea
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
|
||||
@@ -164,11 +166,11 @@ const ClusterForm: React.FC<AddModalProps> = forwardRef(
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({ id: 'common.table.name' })}
|
||||
required
|
||||
trim={false}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
{provider === ProviderValueMap.DigitalOcean && (
|
||||
<CloudProvider
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import GaugeChart from '@/components/echarts/gauge';
|
||||
import Card from '@/components/templates/card';
|
||||
import { GaugeChart, TemplateCard } from '@gpustack/core-ui';
|
||||
import { useSearchParams } from '@umijs/max';
|
||||
import { Col, Row } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -196,46 +195,46 @@ const ClusterMetrics = () => {
|
||||
<SubTitle>System Load</SubTitle>
|
||||
<Row style={{ marginBottom: 16 }} gutter={16}>
|
||||
<Col span={12}>
|
||||
<Card height={CardHeight} clickable={false} ghost>
|
||||
<TemplateCard height={CardHeight} clickable={false} ghost>
|
||||
<TrendChart
|
||||
data={detailContent?.history}
|
||||
metrics={['vram']}
|
||||
metricsMap={metricsMap}
|
||||
title="VRAM"
|
||||
></TrendChart>
|
||||
</Card>
|
||||
</TemplateCard>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Card height={CardHeight} clickable={false} ghost>
|
||||
<TemplateCard height={CardHeight} clickable={false} ghost>
|
||||
<TrendChart
|
||||
data={detailContent?.history}
|
||||
metrics={['ram']}
|
||||
metricsMap={metricsMap}
|
||||
title="RAM"
|
||||
></TrendChart>
|
||||
</Card>
|
||||
</TemplateCard>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Card height={CardHeight} clickable={false} ghost>
|
||||
<TemplateCard height={CardHeight} clickable={false} ghost>
|
||||
<TrendChart
|
||||
data={detailContent?.history}
|
||||
metrics={['cpu']}
|
||||
metricsMap={metricsMap}
|
||||
title="CPU"
|
||||
></TrendChart>
|
||||
</Card>
|
||||
</TemplateCard>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Card height={CardHeight} clickable={false} ghost>
|
||||
<TemplateCard height={CardHeight} clickable={false} ghost>
|
||||
<TrendChart
|
||||
data={detailContent?.history}
|
||||
metrics={['gpu']}
|
||||
metricsMap={metricsMap}
|
||||
title="GPU"
|
||||
></TrendChart>
|
||||
</Card>
|
||||
</TemplateCard>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import CardWrapper from '@/components/card-wrapper';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { StarFilled } from '@ant-design/icons';
|
||||
import { CardWrapper, IconFont, StatusTag } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import type { DescriptionsProps } from 'antd';
|
||||
import { Descriptions, Tooltip } from 'antd';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import CardWrapper from '@/components/card-wrapper';
|
||||
import { CardWrapper } from '@gpustack/core-ui';
|
||||
import { Col, Progress, Row, Tag } from 'antd';
|
||||
import { round } from 'lodash';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { Select as SealSelect } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import CollapsibleContainer from '@/components/collapse-container';
|
||||
import SealCheckbox from '@/components/seal-form/seal-checkbox';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import SealSwitch from '@/components/seal-form/seal-switch';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
Input as CInput,
|
||||
CollapseContainer,
|
||||
Checkbox as SealCheckbox,
|
||||
Select as SealSelect,
|
||||
Switch as SealSwitch
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Flex, Form } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
@@ -157,11 +159,11 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
borderRadius: 'var(--ant-border-radius-lg)'
|
||||
}}
|
||||
>
|
||||
<CollapsibleContainer
|
||||
<CollapseContainer
|
||||
collapsible={true}
|
||||
showExpandIcon={true}
|
||||
open={collapseKey.has(name)}
|
||||
onToggle={(open) => onToggle(open, name)}
|
||||
onToggle={(open: boolean) => onToggle(open, name)}
|
||||
styles={{
|
||||
body: collapseKey.has(name) ? { padding: 16 } : {},
|
||||
content: { paddingTop: 0 },
|
||||
@@ -203,13 +205,12 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
disabled={name === 0}
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.volume.name'
|
||||
})}
|
||||
required
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Flex style={{ gap: 16, width: '100%' }}>
|
||||
{/* Mount Path */}
|
||||
@@ -232,7 +233,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required
|
||||
disabled={name === 0}
|
||||
placeholder={intl.formatMessage({
|
||||
@@ -241,7 +242,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.volume.mountPath'
|
||||
})}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
</div>
|
||||
|
||||
@@ -307,7 +308,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
required
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'clusters.volume.mountPath.format'
|
||||
@@ -315,7 +316,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.volume.sourceType.hostPath'
|
||||
})}
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
</div>
|
||||
|
||||
@@ -364,7 +365,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.volume.pvc.claimName'
|
||||
})}
|
||||
@@ -390,7 +391,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.volume.configMap.name'
|
||||
})}
|
||||
@@ -412,7 +413,7 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => {
|
||||
</Form.Item>
|
||||
</Flex>
|
||||
)}
|
||||
</CollapsibleContainer>
|
||||
</CollapseContainer>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -2,20 +2,21 @@ import {
|
||||
regionInstanceTypeListAtom,
|
||||
regionOSImageListAtom
|
||||
} from '@/atoms/clusters';
|
||||
import CollapsibleContainer, {
|
||||
CollapsibleContainerProps
|
||||
} from '@/components/collapse-container';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import LabelSelector from '@/components/label-selector';
|
||||
import AutoComplete from '@/components/seal-form/auto-complete';
|
||||
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 { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { CardContainer } from '@/pages/llmodels/components/gpu-card';
|
||||
import { DeleteOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AutoComplete,
|
||||
Input as CInput,
|
||||
InputNumber as CInputNumber,
|
||||
CollapseContainer,
|
||||
IconFont,
|
||||
LabelSelector,
|
||||
Select as SealSelect
|
||||
} from '@gpustack/core-ui';
|
||||
import { type CollapseContainerProps } from '@gpustack/core-ui/lib/components/collapse-container';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { Button, Form } from 'antd';
|
||||
@@ -143,7 +144,7 @@ type AddModalProps = {
|
||||
onFinish: (values: FormData) => void;
|
||||
onDelete?: () => void;
|
||||
showDelete?: boolean;
|
||||
collapseProps?: CollapsibleContainerProps;
|
||||
collapseProps?: CollapseContainerProps;
|
||||
};
|
||||
|
||||
const InstanceSpecData: React.FC<{ instanceSpec: Record<string, any> }> = ({
|
||||
@@ -155,7 +156,7 @@ const InstanceSpecData: React.FC<{ instanceSpec: Record<string, any> }> = ({
|
||||
.filter(([key, value]) => value)
|
||||
.map(([key, value]) => (
|
||||
<Form.Item key={key} name={['instance_spec', key]} hidden>
|
||||
<SealInput.Input />
|
||||
<CInput.Input />
|
||||
</Form.Item>
|
||||
))}
|
||||
</>
|
||||
@@ -305,7 +306,7 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
|
||||
}));
|
||||
|
||||
return (
|
||||
<CollapsibleContainer
|
||||
<CollapseContainer
|
||||
{...restCollapseProps}
|
||||
title={title}
|
||||
collapsible={collapsible}
|
||||
@@ -350,12 +351,12 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input
|
||||
<CInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.name'
|
||||
})}
|
||||
required
|
||||
></SealInput.Input>
|
||||
></CInput.Input>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="instance_type"
|
||||
@@ -394,12 +395,12 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
label={intl.formatMessage({
|
||||
id: 'clusters.workerpool.replicas'
|
||||
})}
|
||||
required
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="batch_size"
|
||||
@@ -413,7 +414,7 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
<CInputNumber
|
||||
description={intl.formatMessage({
|
||||
id: 'clusters.workerpool.batchSize.desc'
|
||||
})}
|
||||
@@ -421,7 +422,7 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
|
||||
id: 'clusters.workerpool.batchSize'
|
||||
})}
|
||||
required
|
||||
></SealInputNumber>
|
||||
></CInputNumber>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<FormData>
|
||||
@@ -486,12 +487,12 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
|
||||
</Form.Item>
|
||||
<VolumesConfig disabled={action === PageAction.EDIT}></VolumesConfig>
|
||||
<Form.Item<FormData> name="os_image" hidden>
|
||||
<SealInput.Input></SealInput.Input>
|
||||
<CInput.Input></CInput.Input>
|
||||
</Form.Item>
|
||||
<InstanceSpecData instanceSpec={instanceSpec} />
|
||||
</Container>
|
||||
</Form>
|
||||
</CollapsibleContainer>
|
||||
</CollapseContainer>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import CellContent from '@/components/seal-table/components/cell-content';
|
||||
import RowChildren from '@/components/seal-table/components/row-children';
|
||||
import RowContext from '@/components/seal-table/row-context';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import {
|
||||
CellContent,
|
||||
DeleteModal,
|
||||
RowChildren,
|
||||
TableRowProvider
|
||||
} from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { Col, message, Row } from 'antd';
|
||||
@@ -120,7 +122,7 @@ const PoolRows: React.FC<PoolRowsProps> = ({
|
||||
key={data.id}
|
||||
style={{ borderRadius: 'var(--ant-table-header-border-radius)' }}
|
||||
>
|
||||
<RowContext.Provider value={{ row: data, onCell: handleOnCell }}>
|
||||
<TableRowProvider value={{ row: data, onCell: handleOnCell }}>
|
||||
<RowChildren>
|
||||
<Row style={{ width: '100%' }} align="middle">
|
||||
{columns.map((col: Record<string, any>) => {
|
||||
@@ -139,7 +141,7 @@ const PoolRows: React.FC<PoolRowsProps> = ({
|
||||
})}
|
||||
</Row>
|
||||
</RowChildren>
|
||||
</RowContext.Provider>
|
||||
</TableRowProvider>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import Card from '@/components/templates/card';
|
||||
import { IconFont, TemplateCard } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tooltip } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
@@ -147,7 +146,7 @@ const ProviderCatalog: React.FC<ProviderCatalogProps> = ({
|
||||
key={action.key}
|
||||
>
|
||||
<CardBox>
|
||||
<Card
|
||||
<TemplateCard
|
||||
height={height}
|
||||
onClick={() => onSelect?.(action.key as string, action)}
|
||||
active={current === action.key}
|
||||
@@ -155,7 +154,7 @@ const ProviderCatalog: React.FC<ProviderCatalogProps> = ({
|
||||
clickable={clickable}
|
||||
header={renderTitle(action)}
|
||||
icon={action.icon}
|
||||
></Card>
|
||||
></TemplateCard>
|
||||
</CardBox>
|
||||
</Tooltip>
|
||||
))}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import HighlightCode from '@/components/highlight-code';
|
||||
import { HighlightCode } from '@gpustack/core-ui';
|
||||
import React, { useMemo } from 'react';
|
||||
import { generateK8sRegisterCommand } from '../config';
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import mooreLogo from '@/assets/logo/moore-logo.png';
|
||||
import nvidiaLogo from '@/assets/logo/nvidia.png';
|
||||
import theadLogoEN from '@/assets/logo/t-head-en.png';
|
||||
import theadLogoZH from '@/assets/logo/t-head-zh.png';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import useUserSettings from '@/hooks/use-user-settings';
|
||||
import {
|
||||
AddWorkerDockerNotes,
|
||||
GPUDriverMap
|
||||
} from '@/pages/resources/config/gpu-driver';
|
||||
import { IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import styled from 'styled-components';
|
||||
import ProviderCatalog from './provider-catalog';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import LineChart from '@/components/echarts/line-chart';
|
||||
import { LineChart } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ListMap from '@/components/dynamic-form/components/list-map';
|
||||
import { statusType } from '@/components/dynamic-form/config/types';
|
||||
import useValidateFields from '@/components/dynamic-form/hooks/use-validate-fields';
|
||||
import ListMap from '@gpustack/core-ui/lib/components/dynamic-form/components/list-map';
|
||||
import { statusType } from '@gpustack/core-ui/lib/components/dynamic-form/config/types';
|
||||
import useValidateFields from '@gpustack/core-ui/lib/components/dynamic-form/hooks/use-validate-fields';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React, { forwardRef, useState } from 'react';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import DeleteModal from '@/components/delete-modal';
|
||||
import { FilterBar } from '@/components/page-tools';
|
||||
import { PageAction } from '@/config';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { DeleteModal, FilterBar } from '@gpustack/core-ui';
|
||||
import { useIntl, useSearchParams } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { message, Table } from 'antd';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FieldSchema } from '@/components/dynamic-form/config/types';
|
||||
import { FieldSchema } from '@gpustack/core-ui/lib/components/dynamic-form/config/types';
|
||||
|
||||
export const fields = {
|
||||
volumes: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import { StatusMaps } from '@/config';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import { StatusType } from '@/config/types';
|
||||
import { GPUsConfigs } from '@/pages/resources/config/gpu-driver';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
|
||||
export const ClusterStatusValueMap = {
|
||||
Provisioning: 'provisioning',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
import React from 'react';
|
||||
import { ProviderValueMap } from '.';
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { clusterSessionAtom, fromClusterCreationAtom } from '@/atoms/clusters';
|
||||
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 type { PageActionType } from '@/config/types';
|
||||
import useTableFetch from '@/hooks/use-table-fetch';
|
||||
import { DeleteModal, FilterBar, IconFont } from '@gpustack/core-ui';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { ConfigProvider, Table, message } from 'antd';
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
// 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 StatusTag from '@/components/status-tag';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import GrafanaIcon from '@/pages/_components/grafana-icon';
|
||||
import { StarFilled } from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
DropdownButtons,
|
||||
GrafanaIcon,
|
||||
StatusTag
|
||||
} from '@gpustack/core-ui';
|
||||
import icons from '@gpustack/core-ui/lib/components/icon-font/icons';
|
||||
import { ColumnProps as SealColumnProps } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tooltip } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
@@ -20,7 +22,6 @@ import {
|
||||
ProviderValueMap
|
||||
} from '../config';
|
||||
import { ClusterListItem } from '../config/types';
|
||||
|
||||
const clusterActionList = [
|
||||
{
|
||||
key: 'edit',
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
// columns.ts
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { tableSorter } from '@/config/settings';
|
||||
import { AutoTooltip, DropdownButtons } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { ColumnsType } from 'antd/es/table';
|
||||
import dayjs from 'dayjs';
|
||||
import { useMemo } from 'react';
|
||||
import { ProviderLabelMap, credentialActionList } from '../config';
|
||||
import { CredentialListItem as ListItem } from '../config/types';
|
||||
|
||||
const useCredentialColumns = (
|
||||
sortOrder: string[],
|
||||
handleSelect: (val: string, record: ListItem) => void
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { SealColumnProps } from '@/components/seal-table/types';
|
||||
import { DeleteOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import { AutoTooltip, DropdownButtons } from '@gpustack/core-ui';
|
||||
import { ColumnProps } from '@gpustack/core-ui/lib/components/table/types';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import { useMemo } from 'react';
|
||||
import { RenderOption } from '../components/pool-form';
|
||||
import { NodePoolListItem as ListItem } from '../config/types';
|
||||
|
||||
const actionItems = [
|
||||
{
|
||||
key: 'edit',
|
||||
@@ -29,7 +27,7 @@ const actionItems = [
|
||||
const usePoolsColumns = (
|
||||
handleSelect: (val: string, record: ListItem) => void,
|
||||
sortOrder?: string[]
|
||||
): SealColumnProps[] => {
|
||||
): ColumnProps[] => {
|
||||
const intl = useIntl();
|
||||
|
||||
return useMemo(() => {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import YamlEditor from '@/pages/_components/yaml-editor';
|
||||
import { Input as CInput, IconFont, YamlEditor } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form } from 'antd';
|
||||
import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
|
||||
@@ -71,7 +69,7 @@ const ClusterAdvanceConfig: React.FC<{
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.TextArea required={false} trim={false}></SealInput.TextArea>
|
||||
<CInput.TextArea required={false} trim={false}></CInput.TextArea>
|
||||
</Form.Item>
|
||||
{provider === ProviderValueMap.Kubernetes && (
|
||||
<K8SVolumeMount action={action}></K8SVolumeMount>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import PageTools from '@/components/page-tools';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { PageTools } from '@gpustack/core-ui';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, FormInstance } from 'antd';
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user