From 780a9b65066e632a3a3c9fcc72d474b63c74b7b5 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 25 Dec 2025 20:39:53 +0000 Subject: [PATCH] fix: ThresholdsTable now uses Guest URL for node navigation. Related to #870 --- .../src/components/Alerts/ThresholdsTable.tsx | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx index 508ac992e0..fd475c23d5 100644 --- a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx +++ b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx @@ -659,9 +659,15 @@ export function ThresholdsTable(props: ThresholdsTableProps) { const buildNodeHeaderMeta = (node: Node) => { const originalDisplayName = node.displayName?.trim() || node.name; const friendlyName = getFriendlyNodeName(originalDisplayName, node.clusterName); + // Prioritize guestURL over host (same as NodeGroupHeader) + const guestUrlValue = node.guestURL?.trim(); const hostValue = node.host?.trim(); let host: string | undefined; - if (hostValue && hostValue !== '') { + if (guestUrlValue && guestUrlValue !== '') { + host = guestUrlValue.startsWith('http') + ? guestUrlValue + : `https://${guestUrlValue}`; + } else if (hostValue && hostValue !== '') { host = hostValue.startsWith('http') ? hostValue : `https://${hostValue.includes(':') ? hostValue : `${hostValue}:8006`}`; @@ -720,11 +726,18 @@ export function ThresholdsTable(props: ThresholdsTableProps) { const rawName = node.name; const sanitizedName = friendlyName || originalDisplayName || rawName.split('.')[0] || rawName; // Build a best-effort management URL for the node + // Prioritize guestURL over host (same as NodeGroupHeader) + const guestUrlValue = node.guestURL?.trim(); const hostValue = node.host?.trim() || rawName; - const normalizedHost = - hostValue.startsWith('http://') || hostValue.startsWith('https://') - ? hostValue - : `https://${hostValue.includes(':') ? hostValue : `${hostValue}:8006`}`; + let normalizedHost: string; + if (guestUrlValue && guestUrlValue !== '') { + normalizedHost = guestUrlValue.startsWith('http') ? guestUrlValue : `https://${guestUrlValue}`; + } else { + normalizedHost = + hostValue.startsWith('http://') || hostValue.startsWith('https://') + ? hostValue + : `https://${hostValue.includes(':') ? hostValue : `${hostValue}:8006`}`; + } return { id: node.id,