feat: create security monitoring dashboard

This commit is contained in:
张翔
2026-03-24 11:27:23 +08:00
parent dea94b9955
commit 2ec4e65836
4 changed files with 479 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextRequest, NextResponse } from 'next/server';
import { SecurityLogger } from '@/lib/security/logger';
export async function GET(request: NextRequest) {
try {
const logs = SecurityLogger.getRecentLogs(100);
const stats = SecurityLogger.getStats();
return NextResponse.json({
success: true,
logs,
stats,
});
} catch (error) {
console.error('Error fetching security data:', error);
return NextResponse.json(
{
success: false,
error: 'Failed to fetch security data'
},
{ status: 500 }
);
}
}