'use client' /** * NeuralPreFlight - SSH_COMMAND 安全預審面板 * =========================================== * 顯示 8 項安全審查結果 + 通過狀態 + 功能開關 * Sprint 3 指揮鏈可視化 + T1-T7 任務進度 */ import { useTranslations } from 'next-intl' import { CheckCircle2, AlertTriangle, ShieldCheck, ArrowRight, Shield, Database, Cpu, Key, Lock, GitBranch, Activity } from 'lucide-react' import { cn } from '@/lib/utils' import type { AutoRepairStats, PlaybookItem } from './types' // ============================================================================= // Audit items — 8 checks across A/B/C // ============================================================================= interface AuditCheck { id: string category: 'A' | 'B' | 'C' labelKey: string descKey: string status: 'fixed' | 'pending' | 'warning' } const AUDIT_CHECKS: AuditCheck[] = [ { id: 'A1', category: 'A', labelKey: 'checkA1Label', descKey: 'checkA1Desc', status: 'fixed' }, { id: 'A2', category: 'A', labelKey: 'checkA2Label', descKey: 'checkA2Desc', status: 'fixed' }, { id: 'A3', category: 'A', labelKey: 'checkA3Label', descKey: 'checkA3Desc', status: 'fixed' }, { id: 'B1', category: 'B', labelKey: 'checkB1Label', descKey: 'checkB1Desc', status: 'fixed' }, { id: 'B2', category: 'B', labelKey: 'checkB2Label', descKey: 'checkB2Desc', status: 'fixed' }, { id: 'C1', category: 'C', labelKey: 'checkC1Label', descKey: 'checkC1Desc', status: 'fixed' }, { id: 'C2', category: 'C', labelKey: 'checkC2Label', descKey: 'checkC2Desc', status: 'fixed' }, { id: 'C3', category: 'C', labelKey: 'checkC3Label', descKey: 'checkC3Desc', status: 'fixed' }, ] const CATEGORY_META = { A: { label: '安全性', color: 'text-orange-500', bg: 'bg-orange-500/10', border: 'border-orange-500/25' }, B: { label: '可觀測性', color: 'text-blue-500', bg: 'bg-blue-500/10', border: 'border-blue-500/25' }, C: { label: '系統架構', color: 'text-purple-500', bg: 'bg-purple-500/10', border: 'border-purple-500/25' }, } // ============================================================================= // Component // ============================================================================= interface Props { stats: AutoRepairStats | null playbooks: PlaybookItem[] } export function NeuralPreFlight({ stats, playbooks }: Props) { const t = useTranslations('neuralCommand') const totalChecks = AUDIT_CHECKS.length const fixedChecks = AUDIT_CHECKS.filter(c => c.status === 'fixed').length const allPassed = fixedChecks === totalChecks const categories = ['A', 'B', 'C'] as const return (
{t('preFlightSubtitle')}
{t('passBannerTitle')}
{t('passBannerDesc')}
{t(check.labelKey)}
{t(check.descKey)}
{t('featureToggles')}
{check.id}: {t(check.labelKey)}
{t(check.descKey)}
Sprint 3 SSH 指揮權鏈 — 神經嫁接架構
{/* Chain nodes */}{node.label}
{node.sub}
{task.id}
{task.label}
{task.desc}
{task.done &&✓ 完成
}{m.value}
{m.label}
{m.sub}
{value}
{label}