新增独立于命令拦截(intercept_rules)的资产拦截功能,仅提供规则的 存储与管理;具体匹配/拦截逻辑另行实现。 - db: 新增 asset_intercept_rules 表(schema.sql,幂等)与 CRUD 层 (db/asset_intercept.go);kind 支持全等/模糊的 域名·IP·URL 及 CIDR - db: 首启动 seed 内置模糊拦截政府(.gov/.gov.cn)与教育(.edu/.edu.cn) 网站,settings 标记位门控,可禁用/删除且重启不复活 - server: /api/asset-intercept/rules 的 list/create/update/delete/toggle; cidr、exact_ip 做格式校验 - web: 新增「资产拦截」页(/system/intercept/assets)与侧边栏入口、 api 与类型定义
97 lines
2.8 KiB
TypeScript
97 lines
2.8 KiB
TypeScript
import {
|
|
Activity,
|
|
Ban,
|
|
Bot,
|
|
Brain,
|
|
Bug,
|
|
ClipboardList,
|
|
FolderOpen,
|
|
FolderSync,
|
|
LayoutDashboard,
|
|
type LucideIcon,
|
|
MessageSquare,
|
|
Network,
|
|
Plug,
|
|
Radio,
|
|
ScrollText,
|
|
Settings2,
|
|
ShieldAlert,
|
|
Sparkles,
|
|
Target,
|
|
Terminal,
|
|
Wrench,
|
|
} from "lucide-react";
|
|
|
|
export type NavBadge = "new" | "soon";
|
|
|
|
export interface NavSubItem {
|
|
id: string;
|
|
title: string;
|
|
url: string;
|
|
icon?: LucideIcon;
|
|
badge?: NavBadge;
|
|
disabled?: boolean;
|
|
newTab?: boolean;
|
|
}
|
|
|
|
interface NavItemBase {
|
|
id: string;
|
|
title: string;
|
|
icon?: LucideIcon;
|
|
badge?: NavBadge;
|
|
disabled?: boolean;
|
|
newTab?: boolean;
|
|
}
|
|
|
|
export interface NavMainLinkItem extends NavItemBase {
|
|
url: string;
|
|
subItems?: never;
|
|
}
|
|
|
|
export interface NavMainParentItem extends NavItemBase {
|
|
subItems: NavSubItem[];
|
|
}
|
|
|
|
export type NavMainItem = NavMainLinkItem | NavMainParentItem;
|
|
|
|
export interface NavGroup {
|
|
id: number;
|
|
label?: string;
|
|
items: NavMainItem[];
|
|
}
|
|
|
|
export const sidebarItems: NavGroup[] = [
|
|
{
|
|
id: 1,
|
|
label: "功能",
|
|
items: [
|
|
{ id: "dashboard", title: "仪表盘", url: "/dashboard", icon: LayoutDashboard },
|
|
{ id: "chat", title: "对话", url: "/chat", icon: MessageSquare },
|
|
{ id: "tasks", title: "任务", url: "/function/tasks", icon: Target },
|
|
{ id: "findings", title: "发现", url: "/function/findings", icon: Bug },
|
|
{ id: "traffic", title: "流量", url: "/function/traffic", icon: Activity },
|
|
{ id: "commands", title: "工具执行", url: "/function/commands", icon: Terminal },
|
|
{ id: "llm-records", title: "LLM 录制", url: "/function/llm-records", icon: Radio },
|
|
{ id: "assets", title: "资产", url: "/function/assets", icon: Network },
|
|
{ id: "sync", title: "资产同步", url: "/function/sync", icon: FolderSync },
|
|
{ id: "workspace", title: "工作空间", url: "/function/workspace", icon: FolderOpen },
|
|
],
|
|
},
|
|
{
|
|
id: 2,
|
|
label: "系统",
|
|
items: [
|
|
{ id: "llm", title: "LLM", url: "/system/llm", icon: Brain },
|
|
{ id: "agents", title: "Agent", url: "/system/agents", icon: Bot },
|
|
{ id: "mcp", title: "MCP", url: "/system/mcp", icon: Plug },
|
|
{ id: "skills", title: "Skill", url: "/system/skills", icon: Sparkles },
|
|
{ id: "tools", title: "工具", url: "/system/tools", icon: Wrench },
|
|
{ id: "intercept", title: "拦截规则", url: "/system/intercept", icon: ShieldAlert },
|
|
{ id: "asset-intercept", title: "资产拦截", url: "/system/intercept/assets", icon: Ban },
|
|
{ id: "approvals", title: "审批记录", url: "/system/intercept/approvals", icon: ClipboardList },
|
|
{ id: "logs", title: "日志", url: "/system/logs", icon: ScrollText },
|
|
{ id: "settings", title: "系统配置", url: "/system/settings", icon: Settings2 },
|
|
],
|
|
},
|
|
];
|