Phase 1 — Python (klausur-service): 5 monoliths → 36 files - dsfa_corpus_ingestion.py (1,828 LOC → 5 files) - cv_ocr_engines.py (2,102 LOC → 7 files) - cv_layout.py (3,653 LOC → 10 files) - vocab_worksheet_api.py (2,783 LOC → 8 files) - grid_build_core.py (1,958 LOC → 6 files) Phase 2 — Go (edu-search-service, school-service): 8 monoliths → 19 files - staff_crawler.go (1,402 → 4), policy/store.go (1,168 → 3) - policy_handlers.go (700 → 2), repository.go (684 → 2) - search.go (592 → 2), ai_extraction_handlers.go (554 → 2) - seed_data.go (591 → 2), grade_service.go (646 → 2) Phase 3 — TypeScript (admin-lehrer): 45 monoliths → 220+ files - sdk/types.ts (2,108 → 16 domain files) - ai/rag/page.tsx (2,686 → 14 files) - 22 page.tsx files split into _components/ + _hooks/ - 11 component files split into sub-components - 10 SDK data catalogs added to loc-exceptions - Deleted dead backup index_original.ts (4,899 LOC) All original public APIs preserved via re-export facades. Zero new errors: Python imports verified, Go builds clean, TypeScript tsc --noEmit shows only pre-existing errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
67 lines
2.8 KiB
TypeScript
67 lines
2.8 KiB
TypeScript
'use client'
|
|
|
|
import type { SeveritySummary, ScanType } from '../types'
|
|
|
|
interface SecurityHeaderProps {
|
|
overallStatus: { label: string; color: string }
|
|
summary: SeveritySummary
|
|
scanning: string | null
|
|
onRunScan: (scanType: ScanType) => void
|
|
}
|
|
|
|
export function SecurityHeader({ overallStatus, summary, scanning, onRunScan }: SecurityHeaderProps) {
|
|
return (
|
|
<div className="bg-white rounded-xl border border-slate-200 p-6 mb-6">
|
|
<div className="flex justify-between items-center mb-6">
|
|
<div className="flex items-center gap-4">
|
|
<h2 className="text-xl font-semibold text-slate-900">Security Status</h2>
|
|
<span className={`px-3 py-1 rounded-full text-sm font-semibold ${overallStatus.color}`}>
|
|
{overallStatus.label}
|
|
</span>
|
|
</div>
|
|
<div className="flex items-center gap-3">
|
|
<span className="flex items-center gap-2 text-sm text-slate-500">
|
|
<span className="w-2 h-2 rounded-full bg-green-500 animate-pulse" />
|
|
Auto-Refresh aktiv
|
|
</span>
|
|
<button
|
|
onClick={() => onRunScan('all')}
|
|
disabled={scanning !== null}
|
|
className={`px-4 py-2 rounded-lg font-medium transition-colors flex items-center gap-2 ${
|
|
scanning === 'all'
|
|
? 'bg-orange-200 text-orange-800'
|
|
: 'bg-orange-600 text-white hover:bg-orange-700 disabled:opacity-50'
|
|
}`}
|
|
>
|
|
{scanning === 'all' ? (
|
|
<>
|
|
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-orange-700" />
|
|
<span>Full Scan laeuft...</span>
|
|
</>
|
|
) : (
|
|
'Full Scan starten'
|
|
)}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Severity Summary */}
|
|
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4">
|
|
{([
|
|
{ key: 'critical', border: 'border-red-500', text: 'text-red-600', label: 'Critical' },
|
|
{ key: 'high', border: 'border-orange-500', text: 'text-orange-600', label: 'High' },
|
|
{ key: 'medium', border: 'border-yellow-500', text: 'text-yellow-600', label: 'Medium' },
|
|
{ key: 'low', border: 'border-green-500', text: 'text-green-600', label: 'Low' },
|
|
{ key: 'info', border: 'border-blue-500', text: 'text-blue-600', label: 'Info' },
|
|
{ key: 'total', border: 'border-slate-400', text: 'text-slate-700', label: 'Total' },
|
|
] as const).map(({ key, border, text, label }) => (
|
|
<div key={key} className={`border-l-4 ${border} bg-slate-50 rounded-r-lg p-4`}>
|
|
<div className={`text-3xl font-bold ${text}`}>{summary[key]}</div>
|
|
<div className="text-sm text-slate-600">{label}</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|