chore: upgrade antd lib to 5.25.4
This commit is contained in:
Generated
+4442
-8826
File diff suppressed because it is too large
Load Diff
@@ -106,7 +106,7 @@ const AutoTooltip: React.FC<AutoTooltipProps> = ({
|
|||||||
<TooltipOverlayScroller
|
<TooltipOverlayScroller
|
||||||
toolTipProps={{
|
toolTipProps={{
|
||||||
...tooltipProps,
|
...tooltipProps,
|
||||||
destroyTooltipOnHide: false
|
destroyOnHidden: false
|
||||||
}}
|
}}
|
||||||
title={isOverflowing || showTitle ? title || children : false}
|
title={isOverflowing || showTitle ? title || children : false}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ const DeleteModal = forwardRef((props, ref) => {
|
|||||||
open={visible}
|
open={visible}
|
||||||
onOk={handleOk}
|
onOk={handleOk}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
destroyOnClose={false}
|
destroyOnHidden={false}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -48,12 +48,14 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
|
|||||||
<Tooltip
|
<Tooltip
|
||||||
placement="bottomLeft"
|
placement="bottomLeft"
|
||||||
arrow={false}
|
arrow={false}
|
||||||
overlayInnerStyle={{
|
styles={{
|
||||||
background: 'var(--color-white-1)',
|
body: {
|
||||||
display: 'flex',
|
background: 'var(--color-white-1)',
|
||||||
alignItems: 'center',
|
display: 'flex',
|
||||||
justifyContent: 'flex-start',
|
alignItems: 'center',
|
||||||
width: 160
|
justifyContent: 'flex-start',
|
||||||
|
width: 160
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
title={
|
title={
|
||||||
<div className="flex-column" style={{ width: '100%' }}>
|
<div className="flex-column" style={{ width: '100%' }}>
|
||||||
|
|||||||
@@ -75,12 +75,15 @@ export const TooltipOverlayScroller: React.FC<
|
|||||||
scrollbars,
|
scrollbars,
|
||||||
oppositeTheme
|
oppositeTheme
|
||||||
}) => {
|
}) => {
|
||||||
const { overlayInnerStyle, ...rest } = toolTipProps || {};
|
const { styles, ...rest } = toolTipProps || {};
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
overlayInnerStyle={{
|
styles={{
|
||||||
paddingInline: 0,
|
...styles,
|
||||||
...overlayInnerStyle
|
body: {
|
||||||
|
paddingInline: 0,
|
||||||
|
...styles?.body
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
title={
|
title={
|
||||||
title && (
|
title && (
|
||||||
|
|||||||
@@ -65,7 +65,11 @@ const RenderProgress = memo(
|
|||||||
title={label}
|
title={label}
|
||||||
open={open}
|
open={open}
|
||||||
onOpenChange={setOpen}
|
onOpenChange={setOpen}
|
||||||
overlayInnerStyle={{ paddingInline: 12 }}
|
styles={{
|
||||||
|
body: {
|
||||||
|
paddingInline: 12
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{renderProgress}
|
{renderProgress}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const ScrollerModal = (props: ModalProps & { maxContentHeight?: number }) => {
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
{...props}
|
{...props}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
styles={{
|
styles={{
|
||||||
content: {
|
content: {
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
import useSetChunkRequest, {
|
import { createAxiosToken } from '@/hooks/use-chunk-request';
|
||||||
createAxiosToken
|
import { useMemoizedFn } from 'ahooks';
|
||||||
} from '@/hooks/use-chunk-request';
|
|
||||||
import useUpdateChunkedList from '@/hooks/use-update-chunk-list';
|
|
||||||
import { Col, Row, Spin } from 'antd';
|
import { Col, Row, Spin } from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React, {
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
useMemo,
|
|
||||||
useRef,
|
|
||||||
useState
|
|
||||||
} from 'react';
|
|
||||||
import RowContext from '../row-context';
|
import RowContext from '../row-context';
|
||||||
import TableContext from '../table-context';
|
import TableContext from '../table-context';
|
||||||
import { RowContextProps, SealTableProps } from '../types';
|
import { RowContextProps, SealTableProps } from '../types';
|
||||||
@@ -43,10 +35,8 @@ const TableRow: React.FC<
|
|||||||
allChildren?: any[];
|
allChildren?: any[];
|
||||||
setDisableExpand?: (record: any) => boolean;
|
setDisableExpand?: (record: any) => boolean;
|
||||||
}>(TableContext);
|
}>(TableContext);
|
||||||
const { setChunkRequest } = useSetChunkRequest();
|
|
||||||
const [childrenData, setChildrenData] = useState<any[]>([]);
|
const [childrenData, setChildrenData] = useState<any[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [firstLoad, setFirstLoad] = useState(true);
|
|
||||||
const pollTimer = useRef<any>(null);
|
const pollTimer = useRef<any>(null);
|
||||||
const chunkRequestRef = useRef<any>(null);
|
const chunkRequestRef = useRef<any>(null);
|
||||||
const childrenDataRef = useRef<any[]>([]);
|
const childrenDataRef = useRef<any[]>([]);
|
||||||
@@ -55,12 +45,6 @@ const TableRow: React.FC<
|
|||||||
const [updateChild, setUpdateChild] = useState(true);
|
const [updateChild, setUpdateChild] = useState(true);
|
||||||
const [currentExpand, setCurrentExpand] = useState(false);
|
const [currentExpand, setCurrentExpand] = useState(false);
|
||||||
|
|
||||||
const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({
|
|
||||||
dataList: childrenData,
|
|
||||||
limit: 100,
|
|
||||||
setDataList: setChildrenData
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
if (pollTimer.current) {
|
if (pollTimer.current) {
|
||||||
@@ -87,16 +71,6 @@ const TableRow: React.FC<
|
|||||||
|
|
||||||
const renderChildrenData = () => {
|
const renderChildrenData = () => {
|
||||||
if (childrenData.length === 0) {
|
if (childrenData.length === 0) {
|
||||||
// return (
|
|
||||||
// <Empty
|
|
||||||
// image={loading ? null : Empty.PRESENTED_IMAGE_SIMPLE}
|
|
||||||
// description={loading ? null : undefined}
|
|
||||||
// style={{
|
|
||||||
// marginBlock: 0,
|
|
||||||
// height: 54
|
|
||||||
// }}
|
|
||||||
// ></Empty>
|
|
||||||
// );
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return renderChildren?.(childrenData, {
|
return renderChildren?.(childrenData, {
|
||||||
@@ -116,7 +90,7 @@ const TableRow: React.FC<
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLoadChildren = useCallback(async () => {
|
const handleLoadChildren = useMemoizedFn(async () => {
|
||||||
try {
|
try {
|
||||||
axiosToken.current?.cancel?.();
|
axiosToken.current?.cancel?.();
|
||||||
axiosToken.current = createAxiosToken();
|
axiosToken.current = createAxiosToken();
|
||||||
@@ -130,10 +104,8 @@ const TableRow: React.FC<
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
setChildrenData([]);
|
setChildrenData([]);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} finally {
|
|
||||||
setFirstLoad(false);
|
|
||||||
}
|
}
|
||||||
}, [record, loadChildren]);
|
});
|
||||||
|
|
||||||
const filterUpdateChildrenHandler = () => {
|
const filterUpdateChildrenHandler = () => {
|
||||||
const dataList = _.filter(tableContext.allChildren, (data: any) => {
|
const dataList = _.filter(tableContext.allChildren, (data: any) => {
|
||||||
@@ -142,32 +114,6 @@ const TableRow: React.FC<
|
|||||||
setChildrenData(dataList);
|
setChildrenData(dataList);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateChildrenHandler = (list: any) => {
|
|
||||||
_.each(list, (data: any) => {
|
|
||||||
updateChunkedList(data);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const createChunkRequest = () => {
|
|
||||||
chunkRequestRef.current?.current?.cancel?.();
|
|
||||||
if (!watchChildren) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const url = loadChildrenAPI?.(record) as string;
|
|
||||||
try {
|
|
||||||
chunkRequestRef.current = setChunkRequest({
|
|
||||||
url,
|
|
||||||
params: {
|
|
||||||
page: 1,
|
|
||||||
perPage: 100
|
|
||||||
},
|
|
||||||
handler: updateChildrenHandler
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRowExpand = async () => {
|
const handleRowExpand = async () => {
|
||||||
onExpand?.(!expanded, record, record[rowKey]);
|
onExpand?.(!expanded, record, record[rowKey]);
|
||||||
setCurrentExpand(!expanded);
|
setCurrentExpand(!expanded);
|
||||||
@@ -216,7 +162,6 @@ const TableRow: React.FC<
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleVisibilityChange = async () => {
|
const handleVisibilityChange = async () => {
|
||||||
if (document.visibilityState === 'hidden') {
|
if (document.visibilityState === 'hidden') {
|
||||||
cacheDataListRef.current = [];
|
|
||||||
setUpdateChild(false);
|
setUpdateChild(false);
|
||||||
} else {
|
} else {
|
||||||
setUpdateChild(true);
|
setUpdateChild(true);
|
||||||
@@ -237,7 +182,6 @@ const TableRow: React.FC<
|
|||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
chunkRequestRef.current?.current?.cancel?.();
|
chunkRequestRef.current?.current?.cancel?.();
|
||||||
cacheDataListRef.current = [];
|
|
||||||
};
|
};
|
||||||
}, [updateChild, tableContext.allChildren]);
|
}, [updateChild, tableContext.allChildren]);
|
||||||
|
|
||||||
@@ -259,13 +203,13 @@ const TableRow: React.FC<
|
|||||||
disableExpand={disableExpand}
|
disableExpand={disableExpand}
|
||||||
></RowPrefix>
|
></RowPrefix>
|
||||||
<Row className="seal-table-row">
|
<Row className="seal-table-row">
|
||||||
{columns?.map((columnProps) => {
|
{columns?.map(({ key, ...restProps }) => {
|
||||||
return (
|
return (
|
||||||
<Col
|
<Col
|
||||||
key={`${columnProps.dataIndex}-${rowIndex}`}
|
key={`${restProps.dataIndex}-${rowIndex}`}
|
||||||
span={columnProps.span}
|
span={restProps.span}
|
||||||
>
|
>
|
||||||
<TableColumn {...columnProps}></TableColumn>
|
<TableColumn {...restProps}></TableColumn>
|
||||||
</Col>
|
</Col>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ const StatusTag: React.FC<StatusTagProps> = ({
|
|||||||
autoHide: 'never'
|
autoHide: 'never'
|
||||||
}}
|
}}
|
||||||
toolTipProps={{
|
toolTipProps={{
|
||||||
destroyTooltipOnHide: true
|
destroyOnHidden: true
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="txt err">
|
<span className="txt err">
|
||||||
|
|||||||
@@ -46,7 +46,12 @@ const UploadAudio: React.FC<UploadAudioProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
overlayInnerStyle={{ maxWidth: 290, width: 'max-content' }}
|
styles={{
|
||||||
|
body: {
|
||||||
|
maxWidth: 290,
|
||||||
|
width: 'max-content'
|
||||||
|
}
|
||||||
|
}}
|
||||||
title={intl.formatMessage(
|
title={intl.formatMessage(
|
||||||
{ id: 'playground.audio.uploadfile.tips' },
|
{ id: 'playground.audio.uploadfile.tips' },
|
||||||
{ formats: props.accept }
|
{ formats: props.accept }
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ export default function useTableFetch<T>(
|
|||||||
const { sortOrder, setSortOrder } = useTableSort({
|
const { sortOrder, setSortOrder } = useTableSort({
|
||||||
defaultSortOrder: 'descend'
|
defaultSortOrder: 'descend'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// for skeleton loading
|
||||||
const [extraStatus, setExtraStatus] = useState<Record<string, any>>({
|
const [extraStatus, setExtraStatus] = useState<Record<string, any>>({
|
||||||
firstLoad: true
|
firstLoad: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
onOk={handleSumit}
|
onOk={handleSumit}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterOpenChange={handleAfterOpenChange}
|
afterOpenChange={handleAfterOpenChange}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ const AddCluster: React.FC<AddModalProps> = ({
|
|||||||
title={modalTitle}
|
title={modalTitle}
|
||||||
open={open}
|
open={open}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={true}
|
||||||
onOk={handleSumit}
|
onOk={handleSumit}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const AddCluster: React.FC<AddModalProps> = ({
|
|||||||
title={title}
|
title={title}
|
||||||
open={open}
|
open={open}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const AddCluster: React.FC<AddModalProps> = ({
|
|||||||
title={title}
|
title={title}
|
||||||
open={open}
|
open={open}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const useCredentialColumns = (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, [handleSelect, sortOrder]);
|
}, [intl, handleSelect, sortOrder]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useCredentialColumns;
|
export default useCredentialColumns;
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ const ExportData: React.FC<{
|
|||||||
open={open}
|
open={open}
|
||||||
centered={false}
|
centered={false}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
|||||||
bordered={false}
|
bordered={false}
|
||||||
ghost
|
ghost
|
||||||
accordion
|
accordion
|
||||||
destroyInactivePanel={false}
|
destroyOnHidden={false}
|
||||||
className={dataformStyles['advanced-collapse']}
|
className={dataformStyles['advanced-collapse']}
|
||||||
expandIcon={({ isActive }) => (
|
expandIcon={({ isActive }) => (
|
||||||
<IconFont
|
<IconFont
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
|||||||
}}
|
}}
|
||||||
title={intl.formatMessage({ id: 'models.table.button.apiAccessInfo' })}
|
title={intl.formatMessage({ id: 'models.table.button.apiAccessInfo' })}
|
||||||
width={550}
|
width={550}
|
||||||
destroyOnClose
|
destroyOnHidden
|
||||||
closable={true}
|
closable={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
onOk={handleClose}
|
onOk={handleClose}
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
title={title}
|
title={title}
|
||||||
open={open}
|
open={open}
|
||||||
onClose={handleCancel}
|
onClose={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
title={title}
|
title={title}
|
||||||
open={open}
|
open={open}
|
||||||
onClose={handleCancel}
|
onClose={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -414,7 +414,12 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
|
|||||||
</ItemFileWrapper>
|
</ItemFileWrapper>
|
||||||
) : (
|
) : (
|
||||||
<Empty
|
<Empty
|
||||||
imageStyle={{ height: 'auto', marginTop: '20px' }}
|
styles={{
|
||||||
|
image: {
|
||||||
|
height: 'auto',
|
||||||
|
marginTop: '20px'
|
||||||
|
}
|
||||||
|
}}
|
||||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||||
description={intl.formatMessage({
|
description={intl.formatMessage({
|
||||||
id: 'models.search.nofiles'
|
id: 'models.search.nofiles'
|
||||||
|
|||||||
@@ -107,9 +107,11 @@ const WorkerInfo = (props: {
|
|||||||
open={open}
|
open={open}
|
||||||
onOpenChange={setOpen}
|
onOpenChange={setOpen}
|
||||||
title={props.title}
|
title={props.title}
|
||||||
overlayInnerStyle={{
|
styles={{
|
||||||
width: 'max-content',
|
body: {
|
||||||
maxWidth: '400px'
|
width: 'max-content',
|
||||||
|
maxWidth: '400px'
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="server-info">
|
<span className="server-info">
|
||||||
@@ -184,11 +186,15 @@ const RenderWorkerDownloading = (props: {
|
|||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
arrow={true}
|
arrow={true}
|
||||||
overlayInnerStyle={{
|
styles={{
|
||||||
width: 300,
|
body: {
|
||||||
backgroundColor: 'var(--color-spotlight-bg)'
|
width: 300,
|
||||||
|
backgroundColor: 'var(--color-spotlight-bg)'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
classNames={{
|
||||||
|
root: 'light-downloading-tooltip'
|
||||||
}}
|
}}
|
||||||
overlayClassName="light-downloading-tooltip"
|
|
||||||
title={
|
title={
|
||||||
<RenderRayactorDownloading
|
<RenderRayactorDownloading
|
||||||
severList={severList}
|
severList={severList}
|
||||||
@@ -505,10 +511,12 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
<TooltipOverlayScroller
|
<TooltipOverlayScroller
|
||||||
toolTipProps={{
|
toolTipProps={{
|
||||||
trigger: 'hover',
|
trigger: 'hover',
|
||||||
overlayInnerStyle: {
|
styles: {
|
||||||
width: 'max-content',
|
body: {
|
||||||
maxWidth: '520px',
|
width: 'max-content',
|
||||||
minWidth: '400px'
|
maxWidth: '520px',
|
||||||
|
minWidth: '400px'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
title={renderDistributedServer(severList)}
|
title={renderDistributedServer(severList)}
|
||||||
@@ -561,7 +569,11 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
overlayInnerStyle={{ paddingInline: 12 }}
|
styles={{
|
||||||
|
body: {
|
||||||
|
paddingInline: 12
|
||||||
|
}
|
||||||
|
}}
|
||||||
title={
|
title={
|
||||||
<InfoColumn fieldList={fieldList} data={offloadData}></InfoColumn>
|
<InfoColumn fieldList={fieldList} data={offloadData}></InfoColumn>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -514,7 +514,11 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
const renderGGUFTips = useMemo(() => {
|
const renderGGUFTips = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
overlayInnerStyle={{ width: 'max-content' }}
|
styles={{
|
||||||
|
body: {
|
||||||
|
width: 'max-content'
|
||||||
|
}
|
||||||
|
}}
|
||||||
title={
|
title={
|
||||||
<UL>
|
<UL>
|
||||||
<li>{intl.formatMessage({ id: 'models.search.gguf.tips' })}</li>
|
<li>{intl.formatMessage({ id: 'models.search.gguf.tips' })}</li>
|
||||||
|
|||||||
@@ -61,7 +61,12 @@ const SearchResult: React.FC<SearchResultProps> = (props) => {
|
|||||||
if (networkError) {
|
if (networkError) {
|
||||||
return (
|
return (
|
||||||
<Empty
|
<Empty
|
||||||
imageStyle={{ height: 'auto', marginTop: '20px' }}
|
styles={{
|
||||||
|
image: {
|
||||||
|
height: 'auto',
|
||||||
|
marginTop: '20px'
|
||||||
|
}
|
||||||
|
}}
|
||||||
image={
|
image={
|
||||||
<IconFont
|
<IconFont
|
||||||
type="icon-networkerror"
|
type="icon-networkerror"
|
||||||
@@ -98,7 +103,12 @@ const SearchResult: React.FC<SearchResultProps> = (props) => {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Empty
|
<Empty
|
||||||
imageStyle={{ height: 'auto', marginTop: '20px' }}
|
styles={{
|
||||||
|
image: {
|
||||||
|
height: 'auto',
|
||||||
|
marginTop: '20px'
|
||||||
|
}
|
||||||
|
}}
|
||||||
image={
|
image={
|
||||||
<SearchOutlined
|
<SearchOutlined
|
||||||
className="font-size-16"
|
className="font-size-16"
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { modelsExpandKeysAtom } from '@/atoms/models';
|
import { modelsExpandKeysAtom } from '@/atoms/models';
|
||||||
import AutoTooltip from '@/components/auto-tooltip';
|
|
||||||
import DeleteModal from '@/components/delete-modal';
|
import DeleteModal from '@/components/delete-modal';
|
||||||
import DropDownActions from '@/components/drop-down-actions';
|
import DropDownActions from '@/components/drop-down-actions';
|
||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
import { PageSize } from '@/components/logs-viewer/config';
|
import { PageSize } from '@/components/logs-viewer/config';
|
||||||
import PageTools from '@/components/page-tools';
|
import PageTools from '@/components/page-tools';
|
||||||
import SealTable from '@/components/seal-table';
|
import SealTable from '@/components/seal-table';
|
||||||
import { SealColumnProps } from '@/components/seal-table/types';
|
|
||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import useBodyScroll from '@/hooks/use-body-scroll';
|
import useBodyScroll from '@/hooks/use-body-scroll';
|
||||||
import useExpandedRowKeys from '@/hooks/use-expanded-row-keys';
|
import useExpandedRowKeys from '@/hooks/use-expanded-row-keys';
|
||||||
@@ -14,15 +12,11 @@ import useTableRowSelection from '@/hooks/use-table-row-selection';
|
|||||||
import useTableSort from '@/hooks/use-table-sort';
|
import useTableSort from '@/hooks/use-table-sort';
|
||||||
import { ListItem as WorkerListItem } from '@/pages/resources/config/types';
|
import { ListItem as WorkerListItem } from '@/pages/resources/config/types';
|
||||||
import { handleBatchRequest } from '@/utils';
|
import { handleBatchRequest } from '@/utils';
|
||||||
import {
|
import { DownOutlined, SyncOutlined } from '@ant-design/icons';
|
||||||
DownOutlined,
|
|
||||||
QuestionCircleOutlined,
|
|
||||||
SyncOutlined
|
|
||||||
} from '@ant-design/icons';
|
|
||||||
import { PageContainer } from '@ant-design/pro-components';
|
import { PageContainer } from '@ant-design/pro-components';
|
||||||
import { useIntl, useNavigate } from '@umijs/max';
|
import { useIntl, useNavigate } from '@umijs/max';
|
||||||
import { Button, Input, Select, Space, Tooltip, message } from 'antd';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import dayjs from 'dayjs';
|
import { Button, Input, Select, Space, message } from 'antd';
|
||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
@@ -51,9 +45,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
ButtonList,
|
ButtonList,
|
||||||
categoryToPathMap,
|
categoryToPathMap,
|
||||||
generateSource,
|
|
||||||
modalConfig,
|
modalConfig,
|
||||||
setModelActionList,
|
|
||||||
sourceOptions
|
sourceOptions
|
||||||
} from '../config/button-actions';
|
} from '../config/button-actions';
|
||||||
import {
|
import {
|
||||||
@@ -63,10 +55,10 @@ import {
|
|||||||
SourceType
|
SourceType
|
||||||
} from '../config/types';
|
} from '../config/types';
|
||||||
import useFormInitialValues from '../hooks/use-form-initial-values';
|
import useFormInitialValues from '../hooks/use-form-initial-values';
|
||||||
|
import useModelsColumns from '../hooks/use-models-columns';
|
||||||
import APIAccessInfoModal from './api-access-info';
|
import APIAccessInfoModal from './api-access-info';
|
||||||
import DeployModal from './deploy-modal';
|
import DeployModal from './deploy-modal';
|
||||||
import Instances from './instances';
|
import Instances from './instances';
|
||||||
import ModelTag from './model-tag';
|
|
||||||
import UpdateModel from './update-modal';
|
import UpdateModel from './update-modal';
|
||||||
import ViewLogsModal from './view-logs-modal';
|
import ViewLogsModal from './view-logs-modal';
|
||||||
interface ModelsProps {
|
interface ModelsProps {
|
||||||
@@ -96,21 +88,6 @@ interface ModelsProps {
|
|||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusList = [
|
|
||||||
{
|
|
||||||
label: 'Running',
|
|
||||||
value: 'running'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Stopped',
|
|
||||||
value: 'stopped'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Error',
|
|
||||||
value: 'error'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const getFormattedData = (record: any, extraData = {}) => ({
|
const getFormattedData = (record: any, extraData = {}) => ({
|
||||||
id: record.id,
|
id: record.id,
|
||||||
data: {
|
data: {
|
||||||
@@ -441,57 +418,47 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
const handleSelect = useCallback(
|
const handleSelect = useMemoizedFn(async (val: any, row: ListItem) => {
|
||||||
async (val: any, row: ListItem) => {
|
try {
|
||||||
try {
|
if (val === 'edit') {
|
||||||
if (val === 'edit') {
|
handleEdit(row);
|
||||||
handleEdit(row);
|
}
|
||||||
}
|
if (val === 'chat') {
|
||||||
if (val === 'chat') {
|
handleOpenPlayGround(row);
|
||||||
handleOpenPlayGround(row);
|
}
|
||||||
}
|
if (val === 'delete') {
|
||||||
if (val === 'delete') {
|
handleDelete(row);
|
||||||
handleDelete(row);
|
}
|
||||||
}
|
if (val === 'start') {
|
||||||
if (val === 'start') {
|
await handleStartModel(row);
|
||||||
await handleStartModel(row);
|
message.success(intl.formatMessage({ id: 'common.message.success' }));
|
||||||
message.success(intl.formatMessage({ id: 'common.message.success' }));
|
updateExpandedRowKeys([row.id, ...expandedRowKeys]);
|
||||||
updateExpandedRowKeys([row.id, ...expandedRowKeys]);
|
onStart?.();
|
||||||
onStart?.();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (val === 'api') {
|
|
||||||
handleViewAPIInfo(row);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (val === 'stop') {
|
|
||||||
modalRef.current?.show({
|
|
||||||
content: 'models.instances',
|
|
||||||
title: 'common.title.stop.confirm',
|
|
||||||
okText: 'common.button.stop',
|
|
||||||
operation: 'common.stop.single.confirm',
|
|
||||||
name: row.name,
|
|
||||||
async onOk() {
|
|
||||||
await handleStopModel(row);
|
|
||||||
onStop?.([row.id]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
[
|
|
||||||
handleEdit,
|
|
||||||
handleOpenPlayGround,
|
|
||||||
handleDelete,
|
|
||||||
onStop,
|
|
||||||
onStart,
|
|
||||||
expandedRowKeys
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleChildSelect = useCallback(
|
if (val === 'api') {
|
||||||
|
handleViewAPIInfo(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val === 'stop') {
|
||||||
|
modalRef.current?.show({
|
||||||
|
content: 'models.instances',
|
||||||
|
title: 'common.title.stop.confirm',
|
||||||
|
okText: 'common.button.stop',
|
||||||
|
operation: 'common.stop.single.confirm',
|
||||||
|
name: row.name,
|
||||||
|
async onOk() {
|
||||||
|
await handleStopModel(row);
|
||||||
|
onStop?.([row.id]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleChildSelect = useMemoizedFn(
|
||||||
(val: any, row: ModelInstanceListItem) => {
|
(val: any, row: ModelInstanceListItem) => {
|
||||||
if (val === 'delete') {
|
if (val === 'delete') {
|
||||||
handleDeleteInstace(row);
|
handleDeleteInstace(row);
|
||||||
@@ -499,8 +466,7 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
if (val === 'viewlog') {
|
if (val === 'viewlog') {
|
||||||
handleViewLogs(row);
|
handleViewLogs(row);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
[handleViewLogs, handleDeleteInstace]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const renderChildren = useCallback(
|
const renderChildren = useCallback(
|
||||||
@@ -575,114 +541,23 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns: SealColumnProps[] = useMemo(() => {
|
const options = useMemo(() => {
|
||||||
return [
|
return {
|
||||||
{
|
handleSelect,
|
||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
clusterList,
|
||||||
dataIndex: 'name',
|
sortOrder
|
||||||
key: 'name',
|
};
|
||||||
span: 5,
|
}, [handleSelect, clusterList, sortOrder]);
|
||||||
render: (text: string, record: ListItem) => (
|
|
||||||
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
|
||||||
<AutoTooltip ghost>
|
|
||||||
<span className="m-r-5">{text}</span>
|
|
||||||
</AutoTooltip>
|
|
||||||
<ModelTag categoryKey={record.categories?.[0] || ''} />
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Cluster',
|
|
||||||
dataIndex: 'cluster',
|
|
||||||
key: 'cluster',
|
|
||||||
span: 3,
|
|
||||||
render: (text: string, record: ListItem) => (
|
|
||||||
<span className="flex flex-column" style={{ width: '100%' }}>
|
|
||||||
{
|
|
||||||
clusterList.find((item) => item.value === record.cluster_id)
|
|
||||||
?.label
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.formatMessage({ id: 'models.form.source' }),
|
|
||||||
dataIndex: 'source',
|
|
||||||
key: 'source',
|
|
||||||
span: 5,
|
|
||||||
render: (text: string, record: ListItem) => (
|
|
||||||
<span className="flex flex-column" style={{ width: '100%' }}>
|
|
||||||
<AutoTooltip ghost>{generateSource(record)}</AutoTooltip>
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: (
|
|
||||||
<Tooltip
|
|
||||||
title={intl.formatMessage(
|
|
||||||
{ id: 'models.form.replicas.tips' },
|
|
||||||
{ api: `${window.location.origin}/v1` }
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
|
||||||
{intl.formatMessage({ id: 'models.form.replicas' })}
|
|
||||||
</span>
|
|
||||||
<QuestionCircleOutlined className="m-l-5" />
|
|
||||||
</Tooltip>
|
|
||||||
),
|
|
||||||
dataIndex: 'replicas',
|
|
||||||
key: 'replicas',
|
|
||||||
align: 'center',
|
|
||||||
span: 4,
|
|
||||||
editable: {
|
|
||||||
valueType: 'number',
|
|
||||||
title: intl.formatMessage({ id: 'models.table.replicas.edit' })
|
|
||||||
},
|
|
||||||
render: (text: number, record: ListItem) => (
|
|
||||||
<span style={{ paddingLeft: 10, minWidth: '33px' }}>
|
|
||||||
{record.ready_replicas} / {record.replicas}
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.formatMessage({ id: 'common.table.createTime' }),
|
|
||||||
dataIndex: 'created_at',
|
|
||||||
key: 'created_at',
|
|
||||||
defaultSortOrder: 'descend',
|
|
||||||
sortOrder,
|
|
||||||
sorter: false,
|
|
||||||
span: 4,
|
|
||||||
render: (text: number) => (
|
|
||||||
<AutoTooltip ghost>
|
|
||||||
{dayjs(text).format('YYYY-MM-DD HH:mm:ss')}
|
|
||||||
</AutoTooltip>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: intl.formatMessage({ id: 'common.table.operation' }),
|
|
||||||
key: 'operation',
|
|
||||||
dataIndex: 'operation',
|
|
||||||
span: 3,
|
|
||||||
render: (text, record) => (
|
|
||||||
<DropdownButtons
|
|
||||||
items={setModelActionList(record)}
|
|
||||||
onSelect={(val) => handleSelect(val, record)}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}, [sortOrder, intl, handleSelect]);
|
|
||||||
|
|
||||||
const handleToggleExpandAll = useCallback(
|
const columns = useModelsColumns(options);
|
||||||
(expanded: boolean) => {
|
|
||||||
const keys = dataSource.map((item) => item.id);
|
const handleToggleExpandAll = useMemoizedFn((expanded: boolean) => {
|
||||||
handleExpandAll(expanded, keys);
|
const keys = dataSource.map((item) => item.id);
|
||||||
if (expanded) {
|
handleExpandAll(expanded, keys);
|
||||||
handleOnToggleExpandAll();
|
if (expanded) {
|
||||||
}
|
handleOnToggleExpandAll();
|
||||||
},
|
}
|
||||||
[dataSource]
|
});
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -273,9 +273,8 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={true}
|
||||||
onOk={handleSumit}
|
onOk={handleSumit}
|
||||||
onCancel={onCancel}
|
onCancel={handleOnClose}
|
||||||
onClose={handleOnClose}
|
destroyOnHidden={true}
|
||||||
destroyOnClose={true}
|
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const ViewLogsModal: React.FC<ViewModalProps> = (props) => {
|
|||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={true}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={true}
|
keyboard={true}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ const DownloadModel: React.FC<AddModalProps> = (props) => {
|
|||||||
title={title}
|
title={title}
|
||||||
open={open}
|
open={open}
|
||||||
onClose={handleCancel}
|
onClose={handleCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -0,0 +1,130 @@
|
|||||||
|
// columns.ts
|
||||||
|
import AutoTooltip from '@/components/auto-tooltip';
|
||||||
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
|
import { SealColumnProps } from '@/components/seal-table/types';
|
||||||
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||||
|
import { useIntl } from '@umijs/max';
|
||||||
|
import { Tooltip } from 'antd';
|
||||||
|
import type { SortOrder } from 'antd/es/table/interface';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
import ModelTag from '../components/model-tag';
|
||||||
|
import { generateSource, setModelActionList } from '../config/button-actions';
|
||||||
|
import { ListItem } from '../config/types';
|
||||||
|
|
||||||
|
interface ModelsColumnsHookProps {
|
||||||
|
handleSelect: (val: string, record: ListItem) => void;
|
||||||
|
sortOrder: SortOrder;
|
||||||
|
clusterList: Global.BaseOption<
|
||||||
|
number,
|
||||||
|
{ provider: string; state: string | number }
|
||||||
|
>[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const useModelsColumns = ({
|
||||||
|
handleSelect,
|
||||||
|
clusterList,
|
||||||
|
sortOrder
|
||||||
|
}: ModelsColumnsHookProps): SealColumnProps[] => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
|
return useMemo(() => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
span: 5,
|
||||||
|
render: (text: string, record: ListItem) => (
|
||||||
|
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
||||||
|
<AutoTooltip ghost>
|
||||||
|
<span className="m-r-5">{text}</span>
|
||||||
|
</AutoTooltip>
|
||||||
|
<ModelTag categoryKey={record.categories?.[0] || ''} />
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Cluster',
|
||||||
|
dataIndex: 'cluster',
|
||||||
|
key: 'cluster',
|
||||||
|
span: 3,
|
||||||
|
render: (text: string, record: ListItem) => (
|
||||||
|
<span className="flex flex-column" style={{ width: '100%' }}>
|
||||||
|
{
|
||||||
|
clusterList.find((item) => item.value === record.cluster_id)
|
||||||
|
?.label
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: 'models.form.source' }),
|
||||||
|
dataIndex: 'source',
|
||||||
|
key: 'source',
|
||||||
|
span: 5,
|
||||||
|
render: (text: string, record: ListItem) => (
|
||||||
|
<span className="flex flex-column" style={{ width: '100%' }}>
|
||||||
|
<AutoTooltip ghost>{generateSource(record)}</AutoTooltip>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: (
|
||||||
|
<Tooltip
|
||||||
|
title={intl.formatMessage(
|
||||||
|
{ id: 'models.form.replicas.tips' },
|
||||||
|
{ api: `${window.location.origin}/v1` }
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
||||||
|
{intl.formatMessage({ id: 'models.form.replicas' })}
|
||||||
|
</span>
|
||||||
|
<QuestionCircleOutlined className="m-l-5" />
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
|
dataIndex: 'replicas',
|
||||||
|
key: 'replicas',
|
||||||
|
align: 'center',
|
||||||
|
span: 4,
|
||||||
|
editable: {
|
||||||
|
valueType: 'number',
|
||||||
|
title: intl.formatMessage({ id: 'models.table.replicas.edit' })
|
||||||
|
},
|
||||||
|
render: (text: number, record: ListItem) => (
|
||||||
|
<span style={{ paddingLeft: 10, minWidth: '33px' }}>
|
||||||
|
{record.ready_replicas} / {record.replicas}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: 'common.table.createTime' }),
|
||||||
|
dataIndex: 'created_at',
|
||||||
|
key: 'created_at',
|
||||||
|
defaultSortOrder: 'descend',
|
||||||
|
sortOrder,
|
||||||
|
sorter: false,
|
||||||
|
span: 4,
|
||||||
|
render: (text: number) => (
|
||||||
|
<AutoTooltip ghost>
|
||||||
|
{dayjs(text).format('YYYY-MM-DD HH:mm:ss')}
|
||||||
|
</AutoTooltip>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: 'common.table.operation' }),
|
||||||
|
key: 'operation',
|
||||||
|
dataIndex: 'operation',
|
||||||
|
span: 3,
|
||||||
|
render: (text, record) => (
|
||||||
|
<DropdownButtons
|
||||||
|
items={setModelActionList(record)}
|
||||||
|
onSelect={(val) => handleSelect(val, record)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}, [sortOrder, clusterList, intl, handleSelect]);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useModelsColumns;
|
||||||
@@ -293,7 +293,12 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
<Popover
|
<Popover
|
||||||
autoAdjustOverflow={true}
|
autoAdjustOverflow={true}
|
||||||
overlayInnerStyle={{ width: 375, paddingInline: 0 }}
|
styles={{
|
||||||
|
body: {
|
||||||
|
width: 375,
|
||||||
|
paddingInline: 0
|
||||||
|
}
|
||||||
|
}}
|
||||||
content={
|
content={
|
||||||
<OverlayScroller
|
<OverlayScroller
|
||||||
maxHeight={500}
|
maxHeight={500}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={true}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
|||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={true}
|
||||||
onCancel={handleClose}
|
onCancel={handleClose}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
open={open}
|
open={open}
|
||||||
centered={false}
|
centered={false}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const UpdateLabels: React.FC<ViewModalProps> = (props) => {
|
|||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={true}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const WorkerDetailModal: React.FC<WorkerDetailModalProps> = ({
|
|||||||
width={'calc(100vw - 200px)'}
|
width={'calc(100vw - 200px)'}
|
||||||
title={`${currentData?.name}`}
|
title={`${currentData?.name}`}
|
||||||
open={open}
|
open={open}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
onClose={handleOnClose}
|
onClose={handleOnClose}
|
||||||
>
|
>
|
||||||
<WorkerDetailContent worker_id={currentData?.id} />
|
<WorkerDetailContent worker_id={currentData?.id} />
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ const useFilesColumns = (props: {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, [workersList, handleSelect]);
|
}, [intl, workersList, handleSelect]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useFilesColumns;
|
export default useFilesColumns;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ const useGPUColumns = (props: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, [clusterList, loadend, firstLoad]);
|
}, [intl, clusterList, loadend, firstLoad]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useGPUColumns;
|
export default useGPUColumns;
|
||||||
|
|||||||
@@ -157,10 +157,12 @@ const DistributionInfo: React.FC<{
|
|||||||
<TooltipOverlayScroller
|
<TooltipOverlayScroller
|
||||||
toolTipProps={{
|
toolTipProps={{
|
||||||
trigger: 'hover',
|
trigger: 'hover',
|
||||||
overlayInnerStyle: {
|
styles: {
|
||||||
width: 'max-content',
|
body: {
|
||||||
maxWidth: '520px',
|
width: 'max-content',
|
||||||
minWidth: '400px'
|
maxWidth: '520px',
|
||||||
|
minWidth: '400px'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
title={renderDistributedServer(severList, instanceData)}
|
title={renderDistributedServer(severList, instanceData)}
|
||||||
@@ -217,7 +219,11 @@ const OffloadInfo: React.FC<{
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
overlayInnerStyle={{ paddingInline: 12 }}
|
styles={{
|
||||||
|
body: {
|
||||||
|
paddingInline: 12
|
||||||
|
}
|
||||||
|
}}
|
||||||
title={<InfoColumn fieldList={fieldList} data={offloadData}></InfoColumn>}
|
title={<InfoColumn fieldList={fieldList} data={offloadData}></InfoColumn>}
|
||||||
>
|
>
|
||||||
<ThemeTag
|
<ThemeTag
|
||||||
@@ -338,7 +344,7 @@ const useInstanceColumns = (props: {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, [clusterList]);
|
}, [intl, clusterList]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useInstanceColumns;
|
export default useInstanceColumns;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
centered={true}
|
centered={true}
|
||||||
onOk={handleSumit}
|
onOk={handleSumit}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
destroyOnClose={true}
|
destroyOnHidden={true}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
|
|||||||
Reference in New Issue
Block a user