46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import { SubmitButton } from "@/components/submit-button";
|
|
import { requireAdminAccess } from "@/lib/session";
|
|
|
|
import { AdminNav } from "./admin-nav";
|
|
|
|
const navItems = [
|
|
{ href: "/admin/dashboard", label: "仪表盘" },
|
|
{ href: "/admin/users", label: "用户管理" },
|
|
{ href: "/admin/nodes", label: "节点管理" },
|
|
{ href: "/admin/relays", label: "中转线路" },
|
|
{ href: "/admin/certificates", label: "证书与安装" },
|
|
{ href: "/admin/subscriptions", label: "订阅配置" },
|
|
{ href: "/admin/audits", label: "审计日志" },
|
|
];
|
|
|
|
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>
|
|
<div className="badge-row">
|
|
<span className="status-pill status-pill--ink">
|
|
{session.username}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<AdminNav items={navItems} />
|
|
<form action="/logout" method="post">
|
|
<SubmitButton variant="outline">退出登录</SubmitButton>
|
|
</form>
|
|
</aside>
|
|
<div className="content-shell">
|
|
<div className="content-frame">{children}</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|