diff --git a/src/pages/resources/components/gpus.tsx b/src/pages/resources/components/gpus.tsx index e7d011e5..b1698e5f 100644 --- a/src/pages/resources/components/gpus.tsx +++ b/src/pages/resources/components/gpus.tsx @@ -183,7 +183,7 @@ const GPUList: React.FC = () => { render={(text, record: GPUDeviceItem) => { return ( diff --git a/src/pages/resources/components/workers.tsx b/src/pages/resources/components/workers.tsx index f2192bd7..b400c913 100644 --- a/src/pages/resources/components/workers.tsx +++ b/src/pages/resources/components/workers.tsx @@ -254,7 +254,7 @@ const Resources: React.FC = () => { render={(text, record: ListItem) => { return ( ); }} @@ -267,18 +267,18 @@ const Resources: React.FC = () => { return ( {intl.formatMessage({ id: 'resources.table.total' })}:{' '} - {convertFileSize(record?.status?.memory.total, 0)} + {convertFileSize(record?.status?.memory?.total, 0)} {intl.formatMessage({ id: 'resources.table.used' })}:{' '} - {convertFileSize(record?.status?.memory.used, 0)} + {convertFileSize(record?.status?.memory?.used, 0)} } @@ -293,22 +293,25 @@ const Resources: React.FC = () => { render={(text, record: ListItem) => { return ( - {record?.status?.gpu_devices.map((item, index) => { - return ( - - - [{item.index}] + {_.map( + record?.status?.gpu_devices, + (item: GPUDeviceItem, index: string) => { + return ( + + + [{item.index}] + + - - - ); - })} + ); + } + )} ); }} @@ -321,8 +324,9 @@ const Resources: React.FC = () => { render={(text, record: ListItem) => { return ( - {record?.status?.gpu_devices.map( - (item: GPUDeviceItem, index) => { + {_.map( + record?.status?.gpu_devices, + (item: GPUDeviceItem, index: string) => { return ( @@ -334,7 +338,7 @@ const Resources: React.FC = () => {