feat: add A-card operations frontend and backend foundation
This commit is contained in:
@@ -1,8 +1,45 @@
|
||||
import { Home, Code, Calendar, Settings, Users, Folder, ShieldCheck } from "lucide-react";
|
||||
import {
|
||||
Activity,
|
||||
Building2,
|
||||
Calendar,
|
||||
ChartNoAxesColumn,
|
||||
ClipboardList,
|
||||
Code,
|
||||
BookOpen,
|
||||
FileText,
|
||||
Files,
|
||||
Folder,
|
||||
Gauge,
|
||||
GitBranch,
|
||||
Home,
|
||||
Layers3,
|
||||
ListFilter,
|
||||
MessageSquareText,
|
||||
Settings,
|
||||
ShieldCheck,
|
||||
Users,
|
||||
Wrench,
|
||||
} from "lucide-react";
|
||||
import type { ComponentType } from "react";
|
||||
import type { OperationsRole } from "~/features/operations/operationsRole";
|
||||
|
||||
export type ActivePage = "home" | "scripts" | "schedules" | "system";
|
||||
export type SubPage = "users" | "projects" | "roles";
|
||||
export type ActivePage = "home" | "scripts" | "schedules" | "operations" | "system";
|
||||
export type SubPage =
|
||||
| "users"
|
||||
| "projects"
|
||||
| "roles"
|
||||
| "usage"
|
||||
| "models"
|
||||
| "banks"
|
||||
| "deployed-models"
|
||||
| "monitoring"
|
||||
| "reports"
|
||||
| "report-summary"
|
||||
| "workflows"
|
||||
| "knowledge"
|
||||
| "rules"
|
||||
| "prompts"
|
||||
| "settings";
|
||||
|
||||
export type NavigationItem = {
|
||||
/** 菜单显示名 */
|
||||
@@ -15,25 +52,69 @@ export type NavigationItem = {
|
||||
sub?: SubPage;
|
||||
/** 命中高亮的 pathname;不填则按 pathForPage(page) 派生 */
|
||||
activePath?: string;
|
||||
/** 子菜单点击后直达的路径;用于跨域工作台入口 */
|
||||
targetPath?: string;
|
||||
/** 当前端可访问的权限码;未配置时视为所有人可访问 */
|
||||
permission?: string;
|
||||
/** 运维域登录角色适配,仅用于界面展示,不承担权限管理 */
|
||||
visibleToOperationsRoles?: OperationsRole[];
|
||||
/** 子菜单条目 */
|
||||
children?: NavigationItem[];
|
||||
};
|
||||
|
||||
export const navigation: NavigationItem[] = [
|
||||
{ label: "工作台", icon: Home, page: "home", permission: "dashboard:view" },
|
||||
{
|
||||
label: "工作台",
|
||||
icon: Home,
|
||||
page: "home",
|
||||
children: [
|
||||
{ label: "开发工作台", icon: Home, page: "home", activePath: "/workbench", targetPath: "/workbench" },
|
||||
{ label: "运维工作台", icon: Gauge, page: "operations", activePath: "/operations", targetPath: "/operations", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
{ label: "平台使用统计", icon: ChartNoAxesColumn, page: "operations", activePath: "/operations/usage", targetPath: "/operations/usage", visibleToOperationsRoles: ["admin"] },
|
||||
],
|
||||
},
|
||||
{ label: "构建脚本", icon: Code, page: "scripts", permission: "script:view" },
|
||||
{ label: "调度配置", icon: Calendar, page: "schedules", permission: "schedule:view" },
|
||||
{
|
||||
label: "上线管理域",
|
||||
icon: Layers3,
|
||||
page: "operations",
|
||||
children: [
|
||||
{ label: "模型大类概览", icon: Layers3, page: "operations", sub: "models", activePath: "/operations/models", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
{ label: "细分银行概览", icon: Building2, page: "operations", sub: "banks", activePath: "/operations/banks", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
{ label: "已上线模型详情", icon: ClipboardList, page: "operations", sub: "deployed-models", activePath: "/operations/deployed-models", visibleToOperationsRoles: ["model", "admin"] },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "监控运维域",
|
||||
icon: Activity,
|
||||
page: "operations",
|
||||
children: [
|
||||
{ label: "监控明细", icon: ListFilter, page: "operations", sub: "monitoring", activePath: "/operations/monitoring", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
{ label: "监控诊断报告", icon: FileText, page: "operations", sub: "reports", activePath: "/operations/reports", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
{ label: "历史报告汇总", icon: Files, page: "operations", sub: "report-summary", activePath: "/operations/report-summary", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "开发评审域",
|
||||
icon: GitBranch,
|
||||
page: "operations",
|
||||
children: [
|
||||
{ label: "全流程进度", icon: GitBranch, page: "operations", sub: "workflows", activePath: "/operations/workflows", visibleToOperationsRoles: ["business", "model", "admin"] },
|
||||
{ label: "文档知识库", icon: BookOpen, page: "operations", sub: "knowledge", activePath: "/operations/knowledge", visibleToOperationsRoles: ["model", "admin"] },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "系统管理",
|
||||
icon: Settings,
|
||||
page: "system",
|
||||
permission: "system:view",
|
||||
children: [
|
||||
{ label: "用户管理", icon: Users, page: "system", sub: "users", permission: "system:user:view" },
|
||||
{ label: "项目管理", icon: Folder, page: "system", sub: "projects", permission: "system:project:view" },
|
||||
{ label: "角色管理", icon: ShieldCheck, page: "system", sub: "roles", permission: "system:role:view" },
|
||||
{ label: "监控等级规则", icon: ShieldCheck, page: "operations", sub: "rules", activePath: "/operations/rules", visibleToOperationsRoles: ["model", "admin"] },
|
||||
{ label: "报告 Prompt 管理", icon: MessageSquareText, page: "operations", sub: "prompts", activePath: "/operations/prompts", visibleToOperationsRoles: ["model", "admin"] },
|
||||
{ label: "运维系统配置", icon: Wrench, page: "operations", sub: "settings", activePath: "/operations/settings", visibleToOperationsRoles: ["admin"] },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user