Add-lightweight-control-center-home

This commit is contained in:
Codex
2026-06-08 20:58:11 +08:00
parent 4bb3593fc8
commit 9ecffde2ed
5 changed files with 750 additions and 2 deletions
+13 -1
View File
@@ -21,6 +21,7 @@ MENU_TREE_CACHE_KEY = "tree:ai_agent_admin"
USER_ROUTE_CACHE_PREFIX = "user_route:ai_agent_admin:"
AI_AGENT_ADMIN_MENU_NAMES = {
"ControlCenter",
"AIPlatform",
"AIAgent",
"AIWorkflow",
@@ -43,7 +44,18 @@ AI_AGENT_ADMIN_MENU_NAMES = {
def _filter_ai_agent_admin_menus(menus: List[Menu]) -> List[Menu]:
"""Keep only the lightweight admin and AI modules for this product."""
return [menu for menu in menus if menu.name in AI_AGENT_ADMIN_MENU_NAMES]
filtered = [menu for menu in menus if menu.name in AI_AGENT_ADMIN_MENU_NAMES]
for menu in filtered:
_normalize_ai_agent_admin_menu(menu)
return filtered
def _normalize_ai_agent_admin_menu(menu: Menu) -> None:
"""Route legacy low-code home to a lightweight static dashboard."""
if menu.name == "ControlCenter":
menu.path = "/control-center"
menu.component = "_core/control-center/index"
menu.query = None
class MenuService(BaseService[Menu, MenuCreate, MenuUpdate]):