'use client' /** * Admin Dashboard * * Central overview with quick stats and navigation to all admin sections */ import AdminLayout from '@/components/admin/AdminLayout' import AiPrompt from '@/components/admin/AiPrompt' import Link from 'next/link' import { useEffect, useState } from 'react' interface Stats { activeDocuments: number openDSR: number registeredUsers: number totalConsents: number gpuInstances: number pendingTranslations: number } export default function AdminDashboard() { const [stats, setStats] = useState({ activeDocuments: 0, openDSR: 0, registeredUsers: 0, totalConsents: 0, gpuInstances: 0, pendingTranslations: 0, }) const [loading, setLoading] = useState(true) useEffect(() => { // Load stats from consent service const loadStats = async () => { try { // Try to fetch from consent service const response = await fetch('http://localhost:8081/api/v1/admin/stats', { headers: { 'Authorization': `Bearer ${localStorage.getItem('adminToken') || ''}`, }, }) if (response.ok) { const data = await response.json() setStats({ activeDocuments: data.documents_count || 0, openDSR: data.open_dsr_count || 0, registeredUsers: data.users_count || 0, totalConsents: data.consents_count || 0, gpuInstances: 0, // Will be loaded from vast.ai pendingTranslations: 0, }) } } catch (error) { console.log('Stats not available:', error) } finally { setLoading(false) } } loadStats() }, []) const quickActions = [ { title: 'GPU Infrastruktur', description: 'vast.ai Instanzen verwalten', href: '/admin/gpu', icon: ( ), color: 'bg-purple-50 border-purple-200 hover:border-purple-400 text-purple-700', }, { title: 'Consent Verwaltung', description: 'Dokumente & Versionen', href: '/admin/consent', icon: ( ), color: 'bg-green-50 border-green-200 hover:border-green-400 text-green-700', }, { title: 'Datenschutzanfragen', description: 'DSGVO Art. 15-21', href: '/admin/dsr', icon: ( ), color: 'bg-orange-50 border-orange-200 hover:border-orange-400 text-orange-700', }, { title: 'DSMS', description: 'Datenschutz-Management', href: '/admin/dsms', icon: ( ), color: 'bg-blue-50 border-blue-200 hover:border-blue-400 text-blue-700', }, { title: 'Übersetzungen', description: 'Website Content', href: '/admin/content', icon: ( ), color: 'bg-indigo-50 border-indigo-200 hover:border-indigo-400 text-indigo-700', }, { title: 'Production Backlog', description: 'Go-Live Checkliste', href: '/admin/backlog', icon: ( ), color: 'bg-amber-50 border-amber-200 hover:border-amber-400 text-amber-700', }, ] const statCards = [ { label: 'Aktive Dokumente', value: stats.activeDocuments, color: 'text-green-600' }, { label: 'Offene DSR', value: stats.openDSR, color: stats.openDSR > 0 ? 'text-orange-600' : 'text-slate-600' }, { label: 'Registrierte Nutzer', value: stats.registeredUsers, color: 'text-blue-600' }, { label: 'Zustimmungen', value: stats.totalConsents, color: 'text-purple-600' }, { label: 'GPU Instanzen', value: stats.gpuInstances, color: 'text-pink-600' }, ] return ( {/* AI Prompt */} {/* Stats Grid */}
{statCards.map((stat) => (
{loading ? '-' : stat.value}
{stat.label}
))}
{/* Quick Actions */}

Schnellzugriff

{quickActions.map((action) => (
{action.icon}

{action.title}

{action.description}

))}
{/* Recent Activity */}
{/* Recent DSR */}

Neueste Datenschutzanfragen

Alle anzeigen

Keine offenen Anfragen

{/* System Status */}

System Status

Consent Service Online
Backend API Online
GPU Cluster Nicht verbunden
{/* Info Box */}

Entwickler Admin Portal

Dieses Portal ist nur für autorisierte Entwickler zugänglich. Hier verwaltest du die gesamte BreakPilot-Infrastruktur: GPU-Ressourcen, Consent-Dokumente, Datenschutzanfragen und Website-Übersetzungen.

) }