diff --git a/src/components/NodeOverview/NodeOverview.tsx b/src/components/NodeOverview/NodeOverview.tsx index 3674335..0b9ee28 100644 --- a/src/components/NodeOverview/NodeOverview.tsx +++ b/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 && ( + +