fix: gpuindex sort
This commit is contained in:
@@ -373,7 +373,7 @@ const distributeCols: ColumnProps[] = [
|
|||||||
locale: true,
|
locale: true,
|
||||||
key: 'gpu_index',
|
key: 'gpu_index',
|
||||||
render: ({ row }) => {
|
render: ({ row }) => {
|
||||||
const list = _.sortBy(row.gpu_index, (item: number) => item);
|
const list = row.gpu_index?.sort((a: number, b: number) => a - b) || [];
|
||||||
return row.is_main ? (
|
return row.is_main ? (
|
||||||
<>
|
<>
|
||||||
{renderGpuIndexs(list)}
|
{renderGpuIndexs(list)}
|
||||||
@@ -538,7 +538,9 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
port: '',
|
port: '',
|
||||||
vram: calcTotalVram(instanceData.computed_resource_claim?.vram || {}),
|
vram: calcTotalVram(instanceData.computed_resource_claim?.vram || {}),
|
||||||
is_main: true,
|
is_main: true,
|
||||||
gpu_index: instanceData.gpu_indexes
|
gpu_index: instanceData.gpu_indexes?.sort(
|
||||||
|
(a: number, b: number) => a - b
|
||||||
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user