import AppLayout from '@/Layouts/AppLayout'; import { Head, router } from '@inertiajs/react'; import { Settings, Users, Activity, Shield, Database, Globe, Server, ChevronRight } from 'lucide-react'; import { GlassCard } from '@/Components/ui/GlassCard'; import { Button } from '@/Components/ui/Button'; import { motion } from 'framer-motion'; import { timeAgo } from '@/lib/utils'; const adminSections = [ { title: 'General Settings', href: '/admin/settings', icon: Settings, desc: 'App name, theme, session timeout' }, { title: 'LDAP / SSO', href: '/admin/ldap', icon: Globe, desc: 'Configure LDAP/AD authentication' }, { title: 'Users', href: '/acl/users', icon: Users, desc: 'Manage user accounts' }, { title: 'Roles & ACL', href: '/acl/roles', icon: Shield, desc: 'Roles and permission management' }, { title: 'Audit Log', href: '/admin/audit-log', icon: Activity, desc: 'User activity and system events' }, { title: 'System Health', href: '/admin/system-health',icon: Server, desc: 'Database, queues, storage status' }, ]; export default function AdminIndex({ stats, recent_activity }) { return (

Administration

System settings, users, and maintenance

{adminSections.map(s => { const Icon = s.icon; return (

{s.title}

{s.desc}

); })}
{/* System stats */}
{[ { label: 'Total Users', value: stats?.users ?? 0 }, { label: 'Active Sessions', value: stats?.sessions ?? 0 }, { label: 'Queue Jobs', value: stats?.queued ?? 0 }, { label: 'DB Size', value: stats?.db_size ?? '—' }, ].map(s => (

{s.value}

{s.label}

))}
{/* Recent activity */}

Recent Activity

{(recent_activity ?? []).map((log, i) => (
{log.causer?.name?.charAt(0)?.toUpperCase() ?? '?'}

{log.description}

{log.causer?.name ?? 'System'} · {timeAgo(log.created_at)}

))} {(!recent_activity || recent_activity.length === 0) && (

No recent activity

)}
); }