diff --git a/config/config.ts b/config/config.ts index 3654689..9dbc3cc 100644 --- a/config/config.ts +++ b/config/config.ts @@ -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' diff --git a/src/components/seal-table/components/table-row.tsx b/src/components/seal-table/components/table-row.tsx index 75ff66b..474005c 100644 --- a/src/components/seal-table/components/table-row.tsx +++ b/src/components/seal-table/components/table-row.tsx @@ -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); }); }; diff --git a/src/hooks/use-update-chunk-list.ts b/src/hooks/use-update-chunk-list.ts index c19c9f6..6979df9 100644 --- a/src/hooks/use-update-chunk-list.ts +++ b/src/hooks/use-update-chunk-list.ts @@ -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(options.dataList || []); const timerRef = useRef(null); const countRef = useRef(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) ]; } }); diff --git a/src/pages/resources/components/gpus.tsx b/src/pages/resources/components/gpus.tsx index b1698e5..b1ec6a0 100644 --- a/src/pages/resources/components/gpus.tsx +++ b/src/pages/resources/components/gpus.tsx @@ -155,14 +155,14 @@ const GPUList: React.FC = () => { return {text ? _.round(text, 1) : '-'}; }} /> - { return {record.core?.total}; }} - /> + /> */}