feat: Website-Scan tab in agent UI — service table, SOLL/IST, corrections

- Tab system: Schnellanalyse (single page) + Website-Scan (multi-page)
- ScanResult component: service comparison table, severity-colored findings
- Expandable correction suggestions with copy button (pre-launch mode)
- API proxy route for /agent/scan endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-28 15:52:40 +02:00
parent 711b9b3146
commit 0f1fae61a6
3 changed files with 293 additions and 79 deletions

View File

@@ -0,0 +1,38 @@
/**
* Agent Scan API Proxy
* POST /api/sdk/v1/agent/scan → backend-compliance /api/compliance/agent/scan
*/
import { NextRequest, NextResponse } from 'next/server'
const BACKEND_URL = process.env.BACKEND_API_URL || 'http://backend-compliance:8002'
export async function POST(request: NextRequest) {
try {
const body = await request.text()
const response = await fetch(`${BACKEND_URL}/api/compliance/agent/scan`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body,
signal: AbortSignal.timeout(180000), // 3 min — multi-page scan + LLM
})
if (!response.ok) {
const errorText = await response.text()
return NextResponse.json(
{ error: `Backend: ${response.status}`, detail: errorText },
{ status: response.status }
)
}
const data = await response.json()
return NextResponse.json(data)
} catch (error) {
console.error('Agent scan proxy error:', error)
return NextResponse.json(
{ error: 'Scan fehlgeschlagen oder Timeout' },
{ status: 503 }
)
}
}