fix: model instances limit
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ const isProduction = env === 'production';
|
|||||||
const t = Date.now();
|
const t = Date.now();
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
proxy: {
|
proxy: {
|
||||||
...proxy()
|
...proxy('http://192.168.50.166:8080')
|
||||||
},
|
},
|
||||||
history: {
|
history: {
|
||||||
type: 'hash'
|
type: 'hash'
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const TableRow: React.FC<
|
|||||||
|
|
||||||
const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({
|
const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({
|
||||||
dataList: childrenData,
|
dataList: childrenData,
|
||||||
|
limit: 100,
|
||||||
setDataList: setChildrenData
|
setDataList: setChildrenData
|
||||||
// callback: (list) => renderChildren?.(list)
|
// callback: (list) => renderChildren?.(list)
|
||||||
});
|
});
|
||||||
@@ -118,7 +119,7 @@ const TableRow: React.FC<
|
|||||||
|
|
||||||
const updateChildrenHandler = (list: any) => {
|
const updateChildrenHandler = (list: any) => {
|
||||||
_.each(list, (data: any) => {
|
_.each(list, (data: any) => {
|
||||||
updateChunkedList(data, childrenDataRef.current);
|
updateChunkedList(data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ interface ChunkedCollection {
|
|||||||
// Only used to update lists without nested state
|
// Only used to update lists without nested state
|
||||||
export function useUpdateChunkedList(options: {
|
export function useUpdateChunkedList(options: {
|
||||||
dataList?: any[];
|
dataList?: any[];
|
||||||
|
limit?: number;
|
||||||
setDataList: (args: any) => void;
|
setDataList: (args: any) => void;
|
||||||
callback?: (args: any) => void;
|
callback?: (args: any) => void;
|
||||||
filterFun?: (args: any) => boolean;
|
filterFun?: (args: any) => boolean;
|
||||||
@@ -19,6 +20,7 @@ export function useUpdateChunkedList(options: {
|
|||||||
const cacheDataListRef = useRef<any[]>(options.dataList || []);
|
const cacheDataListRef = useRef<any[]>(options.dataList || []);
|
||||||
const timerRef = useRef<any>(null);
|
const timerRef = useRef<any>(null);
|
||||||
const countRef = useRef<number>(0);
|
const countRef = useRef<number>(0);
|
||||||
|
const limit = options.limit || 10;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
cacheDataListRef.current = [...(options.dataList || [])];
|
cacheDataListRef.current = [...(options.dataList || [])];
|
||||||
@@ -68,7 +70,7 @@ export function useUpdateChunkedList(options: {
|
|||||||
cacheDataListRef.current = [
|
cacheDataListRef.current = [
|
||||||
...newDataList,
|
...newDataList,
|
||||||
...cacheDataListRef.current
|
...cacheDataListRef.current
|
||||||
].slice(0, 10);
|
].slice(0, limit);
|
||||||
}
|
}
|
||||||
// DELETE
|
// DELETE
|
||||||
if (data?.type === WatchEventType.DELETE) {
|
if (data?.type === WatchEventType.DELETE) {
|
||||||
@@ -91,7 +93,7 @@ export function useUpdateChunkedList(options: {
|
|||||||
} else if (updateIndex === -1) {
|
} else if (updateIndex === -1) {
|
||||||
cacheDataListRef.current = [
|
cacheDataListRef.current = [
|
||||||
updateItem,
|
updateItem,
|
||||||
...cacheDataListRef.current.slice(0, 9)
|
...cacheDataListRef.current.slice(0, limit - 1)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -155,14 +155,14 @@ const GPUList: React.FC = () => {
|
|||||||
return <span>{text ? _.round(text, 1) : '-'}</span>;
|
return <span>{text ? _.round(text, 1) : '-'}</span>;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Column
|
{/* <Column
|
||||||
title={intl.formatMessage({ id: 'resources.table.core' })}
|
title={intl.formatMessage({ id: 'resources.table.core' })}
|
||||||
dataIndex="core"
|
dataIndex="core"
|
||||||
key="Core"
|
key="Core"
|
||||||
render={(text, record: GPUDeviceItem) => {
|
render={(text, record: GPUDeviceItem) => {
|
||||||
return <span>{record.core?.total}</span>;
|
return <span>{record.core?.total}</span>;
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
<Column
|
<Column
|
||||||
title={intl.formatMessage({ id: 'resources.table.gpuutilization' })}
|
title={intl.formatMessage({ id: 'resources.table.gpuutilization' })}
|
||||||
dataIndex="gpuUtil"
|
dataIndex="gpuUtil"
|
||||||
|
|||||||
Reference in New Issue
Block a user