{
- // Find the corresponding node in the WebSocket state
- const stateNode = state.nodes.find(n => n.instance === node.name);
- // Check if the node has an unhealthy connection or is offline
- if (stateNode?.connectionHealth === 'unhealthy' || stateNode?.connectionHealth === 'error' || stateNode?.status === 'offline') {
- return 'bg-red-500';
- }
- // Check if connection is degraded (partial cluster connectivity)
- if (stateNode?.connectionHealth === 'degraded') {
- return 'bg-yellow-500';
- }
- // Check if we have a healthy connection
- if (stateNode && (stateNode.status === 'online' || stateNode.connectionHealth === 'healthy')) {
- return 'bg-green-500';
- }
- // Fall back to the last known config status if live data hasn't arrived yet
- if (node.status === 'connected') {
- return 'bg-green-500';
- }
- if (node.status === 'error') {
- return 'bg-red-500';
- }
- if (node.status === 'pending' || node.status === 'disconnected') {
- return 'bg-amber-500 animate-pulse';
- }
- return 'bg-gray-400';
- })()
+
{
+ // Find the corresponding node in the WebSocket state
+ const stateNode = state.nodes.find(n => n.instance === node.name);
+ // Check if the node has an unhealthy connection or is offline
+ if (stateNode?.connectionHealth === 'unhealthy' || stateNode?.connectionHealth === 'error' || stateNode?.status === 'offline') {
+ return 'bg-red-500';
+ }
+ // Check if connection is degraded (partial cluster connectivity)
+ if (stateNode?.connectionHealth === 'degraded') {
+ return 'bg-yellow-500';
+ }
+ // Check if we have a healthy connection
+ if (stateNode && (stateNode.status === 'online' || stateNode.connectionHealth === 'healthy')) {
+ return 'bg-green-500';
+ }
+ // Fall back to the last known config status if live data hasn't arrived yet
+ if (node.status === 'connected') {
+ return 'bg-green-500';
+ }
+ if (node.status === 'error') {
+ return 'bg-red-500';
+ }
+ if (node.status === 'pending' || node.status === 'disconnected') {
+ return 'bg-amber-500 animate-pulse';
+ }
+ return 'bg-gray-400';
+ })()
}`}>
{
- // Find the corresponding PBS instance in the WebSocket state
- const statePBS = state.pbs.find(p => p.name === node.name);
- // Check if the PBS has an unhealthy connection or is offline
- if (statePBS?.connectionHealth === 'unhealthy' || statePBS?.connectionHealth === 'error' || statePBS?.status === 'offline') {
- return 'bg-red-500';
- }
- // Check if connection is degraded (not commonly used for PBS but keeping consistent)
- if (statePBS?.connectionHealth === 'degraded') {
- return 'bg-yellow-500';
- }
- // Check if we have a healthy connection
- if (statePBS && (statePBS.status === 'online' || statePBS.connectionHealth === 'healthy')) {
- return 'bg-green-500';
- }
- // Fall back to the last known config status if live data hasn't arrived yet
- if (node.status === 'connected') {
- return 'bg-green-500';
- }
- if (node.status === 'error') {
- return 'bg-red-500';
- }
- if (node.status === 'pending' || node.status === 'disconnected') {
- return 'bg-amber-500 animate-pulse';
- }
- return 'bg-gray-400';
- })()
- }`}>
-
+
+
{
+ // Find the corresponding PBS instance in the WebSocket state
+ const statePBS = state.pbs.find(p => p.name === node.name);
+ // Check if the PBS has an unhealthy connection or is offline
+ if (statePBS?.connectionHealth === 'unhealthy' || statePBS?.connectionHealth === 'error' || statePBS?.status === 'offline') {
+ return 'bg-red-500';
+ }
+ // Check if connection is degraded (not commonly used for PBS but keeping consistent)
+ if (statePBS?.connectionHealth === 'degraded') {
+ return 'bg-yellow-500';
+ }
+ // Check if we have a healthy connection
+ if (statePBS && (statePBS.status === 'online' || statePBS.connectionHealth === 'healthy')) {
+ return 'bg-green-500';
+ }
+ // Fall back to the last known config status if live data hasn't arrived yet
+ if (node.status === 'connected') {
+ return 'bg-green-500';
+ }
+ if (node.status === 'error') {
+ return 'bg-red-500';
+ }
+ if (node.status === 'pending' || node.status === 'disconnected') {
+ return 'bg-amber-500 animate-pulse';
+ }
+ return 'bg-gray-400';
+ })()
+ }`}>