From 7d943633a3950bf6480911d9ff411e5fdc2fdb87 Mon Sep 17 00:00:00 2001 From: Sven van Ginkel Date: Sun, 21 Dec 2025 18:21:44 +0100 Subject: [PATCH] fix capacity sorting in smart table (#1551) --- internal/site/src/components/routes/system/smart-table.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/site/src/components/routes/system/smart-table.tsx b/internal/site/src/components/routes/system/smart-table.tsx index 610f2c83..40a923b9 100644 --- a/internal/site/src/components/routes/system/smart-table.tsx +++ b/internal/site/src/components/routes/system/smart-table.tsx @@ -99,6 +99,7 @@ export type DiskInfo = { device: string model: string capacity: string + capacityBytes: number status: string temperature: number deviceType: string @@ -125,6 +126,7 @@ function convertSmartDeviceRecordToDiskInfo(records: SmartDeviceRecord[]): DiskI serialNumber: record.serial || unknown, firmwareVersion: record.firmware || unknown, capacity: record.capacity ? formatCapacity(record.capacity) : unknown, + capacityBytes: record.capacity || 0, status: record.state || unknown, temperature: record.temp || 0, deviceType: record.type || unknown, @@ -175,6 +177,7 @@ export const columns: ColumnDef[] = [ }, { accessorKey: "capacity", + sortingFn: (a, b) => a.original.capacityBytes - b.original.capacityBytes, header: ({ column }) => , cell: ({ getValue }) => {getValue() as string}, },