fix: restore all original menu items, regroup into 6 categories
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s

All original entries preserved. New grouping:
- 总览
- 用户与权限 (管理员/普通用户/会员与额度)
- 知识库 (知识库+知识源+运维+发布+导入+文件+复习)
- 学习数据 (Dashboard/事件/会话/进度/每日/记录/时间线/异常/诊断)
- 系统运维 (Hermes/限流/安全/密钥/监控/AI/服务器/对话/事件/向量/配置/备份/缓存/通知/内容安全)
- 合规与报表 (合规/审计/报表/API用量/项目)
- 系统配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-15 22:09:02 +08:00
parent 699f9012e0
commit b05e5d86c7
2 changed files with 55 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import type React from 'react'
import { DashboardOutlined, UserOutlined, BookOutlined, ReadOutlined, SettingOutlined } from '@ant-design/icons'
import { DashboardOutlined, UserOutlined, BookOutlined, ReadOutlined, SafetyOutlined, CloudServerOutlined, SettingOutlined } from '@ant-design/icons'
import type { AdminRole } from '@/types/admin'
import { hasRole } from '@/constants/roles'
@ -15,7 +15,7 @@ export const adminMenuItems: AdminMenuItem[] = [
{ path: '/', name: '总览', icon: <DashboardOutlined /> },
{
name: '用户管理', icon: <UserOutlined />, children: [
name: '用户与权限', icon: <UserOutlined />, children: [
{ path: '/users/admins', name: '管理员', requiredRole: 'SUPER_ADMIN' },
{ path: '/users/members', name: '普通用户' },
{ path: '/membership', name: '会员与额度', requiredRole: 'ADMIN' },
@ -26,8 +26,11 @@ export const adminMenuItems: AdminMenuItem[] = [
name: '知识库', icon: <BookOutlined />, children: [
{ path: '/knowledge/bases', name: '知识库列表' },
{ path: '/knowledge/sources', name: '知识源列表' },
{ path: '/knowledge/ops', name: '知识运维' },
{ path: '/release', name: '发布决策', requiredRole: 'ADMIN' },
{ path: '/imports', name: '文档导入' },
{ path: '/files', name: '文件与 COS' },
{ path: '/reviews', name: '复习数据', requiredRole: 'ADMIN' },
],
},
@ -47,12 +50,36 @@ export const adminMenuItems: AdminMenuItem[] = [
},
{
name: '系统', icon: <SettingOutlined />, children: [
{ path: '/settings', name: '系统配置', requiredRole: 'ADMIN' },
{ path: '/audit', name: '审计日志', requiredRole: 'ADMIN' },
{ path: '/ai-costs', name: 'AI 调用与成本' },
name: '系统运维', icon: <CloudServerOutlined />, requiredRole: 'SUPER_ADMIN', children: [
{ path: '/hermes', name: 'Hermes 设置' },
{ path: '/throttle', name: '限流管理' },
{ path: '/security-events', name: '安全事件' },
{ path: '/secrets', name: '密钥管理' },
{ path: '/metrics', name: '接口监控' },
{ path: '/ai-gateway', name: 'AI Gateway' },
{ path: '/servers', name: '服务器' },
{ path: '/chat-logs', name: '对话日志' },
{ path: '/events', name: '事件队列' },
{ path: '/vector', name: '向量检索' },
{ path: '/config', name: '配置管理' },
{ path: '/backup', name: '备份清理' },
{ path: '/cache', name: '缓存管理' },
{ path: '/notification-admin', name: '通知管理' },
{ path: '/safety', name: '内容安全' },
],
},
{
name: '合规与报表', icon: <SafetyOutlined />, requiredRole: 'ADMIN', children: [
{ path: '/compliance', name: '合规安全' },
{ path: '/audit', name: '审计日志' },
{ path: '/reporting', name: '报表导出' },
{ path: '/billing', name: 'API 用量', requiredRole: 'SUPER_ADMIN' },
{ path: '/git', name: '项目中心' },
],
},
{ path: '/settings', name: '系统配置', icon: <SettingOutlined />, requiredRole: 'ADMIN' },
]
export function filterMenuByRole(items: AdminMenuItem[], role?: AdminRole): AdminMenuItem[] {

View File

@ -9,6 +9,7 @@ import type { AdminRole } from '@/types/admin'
const breadcrumbMap: Record<string, string> = {
'/': '总览',
'/hermes': 'Hermes 设置',
'/users': '用户管理',
'/users/admins': '管理员',
'/users/members': '普通用户',
@ -16,8 +17,11 @@ const breadcrumbMap: Record<string, string> = {
'/knowledge': '知识库',
'/knowledge/bases': '知识库列表',
'/knowledge/sources': '知识源列表',
'/knowledge/ops': '知识运维',
'/release': '发布决策',
'/imports': '文档导入',
'/files': '文件与 COS',
'/reviews': '复习数据',
'/learning': '学习数据',
'/learning/events': '阅读事件',
'/learning/sessions': '学习会话',
@ -29,8 +33,25 @@ const breadcrumbMap: Record<string, string> = {
'/learning/user-diagnose': '用户诊断',
'/learning/material-diagnose': '资料诊断',
'/settings': '系统配置',
'/billing': 'API 用量',
'/git': '项目中心',
'/servers': '服务器运维',
'/config': '配置管理',
'/throttle': '限流管理',
'/security-events': '安全事件',
'/secrets': '密钥管理',
'/metrics': '接口监控',
'/ai-gateway': 'AI Gateway',
'/safety': '内容安全',
'/events': '事件队列',
'/audit': '审计日志',
'/ai-costs': 'AI 调用与成本',
'/compliance': '合规安全',
'/reporting': '报表导出',
'/backup': '备份清理',
'/cache': '缓存管理',
'/notification-admin': '通知管理',
'/vector': '向量检索',
'/chat-logs': '对话日志',
}
export default function AdminLayout() {