diff --git a/apps/web/src/app/nodes/[nodeId]/page.tsx b/apps/web/src/app/nodes/[nodeId]/page.tsx index 0c9484fc..464468c1 100644 --- a/apps/web/src/app/nodes/[nodeId]/page.tsx +++ b/apps/web/src/app/nodes/[nodeId]/page.tsx @@ -27,17 +27,20 @@ export default function NodeCabinetPage() { const nodeId = params.nodeId as string; const nodeLabel = getNodeLabel(nodeId); + const dashboardEnabled = nodeId === 'node-1-hetzner-gex44'; + // Basic node profile from node_cache const { node: nodeProfile, isLoading: profileLoading, error: profileError } = useNodeProfile(nodeId); // Full dashboard (if available - currently only for NODE1) const { dashboard, isLoading: dashboardLoading, error: dashboardError, refresh, lastUpdated } = useNodeDashboard({ refreshInterval: 30000, - enabled: nodeId === 'node-1-hetzner-gex44' // Only enable for NODE1 + enabled: dashboardEnabled }); - const isLoading = profileLoading || dashboardLoading; - const error = profileError || (dashboardError && nodeId === 'node-1-hetzner-gex44'); + const isLoading = profileLoading || (dashboardEnabled && dashboardLoading); + const shouldShowError = (!!profileError && !nodeProfile) || (!nodeProfile && !dashboard); + const isProduction = nodeProfile?.environment === 'production'; if (isLoading && !nodeProfile && !dashboard) { @@ -55,13 +58,13 @@ export default function NodeCabinetPage() { ); } - if (error || (!nodeProfile && !dashboard)) { + if (shouldShowError) { return (
Failed to load node
-{(error as Error)?.message || 'Node not found'}
+{profileError?.message || 'Node not found'}