feat(admin): enhance admin dashboard, user management, and content editor UX

- Dashboard: add stats API with content status distribution, recent notifications,
  and recent content updates; display active users, pending reviews, unread counts
- User management: full CRUD with role assignment, search, pagination, delete dialog
- Notification center: list with unread filter, mark as read, mark all as read,
  pagination, and auto-refresh unread count
- Content editor: form validation (required fields, slug format, blur-triggered
  errors), auto-save with 3s debounce and status indicator, publish confirmation
  dialog, unsaved changes warning on leave
- Admin layout: add navigation links for user management, roles, and notifications
- admin-api: make request() method public for custom API calls
- gitignore: add reports/mutation/ to exclude mutation test output
This commit is contained in:
2026-07-31 23:05:24 +08:00
parent a995f40eae
commit c480772aec
9 changed files with 1942 additions and 120 deletions
+9
View File
@@ -22,6 +22,7 @@ import {
Phone,
Shield,
UserCog,
Bell,
} from 'lucide-react';
const menuItems = [
@@ -66,9 +67,17 @@ const menuItems = [
label: '系统管理',
icon: Shield,
children: [
{ label: '用户管理', href: '/admin/users', icon: Users },
{ label: '角色权限', href: '/admin/roles', icon: UserCog },
],
},
{
label: '通知',
icon: Bell,
children: [
{ label: '通知中心', href: '/admin/notifications', icon: Bell },
],
},
];
export function AdminLayout({ children }: { children: React.ReactNode }) {