From 955749c14c43b858f543f3cbce341e39b2a020f9 Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Thu, 21 May 2026 10:56:08 -0700 Subject: [PATCH] feat(protocol-dashboard): show validator stats from /health-check and link to /console - Replaces the old uptime/disk/db health rows on the validator node page with stats parsed from the validator /health-check endpoint: Node Type, Peers (recursive count over nested groupings), Current Height, Storage Type, Last Restart (computed from timestamp - uptime), and Git SHA (short, full on hover). - Adds a View Console button on the validator overview that opens ${endpoint}/console in a new tab. - Drops the IndividualNodeUptimeChart section for validators only. Content/Discovery pages are unchanged. - Guards the ServiceTable country flag against missing or non-ISO-3166 alpha-2 codes (validators may not report a country), rendering a neutral fallback. Co-Authored-By: Claude Opus 4.7 --- .../components/NodeOverview/NodeOverview.tsx | 69 +++++++++- .../components/ServiceTable/ServiceTable.tsx | 14 +- .../src/containers/Node/Node.tsx | 36 ++--- .../src/hooks/useNodeHealth.ts | 125 +++++++++++++++++- 4 files changed, 214 insertions(+), 30 deletions(-) diff --git a/packages/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx b/packages/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx index aab46e44fe5..eddd5292461 100644 --- a/packages/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx +++ b/packages/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx @@ -52,7 +52,14 @@ const messages = { checkDiskWarning: 'Check disk/mount', seedingDataText: 'Awaiting completion', uptimeWarning: 'Failed to determine when the server last restarted', - pending: 'Loading...' + pending: 'Loading...', + nodeType: 'Node Type', + peers: 'Peers', + currentHeight: 'Current Height', + storageType: 'Storage Type', + lastRestart: 'Last Restart', + gitSha: 'Git SHA', + viewConsole: 'View Console' } type ServiceDetailProps = { @@ -118,6 +125,7 @@ const NodeOverview = ({ }: NodeOverviewProps) => { const { isOpen, onClick, onClose } = useModalControls() const { health, status, error } = useNodeHealth(endpoint, serviceType) + const isValidator = serviceType === ServiceType.Validator let healthDetails = null if (status === 'pending') { @@ -139,6 +147,48 @@ const NodeOverview = ({ } /> ) + } else if (isValidator) { + healthDetails = ( + <> + {health?.nodeType && ( + + )} + {typeof health?.peerCount === 'number' && ( + + )} + {typeof health?.currentHeight === 'number' && ( + + )} + {health?.storageType && ( + + )} + {health?.startedAt && ( + {timeSince(health.startedAt)}} + text={`ago (${health.startedAt.toLocaleString()})`} + /> + } + /> + )} + {health?.gitSha && ( + {health.gitSha.slice(0, 7)} + } + /> + )} + + ) } else { healthDetails = ( <> @@ -320,6 +370,23 @@ const NodeOverview = ({ direction='column' alignItems='flex-end' > + {isValidator && endpoint && !isDeregistered && ( + +