From 45ea51069c3b71d9140e2869082264b584e64063 Mon Sep 17 00:00:00 2001 From: Shantanu Joshi Date: Tue, 25 Nov 2025 15:48:13 -0800 Subject: [PATCH] list zones for vms for anyzone auto reserved nodes --- src/lib/nodes/list.tsx | 28 ++++++++++++++++++++++++++-- src/schema.ts | 2 ++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/lib/nodes/list.tsx b/src/lib/nodes/list.tsx index 121d38cd..b6d75e1d 100644 --- a/src/lib/nodes/list.tsx +++ b/src/lib/nodes/list.tsx @@ -32,12 +32,26 @@ dayjs.extend(utc); dayjs.extend(advanced); dayjs.extend(timezone); +// Extended VM type to include zone field for auto-reserved nodes +type VMWithZone = NonNullable["data"][number] & { + zone?: string | null; +}; + // Helper component to display VMs in a table format using Ink -function VMTable({ vms }: { vms: NonNullable["data"] }) { +function VMTable({ + vms, + nodeZone +}: { + vms: VMWithZone[]; + nodeZone?: string | null; +}) { const sortedVms = vms.sort((a, b) => b.updated_at - a.updated_at); const vmsToShow = sortedVms.slice(0, 5); const remainingVms = sortedVms.length - 5; + // Show zone column only when node doesn't have a zone (auto-reserved nodes) + const showZoneColumn = !nodeZone; + return ( {/* Header */} @@ -57,6 +71,11 @@ function VMTable({ vms }: { vms: NonNullable["data"] }) { Status + {showZoneColumn && ( + + Zone + + )} Start/End @@ -76,6 +95,11 @@ function VMTable({ vms }: { vms: NonNullable["data"] }) { {getVMStatusColor(vm.status)} + {showZoneColumn && ( + + {vm.zone ?? "N/A"} + + )} {startEnd} @@ -383,7 +407,7 @@ function NodeVerboseDisplay({ node }: { node: SFCNodes.Node }) { 💿 - + )} diff --git a/src/schema.ts b/src/schema.ts index 11047958..3880ad00 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -2165,6 +2165,8 @@ export interface components { * @example 1640995200 */ updated_at: number; + /** @example hayesvalley */ + zone?: string | null; }; "node-api_VmList": { data: components["schemas"]["node-api_Vm"][];