From 304ffbf01de32c89fa1fb14d327d94a85f423d6f Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Mon, 2 Mar 2026 20:32:34 -0800 Subject: [PATCH] Add hoverable disk info --- ui/src/resources/server/table/stats.tsx | 35 ++++++++++++++++- ui/src/ui/stat-cell.tsx | 52 ++++++++++++++++++++----- 2 files changed, 75 insertions(+), 12 deletions(-) diff --git a/ui/src/resources/server/table/stats.tsx b/ui/src/resources/server/table/stats.tsx index 9130930c9..c3d383923 100644 --- a/ui/src/resources/server/table/stats.tsx +++ b/ui/src/resources/server/table/stats.tsx @@ -1,7 +1,7 @@ import { useSelectedResources } from "@/lib/hooks"; import ResourceLink from "@/resources/link"; import { DataTable, SortableHeader } from "@/ui/data-table"; -import { BoxProps, Group, Text } from "@mantine/core"; +import { BoxProps, Group, Stack, Text } from "@mantine/core"; import { Types } from "komodo_client"; import { useServerStats, useServerThresholds } from "@/resources/server/hooks"; import StatCell from "@/ui/stat-cell"; @@ -102,7 +102,38 @@ function DiskCell({ id }: { id: string }) { useServerThresholds(id); const intent: "Good" | "Warning" | "Critical" = perc < warning ? "Good" : perc < critical ? "Warning" : "Critical"; - return ; + return ( + + {stats?.disks.map((disk) => ( + + + Mount:{" "} + + {disk.mount} + + + - + + {disk.used_gb.toFixed(1)} GB out of {disk.total_gb.toFixed(1)}{" "} + GB ({((100 * disk.used_gb) / disk.total_gb).toFixed(1)} %) + + + ))} + + } + /> + ); } function LoadAvgCell({ id }: { id: string }) { diff --git a/ui/src/ui/stat-cell.tsx b/ui/src/ui/stat-cell.tsx index 577020331..6b8b8a451 100644 --- a/ui/src/ui/stat-cell.tsx +++ b/ui/src/ui/stat-cell.tsx @@ -1,18 +1,24 @@ import { ColorIntention, hexColorByIntention } from "@/lib/color"; +import { ICONS } from "@/theme/icons"; import { + ActionIcon, Group, GroupProps, + HoverCard, Progress, ProgressProps, Text, TextProps, } from "@mantine/core"; +import { ReactNode } from "react"; export interface StatCellProps extends GroupProps { value: number | undefined; intent: ColorIntention; textProps?: TextProps; barProps?: ProgressProps; + info?: ReactNode; + infoDisabled?: boolean; } export default function StatCell({ @@ -20,21 +26,47 @@ export default function StatCell({ intent, textProps, barProps, + info, + infoDisabled, ...groupProps }: StatCellProps) { + const ProgressComponent = ( + + ); return ( - - + + {value === undefined ? "N/A" : value.toFixed(1) + "%"} - + {!info && ProgressComponent} + {info && ( + + {ProgressComponent} + + + + + + + {info} + + + )} ); }