init
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { requireAdminAccess } from "@/lib/session";
|
||||
|
||||
import { AdminNav } from "./admin-nav";
|
||||
|
||||
const navItems = [
|
||||
{ href: "/admin/dashboard", label: "仪表盘", meta: "运行态与健康度" },
|
||||
{ href: "/admin/users", label: "用户管理", meta: "凭证、额度与订阅" },
|
||||
{ href: "/admin/nodes", label: "节点管理", meta: "接入、鉴权与导出" },
|
||||
{ href: "/admin/subscriptions", label: "订阅配置", meta: "模板与代理分组" },
|
||||
{ href: "/admin/audits", label: "审计日志", meta: "鉴权失败与追踪" },
|
||||
];
|
||||
|
||||
export default async function AdminLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const session = await requireAdminAccess();
|
||||
|
||||
return (
|
||||
<div className="admin-shell">
|
||||
<aside className="sidebar">
|
||||
<div className="brand-block">
|
||||
<span className="eyebrow">HY2 PANEL</span>
|
||||
<h1>鹅梯控制台</h1>
|
||||
<p className="muted">
|
||||
管理员 {session.username} 已登录
|
||||
</p>
|
||||
</div>
|
||||
<AdminNav items={navItems} />
|
||||
<form action="/logout" method="post">
|
||||
<button className="ghost-button full-width" type="submit">
|
||||
退出登录
|
||||
</button>
|
||||
</form>
|
||||
</aside>
|
||||
<div className="content-shell">
|
||||
<div className="content-frame">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user