From 81fd571169def94b951e8703aba204c4f2e4f70f Mon Sep 17 00:00:00 2001 From: henrygd Date: Sun, 27 Sep 2026 11:39:23 -0400 Subject: [PATCH] refactor(site): move package updates to own tab and tweak table - show package updates in a separate Updates tab in the tabbed layout - sort major version changes first in the change column - use text-sm for version numbers --- internal/site/src/components/routes/system.tsx | 16 ++++++++++++++-- .../routes/system/package-updates-table.tsx | 8 ++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/internal/site/src/components/routes/system.tsx b/internal/site/src/components/routes/system.tsx index adc6f7ad..8c959676 100644 --- a/internal/site/src/components/routes/system.tsx +++ b/internal/site/src/components/routes/system.tsx @@ -23,7 +23,7 @@ import { LazyZfsTable, } from "./system/lazy-tables" import { LoadAverageChart } from "./system/charts/load-average-chart" -import { ContainerIcon, CpuIcon, HardDriveIcon, NetworkIcon, TerminalSquareIcon } from "lucide-react" +import { ContainerIcon, CpuIcon, HardDriveIcon, NetworkIcon, PackageIcon, TerminalSquareIcon } from "lucide-react" import { GpuIcon } from "../ui/icons" import SystemdTable from "../systemd-table/systemd-table" import ContainersTable from "../containers-table/containers-table" @@ -83,6 +83,7 @@ export default memo(function SystemDetail({ id }: { id: string }) { if (hasGpu) tabs.push("gpu") if (hasContainers) tabs.push("containers") if (hasSystemd) tabs.push("services") + if (packageUpdates) tabs.push("updates") tabsRef.current = tabs // shared chart props @@ -208,6 +209,12 @@ export default memo(function SystemDetail({ id }: { id: string }) { Services )} + {packageUpdates && ( + + + Updates + + )} @@ -221,7 +228,6 @@ export default memo(function SystemDetail({ id }: { id: string }) { {pageBottomExtraMargin > 0 &&
} - {packageUpdates && }
@@ -302,6 +308,12 @@ export default memo(function SystemDetail({ id }: { id: string }) { {mountedTabs.has("services") && } )} + + {packageUpdates && ( + + {mountedTabs.has("updates") && } + + )} ) } diff --git a/internal/site/src/components/routes/system/package-updates-table.tsx b/internal/site/src/components/routes/system/package-updates-table.tsx index 8f99b8fe..7041cce2 100644 --- a/internal/site/src/components/routes/system/package-updates-table.tsx +++ b/internal/site/src/components/routes/system/package-updates-table.tsx @@ -35,8 +35,8 @@ interface PackageUpdateRow extends PackageUpdate { change: VersionChange } -/** Sort order of version changes, largest first. */ -const changeRank: Record = { major: 4, minor: 3, patch: 2, revision: 1, other: 0 } +/** Sort order of version changes, so ascending puts major first. */ +const changeRank: Record = { major: 0, minor: 1, patch: 2, revision: 3, other: 4 } const changeVariant: Record = { major: "danger", @@ -107,7 +107,7 @@ function getColumns(securityKnown: boolean): ColumnDef[] { ), cell: ({ getValue }) => ( - {(getValue() as string) || "-"} + {(getValue() as string) || "-"} ), }, { @@ -120,7 +120,7 @@ function getColumns(securityKnown: boolean): ColumnDef[] { Available ), - cell: ({ getValue }) => {getValue() as string}, + cell: ({ getValue }) => {getValue() as string}, }, { id: "change",