From 7ff426f9757d87abc245c2c2cfcb7befbb91bc1a Mon Sep 17 00:00:00 2001 From: Apple Date: Sun, 30 Nov 2025 06:40:32 -0800 Subject: [PATCH] fix: allow node cabinet fallback when dashboard unavailable --- apps/web/src/app/nodes/[nodeId]/page.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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'}

+ {dashboardError && ( +
+ Детальний моніторинг тимчасово недоступний. Показано останній кешований профіль ноди. +
+ )} + {/* Main Grid */}