import { CheckCircle, AlertCircle, Loader2, Clock } from 'lucide-react'; import { Card } from '../ui/card'; import { Badge } from '../ui/badge'; import { TroubleshootingPanel } from './TroubleshootingPanel'; import type { BootstrapProgress as BootstrapProgressType } from '../../services/api/types'; interface BootstrapProgressProps { progress: BootstrapProgressType; error?: string; } const BOOTSTRAP_STEPS = [ { id: 0, name: 'Bootstrap Command', description: 'Running talosctl bootstrap' }, { id: 1, name: 'etcd Health', description: 'Verifying etcd cluster health' }, { id: 2, name: 'VIP Assignment', description: 'Waiting for VIP assignment' }, { id: 3, name: 'Control Plane', description: 'Waiting for control plane components' }, { id: 4, name: 'API Server', description: 'Waiting for API server on VIP' }, { id: 5, name: 'Cluster Access', description: 'Configuring cluster access' }, { id: 6, name: 'Node Registration', description: 'Verifying node registration' }, ]; export function BootstrapProgress({ progress, error }: BootstrapProgressProps) { const getStepIcon = (stepId: number) => { if (stepId < progress.current_step) { return ; } if (stepId === progress.current_step) { if (error) { return ; } return ; } return ; }; const getStepStatus = (stepId: number) => { if (stepId < progress.current_step) { return 'completed'; } if (stepId === progress.current_step) { return error ? 'error' : 'running'; } return 'pending'; }; return (
{BOOTSTRAP_STEPS.map((step) => { const status = getStepStatus(step.id); const isActive = step.id === progress.current_step; return (
{getStepIcon(step.id)}

{step.name}

{status === 'completed' && ( Complete )} {status === 'running' && !error && ( In Progress )} {status === 'error' && ( Failed )}

{step.description}

{isActive && !error && (
Attempt {progress.attempt} of {progress.max_attempts}
)}
); })}
{error && }
); }