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