71 lines
2.5 KiB
TypeScript
71 lines
2.5 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { Activity, Database, FileText, ShieldCheck } from "lucide-react";
|
|
import { Card } from "@/components/admin/ui";
|
|
|
|
const ENTRIES = [
|
|
{
|
|
href: "/tools/nl2sql",
|
|
icon: Activity,
|
|
title: "NL2SQL 配置",
|
|
description: "管理查询策略、角色权限和异常审计",
|
|
},
|
|
{
|
|
href: "/tools/knowledge",
|
|
icon: Database,
|
|
title: "知识库管理",
|
|
description: "维护 RAG 文档和检索数据",
|
|
},
|
|
{
|
|
href: "/products",
|
|
icon: FileText,
|
|
title: "基金数据",
|
|
description: "查看基金产品和历史净值",
|
|
},
|
|
];
|
|
|
|
export function AdminSection({ username }: { username: string }) {
|
|
return (
|
|
<div className="space-y-6">
|
|
<Card title="系统管理" description={`当前管理员:${username}`}>
|
|
<div className="grid gap-4 md:grid-cols-3">
|
|
{ENTRIES.map((entry) => (
|
|
<Link
|
|
key={entry.href}
|
|
href={entry.href}
|
|
className="group rounded-xl border border-slate-200 p-6 transition hover:border-indigo-500 hover:shadow-md"
|
|
>
|
|
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-50 text-indigo-600">
|
|
<entry.icon className="h-5 w-5" />
|
|
</div>
|
|
<h3 className="mt-5 font-semibold text-slate-900">{entry.title}</h3>
|
|
<p className="mt-2 text-sm leading-6 text-slate-500">{entry.description}</p>
|
|
<span className="mt-6 inline-block text-sm font-medium text-indigo-600 group-hover:underline">
|
|
进入模块
|
|
</span>
|
|
</Link>
|
|
))}
|
|
</div>
|
|
</Card>
|
|
|
|
<Card title="权限说明">
|
|
<ul className="space-y-2 text-sm leading-6 text-slate-600">
|
|
<li className="flex items-start gap-2">
|
|
<ShieldCheck className="mt-1 h-4 w-4 shrink-0 text-emerald-500" />
|
|
管理员默认拥有投顾和风控的全部前端操作权限,但实际鉴权仍以后端为准。
|
|
</li>
|
|
<li className="flex items-start gap-2">
|
|
<ShieldCheck className="mt-1 h-4 w-4 shrink-0 text-emerald-500" />
|
|
前端菜单显隐只是体验优化,不能替代后端权限校验。
|
|
</li>
|
|
<li className="flex items-start gap-2">
|
|
<ShieldCheck className="mt-1 h-4 w-4 shrink-0 text-emerald-500" />
|
|
所有敏感操作和查看行为都会写入审计台账,可在投顾模块导出。
|
|
</li>
|
|
</ul>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|