feat: 支持证书托管和节点自动安装
This commit is contained in:
+11
-3
@@ -6,6 +6,7 @@ import {
|
||||
Server,
|
||||
Radio,
|
||||
ScrollText,
|
||||
ShieldCheck,
|
||||
} from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
@@ -17,12 +18,19 @@ type NavItem = {
|
||||
|
||||
export function AdminNav({ items }: { items: NavItem[] }) {
|
||||
const pathname = usePathname();
|
||||
const icons = [LayoutDashboard, Users, Server, Radio, ScrollText];
|
||||
const icons: Record<string, typeof Server> = {
|
||||
"/admin/dashboard": LayoutDashboard,
|
||||
"/admin/users": Users,
|
||||
"/admin/nodes": Server,
|
||||
"/admin/certificates": ShieldCheck,
|
||||
"/admin/subscriptions": Radio,
|
||||
"/admin/audits": ScrollText,
|
||||
};
|
||||
|
||||
return (
|
||||
<nav className="nav-list">
|
||||
{items.map((item, index) => {
|
||||
const Icon = icons[index];
|
||||
{items.map((item) => {
|
||||
const Icon = icons[item.href] ?? Server;
|
||||
const active =
|
||||
pathname === item.href || pathname.startsWith(`${item.href}/`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user