From b01ec6117fd87c4698bef721e72156005b465e0c Mon Sep 17 00:00:00 2001 From: 0age <37939117+0age@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:00:11 -0800 Subject: [PATCH] minor health check tweaks --- frontend/src/components/HealthCheck.tsx | 68 +++++++++++++++++-------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/frontend/src/components/HealthCheck.tsx b/frontend/src/components/HealthCheck.tsx index 12a9fbe..b8b48bd 100644 --- a/frontend/src/components/HealthCheck.tsx +++ b/frontend/src/components/HealthCheck.tsx @@ -21,12 +21,16 @@ const HealthCheck: React.FC = () => { setError(null); } catch (error) { console.error('Error fetching health status:', error); - setError(error instanceof Error ? error.message : 'Failed to fetch health status'); + setError( + error instanceof Error + ? error.message + : 'Failed to fetch health status' + ); } }; - // Fetch health data every 2 seconds - const intervalId = setInterval(fetchHealthData, 2000); + // Fetch health data every second + const intervalId = setInterval(fetchHealthData, 1000); // Cleanup interval on component unmount return () => clearInterval(intervalId); @@ -37,8 +41,16 @@ const HealthCheck: React.FC = () => {
- - + +
@@ -62,15 +74,30 @@ const HealthCheck: React.FC = () => { return (
- {/* Allocator Address - Large */} -
- Allocator: - - {healthData.allocatorAddress} - + {/* Allocator Address and Status */} +
+
+ Allocator: + + {healthData.allocatorAddress} + +
+
+ Status: + + {healthData.status.charAt(0).toUpperCase() + + healthData.status.slice(1)} + +
- {/* Signer and Status - Smaller */} + {/* Signer and Last Checked */}
Signer: @@ -78,14 +105,15 @@ const HealthCheck: React.FC = () => { {healthData.signingAddress}
-
- Status: - - {healthData.status.charAt(0).toUpperCase() + healthData.status.slice(1)} +
+ Last Checked: + + {new Date(healthData.timestamp).toLocaleTimeString(undefined, { + hour12: false, + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })}