From 0d844c7ac6695efd849d8dc61fca9af453299aa1 Mon Sep 17 00:00:00 2001 From: Khairul Hidayat Date: Sat, 1 Feb 2025 02:49:29 +0000 Subject: [PATCH] fix: err cluster page for garage v0.9.x --- .../cluster/components/assign-node-dialog.tsx | 6 ++++-- src/pages/cluster/components/nodes-list.tsx | 4 +++- src/pages/cluster/page.tsx | 20 +++++++++++++++++-- src/pages/cluster/types.ts | 10 ++++++---- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/pages/cluster/components/assign-node-dialog.tsx b/src/pages/cluster/components/assign-node-dialog.tsx index c2a7fa6..acb0af0 100644 --- a/src/pages/cluster/components/assign-node-dialog.tsx +++ b/src/pages/cluster/components/assign-node-dialog.tsx @@ -66,7 +66,8 @@ const AssignNodeDialog = () => { }, [data]); const zoneList = useMemo(() => { - const list = cluster?.nodes + const nodes = cluster?.nodes || cluster?.knownNodes || []; + const list = nodes .flatMap((i) => { const role = layout?.roles.find((role) => role.id === i.id); const staged = layout?.stagedRoleChanges.find( @@ -83,7 +84,8 @@ const AssignNodeDialog = () => { }, [cluster, layout]); const tagsList = useMemo(() => { - const list = cluster?.nodes + const nodes = cluster?.nodes || cluster?.knownNodes || []; + const list = nodes .flatMap((i) => { const role = layout?.roles.find((role) => role.id === i.id); const staged = layout?.stagedRoleChanges.find( diff --git a/src/pages/cluster/components/nodes-list.tsx b/src/pages/cluster/components/nodes-list.tsx index da93c63..bfdcd70 100644 --- a/src/pages/cluster/components/nodes-list.tsx +++ b/src/pages/cluster/components/nodes-list.tsx @@ -268,7 +268,9 @@ const NodesList = ({ nodes }: NodeListProps) => { = items.length - 2 ? "top" : "bottom"} + vertical={ + idx > 2 && idx >= items.length - 2 ? "top" : "bottom" + } >