feat: add governance bootstrap models
This commit is contained in:
35
backend/apps/accounts/menus.py
Normal file
35
backend/apps/accounts/menus.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class MenuSpec:
|
||||
code: str
|
||||
title: str
|
||||
path: str = ""
|
||||
icon: str = ""
|
||||
parent_code: str = ""
|
||||
sort_order: int = 0
|
||||
permission_code: str = ""
|
||||
is_visible: bool = True
|
||||
is_enabled: bool = True
|
||||
|
||||
|
||||
DEFAULT_MENUS: tuple[MenuSpec, ...] = (
|
||||
MenuSpec("workbench", "工作台", icon="home", sort_order=10),
|
||||
MenuSpec("workbench.overview", "运营总览", "#/", "home", "workbench", 10),
|
||||
MenuSpec("business", "业务处理", icon="ticket", sort_order=20),
|
||||
MenuSpec("business.tickets", "工单中心", "#/tickets", "ticket", "business", 10, "ticket.view"),
|
||||
MenuSpec("business.ticket_create", "创建工单", "#/tickets/new", "briefcase", "business", 20, "ticket.create"),
|
||||
MenuSpec("business.solutions", "解决方案库", "#/solutions", "library", "business", 30, "solution.view"),
|
||||
MenuSpec("platform", "平台能力", icon="bot", sort_order=30),
|
||||
MenuSpec("platform.knowledge", "知识库", "#/knowledge", "database", "platform", 10, "knowledge.view", is_enabled=False),
|
||||
MenuSpec("platform.agents", "Agent 配置", "#/agents", "bot", "platform", 20, "agent.manage", is_enabled=False),
|
||||
MenuSpec("platform.models", "模型与工具", "#/models", "settings", "platform", 30, "model.manage", is_enabled=False),
|
||||
MenuSpec("system", "系统治理", icon="shield", sort_order=40),
|
||||
MenuSpec("system.users", "用户管理", "#/system/users", "users", "system", 10, "system.user.view"),
|
||||
MenuSpec("system.user_groups", "用户组管理", "#/system/user-groups", "user_groups", "system", 20, "system.user_group.view"),
|
||||
MenuSpec("system.roles", "角色权限", "#/system/roles", "roles", "system", 30, "system.role.view"),
|
||||
MenuSpec("system.menus", "菜单权限", "#/system/menus", "menu", "system", 40, "system.menu.view"),
|
||||
MenuSpec("system.audit", "操作审计", "#/audit", "audit", "system", 50, "system.audit.view"),
|
||||
MenuSpec("system.design", "设计系统", "#/design-system", "settings", "system", 60),
|
||||
)
|
||||
Reference in New Issue
Block a user