diff --git a/serve/frontend/src/components/Layout.tsx b/serve/frontend/src/components/Layout.tsx index 41edf3a..663daaf 100644 --- a/serve/frontend/src/components/Layout.tsx +++ b/serve/frontend/src/components/Layout.tsx @@ -28,6 +28,8 @@ import { Moon, Sun, User, + Users, + Shield, LogOut, } from 'lucide-react' import { Logo } from './Logo' @@ -92,6 +94,7 @@ export function Layout() { }) const username = authData?.username + const role = authData?.role const navigate = useNavigate() const qc = useQueryClient() const [darkMode, setDarkMode] = useState(() => { @@ -209,6 +212,21 @@ export function Layout() { )} + {/* 用户管理 (admin only) */} + {role === 'admin' && ( + + 'flex items-center gap-2 px-3 py-1.5 text-xs text-foreground/70 hover:bg-elevated hover:text-foreground transition-colors' + + (isActive ? ' bg-accent/10 text-accent' : '') + } + > + + + 用户管理 + + )} + {/* 暗夜模式 */}