-
-
-
+
+ {/* Ribbon skeleton */}
+
+
+
+ {/* Priority skeleton */}
+
-
- {/* Stats skeleton */}
-
-
- {/* Groups skeleton */}
-
- {[1, 2, 3, 4].map((i) => (
-
- ))}
+ {/* Audit skeleton */}
+
+
+ {[1, 2, 3].map((i) => (
+
+ ))}
+
);
@@ -82,180 +38,93 @@ export function HealthPage() {
const { t } = useTranslation();
const { data, isLoading, refetch, dataUpdatedAt } = useHealth();
- // Use dataUpdatedAt directly instead of storing in state
- const lastRefresh = dataUpdatedAt;
-
- // Update relative time display by forcing re-render every second
- const [tick, setTick] = useState(0);
- useEffect(() => {
- const interval = setInterval(() => setTick((t) => t + 1), 1000);
- return () => clearInterval(interval);
- }, []);
- // Consume tick to prevent unused variable warning
- void tick;
-
- const copyDoctorCommand = () => {
- navigator.clipboard.writeText('ccs doctor');
- toast.success(t('health.copied'));
- };
-
- const handleRefresh = () => {
- refetch();
- toast.info(t('health.refreshing'));
- };
-
if (isLoading && !data) {
return
;
}
- const overallStatus = data ? getOverallStatus(data.summary) : 'ok';
- const sortedGroups = data?.groups ? sortGroupsByIssues(data.groups) : [];
+ const priorityChecks =
+ data?.checks.filter((c) => c.status === 'error' || c.status === 'warning') ?? [];
+ const hasIssues = priorityChecks.length > 0;
return (
-
- {/* Hero Section - Terminal-inspired control center header */}
-
- {/* Subtle scan lines effect */}
+
+ {/* Dynamic Background */}
+
-
- {/* Grid pattern background */}
-
-
-
- {/* Left: Health Gauge - excludes info from percentage */}
- {data && (
-
-
-
+ className={cn(
+ 'absolute -top-[20%] -left-[10%] w-[70%] h-[70%] blur-[120px] rounded-full opacity-[0.08] transition-colors duration-1000',
+ hasIssues ? 'bg-rose-500' : 'bg-emerald-500'
)}
-
- {/* Center: Title and status */}
-
- {/* Terminal prompt */}
-
-
- {/* Main title */}
-
-
- {t('health.systemHealth')}
-
- {data?.version && (
-
- {t('health.build', { version: data.version })}
-
- )}
-
-
- {/* Status message */}
-
-
- {t('health.lastScan')}
-
- {lastRefresh ? formatRelativeTime(lastRefresh, t) : '--'}
-
- |
- {t('health.autoRefresh')}
- 30s
-
-
-
- {/* Right: Actions */}
-
-
-
-
-
+ />
+
+ {/* Grain overlay */}
+
- {/* Stats Bar */}
- {data && (
-
-
+ {/* Status Ribbon */}
+ {data && (
+
-
- )}
+ )}
- {/* Health Check Groups - Single column layout */}
- {sortedGroups.length > 0 && (
-
- {sortedGroups.map((group, index) => (
- c.status === 'error' || c.status === 'warning')
- }
- />
- ))}
-
- )}
+
+ {/* Priority Issues */}
+ {hasIssues ? (
+
+ ) : (
+
+
+
+
{t('health.allSystemsClear')}
+
+ {t('health.optimalStateDesc')}
+
+
+
+ )}
- {/* Footer metadata */}
-
-
-
- {t('health.version')} {data?.version ?? '--'}
-
-
- {t('health.platform')}{' '}
-
- {typeof navigator !== 'undefined' ? navigator.platform : 'linux'}
-
-
+ {/* Detailed Audit */}
+ {data?.groups && }
-
-
-
{t('health.liveMonitoring')}
+
+ {/* Footer metadata */}
+
+
+
+ Build
+ {data?.version ?? '--'}
+
+
+ Platform
+
+ {typeof navigator !== 'undefined' ? navigator.platform : 'linux'}
+
+
+
+
+
+
{t('health.liveMonitoring')}
+