chore: trim nonessential admin routes
This commit is contained in:
@@ -17,7 +17,7 @@ from core.menu.schema import MenuCreate, MenuUpdate
|
|||||||
menu_cache = CacheManager(prefix="menu:")
|
menu_cache = CacheManager(prefix="menu:")
|
||||||
|
|
||||||
# 缓存key
|
# 缓存key
|
||||||
AI_AGENT_ADMIN_MENU_CACHE_VERSION = "v9"
|
AI_AGENT_ADMIN_MENU_CACHE_VERSION = "v10"
|
||||||
MENU_TREE_CACHE_KEY = f"tree:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}"
|
MENU_TREE_CACHE_KEY = f"tree:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}"
|
||||||
USER_ROUTE_CACHE_PREFIX = f"user_route:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}:"
|
USER_ROUTE_CACHE_PREFIX = f"user_route:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}:"
|
||||||
|
|
||||||
@@ -29,14 +29,11 @@ AI_AGENT_ADMIN_MENU_NAMES = {
|
|||||||
"AIWorkflow",
|
"AIWorkflow",
|
||||||
"AIWorkflowRuns",
|
"AIWorkflowRuns",
|
||||||
"KnowledgeBase",
|
"KnowledgeBase",
|
||||||
"Codex",
|
|
||||||
"SystemManagement",
|
"SystemManagement",
|
||||||
"SystemPermission",
|
"SystemPermission",
|
||||||
"UserManagement",
|
"UserManagement",
|
||||||
"SystemMenu",
|
"SystemMenu",
|
||||||
"SystemRole",
|
"SystemRole",
|
||||||
"Message",
|
|
||||||
"MessageList",
|
|
||||||
"AnnouncementList",
|
"AnnouncementList",
|
||||||
"AnnouncementManage",
|
"AnnouncementManage",
|
||||||
}
|
}
|
||||||
@@ -51,10 +48,10 @@ def _filter_ai_agent_admin_menus(menus: List[Menu]) -> List[Menu]:
|
|||||||
|
|
||||||
|
|
||||||
def _normalize_ai_agent_admin_menu(menu: Menu) -> None:
|
def _normalize_ai_agent_admin_menu(menu: Menu) -> None:
|
||||||
"""Route the retained control center to the original rendered dashboard."""
|
"""Route the retained control center to the AI agent workspace."""
|
||||||
if menu.name == "ControlCenter":
|
if menu.name == "ControlCenter":
|
||||||
menu.path = "/page-render/main_home"
|
menu.path = "/ai-platform/agent"
|
||||||
menu.component = "online-dev/page-render/index"
|
menu.component = "ai-platform/agent/index"
|
||||||
menu.query = None
|
menu.query = None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -100,11 +100,6 @@ const RoleSelector = defineAsyncComponent(() =>
|
|||||||
(res) => res.default,
|
(res) => res.default,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const DeptSelector = defineAsyncComponent(() =>
|
|
||||||
import('#/components/zq-form/dept-selector/dept-selector.vue').then(
|
|
||||||
(res) => res.default,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const FileSelector = defineAsyncComponent(() =>
|
const FileSelector = defineAsyncComponent(() =>
|
||||||
import('#/components/zq-form/file-selector/file-selector.vue').then(
|
import('#/components/zq-form/file-selector/file-selector.vue').then(
|
||||||
(res) => res.default,
|
(res) => res.default,
|
||||||
@@ -120,11 +115,6 @@ const UserSelector = defineAsyncComponent(() =>
|
|||||||
(res) => res.default,
|
(res) => res.default,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const PostSelector = defineAsyncComponent(() =>
|
|
||||||
import('#/components/zq-form/post-selector/post-selector.vue').then(
|
|
||||||
(res) => res.default,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const ZqIconPicker = defineAsyncComponent(() =>
|
const ZqIconPicker = defineAsyncComponent(() =>
|
||||||
import('#/components/zq-form/zq-icon-picker/zq-icon-picker.vue').then(
|
import('#/components/zq-form/zq-icon-picker/zq-icon-picker.vue').then(
|
||||||
(res) => res.default,
|
(res) => res.default,
|
||||||
@@ -176,14 +166,12 @@ export type ComponentType =
|
|||||||
| 'CheckboxGroup'
|
| 'CheckboxGroup'
|
||||||
| 'CodeEditor'
|
| 'CodeEditor'
|
||||||
| 'DatePicker'
|
| 'DatePicker'
|
||||||
| 'DeptSelector'
|
|
||||||
| 'Divider'
|
| 'Divider'
|
||||||
| 'FileSelector'
|
| 'FileSelector'
|
||||||
| 'IconPicker'
|
| 'IconPicker'
|
||||||
| 'ImageSelector'
|
| 'ImageSelector'
|
||||||
| 'Input'
|
| 'Input'
|
||||||
| 'InputNumber'
|
| 'InputNumber'
|
||||||
| 'PostSelector'
|
|
||||||
| 'RadioGroup'
|
| 'RadioGroup'
|
||||||
| 'RoleSelector'
|
| 'RoleSelector'
|
||||||
| 'Select'
|
| 'Select'
|
||||||
@@ -261,7 +249,6 @@ function initComponentAdapter() {
|
|||||||
PrimaryButton: (props, { attrs, slots }) => {
|
PrimaryButton: (props, { attrs, slots }) => {
|
||||||
return h(ElButton, { ...props, attrs, type: 'primary' }, slots);
|
return h(ElButton, { ...props, attrs, type: 'primary' }, slots);
|
||||||
},
|
},
|
||||||
DeptSelector: withDefaultPlaceholder(DeptSelector, 'select'),
|
|
||||||
RoleSelector: withDefaultPlaceholder(RoleSelector, 'select'),
|
RoleSelector: withDefaultPlaceholder(RoleSelector, 'select'),
|
||||||
Divider: ElDivider,
|
Divider: ElDivider,
|
||||||
FileSelector: withDefaultPlaceholder(FileSelector, 'select'),
|
FileSelector: withDefaultPlaceholder(FileSelector, 'select'),
|
||||||
@@ -274,7 +261,6 @@ function initComponentAdapter() {
|
|||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
}),
|
}),
|
||||||
InputNumber: withDefaultPlaceholder(ElInputNumber, 'input'),
|
InputNumber: withDefaultPlaceholder(ElInputNumber, 'input'),
|
||||||
PostSelector: withDefaultPlaceholder(PostSelector, 'select'),
|
|
||||||
RadioGroup: (props, { attrs, slots }) => {
|
RadioGroup: (props, { attrs, slots }) => {
|
||||||
let defaultSlot;
|
let defaultSlot;
|
||||||
if (Reflect.has(slots, 'default')) {
|
if (Reflect.has(slots, 'default')) {
|
||||||
|
|||||||
@@ -32,20 +32,10 @@ const baseModules = import.meta.glob([
|
|||||||
const businessModules = import.meta.glob([
|
const businessModules = import.meta.glob([
|
||||||
'./langs/zh-CN/ai-platform.json',
|
'./langs/zh-CN/ai-platform.json',
|
||||||
'./langs/zh-CN/announcement.json',
|
'./langs/zh-CN/announcement.json',
|
||||||
'./langs/zh-CN/dashboard-design.json',
|
|
||||||
'./langs/zh-CN/dept.json',
|
|
||||||
'./langs/zh-CN/dict.json',
|
|
||||||
'./langs/zh-CN/file-manager.json',
|
|
||||||
'./langs/zh-CN/loginLog.json',
|
|
||||||
'./langs/zh-CN/menu.json',
|
'./langs/zh-CN/menu.json',
|
||||||
'./langs/zh-CN/message.json',
|
|
||||||
'./langs/zh-CN/permission.json',
|
'./langs/zh-CN/permission.json',
|
||||||
'./langs/zh-CN/post.json',
|
|
||||||
'./langs/zh-CN/role.json',
|
'./langs/zh-CN/role.json',
|
||||||
'./langs/zh-CN/server-monitor.json',
|
|
||||||
'./langs/zh-CN/system.json',
|
'./langs/zh-CN/system.json',
|
||||||
'./langs/zh-CN/system-config.json',
|
|
||||||
'./langs/zh-CN/ui-config.json',
|
|
||||||
'./langs/zh-CN/user.json',
|
'./langs/zh-CN/user.json',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
|||||||
enablePreferences: true,
|
enablePreferences: true,
|
||||||
accessMode: 'mixed',
|
accessMode: 'mixed',
|
||||||
authPageLayout: 'panel-center',
|
authPageLayout: 'panel-center',
|
||||||
defaultHomePath: '/page-render/main_home',
|
defaultHomePath: '/ai-platform/agent',
|
||||||
layout: 'header-sidebar-nav',
|
layout: 'header-sidebar-nav',
|
||||||
preferencesButtonPosition: 'header',
|
preferencesButtonPosition: 'header',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ function normalizeBackendRoute<
|
|||||||
if (route.name !== 'ControlCenter') return route;
|
if (route.name !== 'ControlCenter') return route;
|
||||||
|
|
||||||
const normalized = { ...route };
|
const normalized = { ...route };
|
||||||
normalized.path = '/page-render/main_home';
|
normalized.path = '/ai-platform/agent';
|
||||||
normalized.component = '_core/page-render/index';
|
normalized.component = 'ai-platform/agent/index';
|
||||||
normalized.query = undefined;
|
normalized.query = undefined;
|
||||||
return normalized;
|
return normalized;
|
||||||
}
|
}
|
||||||
@@ -129,21 +129,11 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
|||||||
'../views/_core/account-settings/index.vue',
|
'../views/_core/account-settings/index.vue',
|
||||||
'../views/_core/authentication/login.vue',
|
'../views/_core/authentication/login.vue',
|
||||||
'../views/_core/authentication/oauth-callback.vue',
|
'../views/_core/authentication/oauth-callback.vue',
|
||||||
'../views/_core/dept/index.vue',
|
|
||||||
'../views/_core/dict/index.vue',
|
|
||||||
'../views/_core/fallback/**/*.vue',
|
'../views/_core/fallback/**/*.vue',
|
||||||
'../views/_core/file-manager/index.vue',
|
|
||||||
'../views/_core/file-preview/index.vue',
|
'../views/_core/file-preview/index.vue',
|
||||||
'../views/_core/login-log/index.vue',
|
|
||||||
'../views/_core/menu/index.vue',
|
'../views/_core/menu/index.vue',
|
||||||
'../views/_core/message/index.vue',
|
|
||||||
'../views/_core/page-render/index.vue',
|
|
||||||
'../views/_core/permission/index.vue',
|
'../views/_core/permission/index.vue',
|
||||||
'../views/_core/post/index.vue',
|
|
||||||
'../views/_core/role/index.vue',
|
'../views/_core/role/index.vue',
|
||||||
'../views/_core/server-monitor/index.vue',
|
|
||||||
'../views/_core/system-config/index.vue',
|
|
||||||
'../views/_core/ui-config/index.vue',
|
|
||||||
'../views/_core/user/index.vue',
|
'../views/_core/user/index.vue',
|
||||||
'../views/ai-platform/agent/editor/index.vue',
|
'../views/ai-platform/agent/editor/index.vue',
|
||||||
'../views/ai-platform/agent/index.vue',
|
'../views/ai-platform/agent/index.vue',
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ function setupAccessGuard(router: Router) {
|
|||||||
|
|
||||||
if (to.path === subAppRootPath) {
|
if (to.path === subAppRootPath) {
|
||||||
const defaultHome =
|
const defaultHome =
|
||||||
preferences.app.defaultHomePath || '/page-render/main_home';
|
preferences.app.defaultHomePath || '/ai-platform/agent';
|
||||||
// 确保路径包含子应用前缀
|
// 确保路径包含子应用前缀
|
||||||
const subAppTargetPath = defaultHome.startsWith(subAppRootPath)
|
const subAppTargetPath = defaultHome.startsWith(subAppRootPath)
|
||||||
? defaultHome
|
? defaultHome
|
||||||
|
|||||||
@@ -8,25 +8,12 @@ export const LIGHT_MENU_NAMES = new Set([
|
|||||||
'AccountSettings',
|
'AccountSettings',
|
||||||
'AnnouncementList',
|
'AnnouncementList',
|
||||||
'AnnouncementManage',
|
'AnnouncementManage',
|
||||||
'Codex',
|
|
||||||
'ControlCenter',
|
'ControlCenter',
|
||||||
'FileManager',
|
|
||||||
'KnowledgeBase',
|
'KnowledgeBase',
|
||||||
'LoginLog',
|
|
||||||
'Message',
|
|
||||||
'MessageList',
|
|
||||||
'ServerMonitor',
|
|
||||||
'SystemConfigManager',
|
|
||||||
'SystemDept',
|
|
||||||
'SystemDict',
|
|
||||||
'SystemFileManager',
|
|
||||||
'SystemLoginLog',
|
|
||||||
'SystemManagement',
|
'SystemManagement',
|
||||||
'SystemMenu',
|
'SystemMenu',
|
||||||
'SystemPost',
|
|
||||||
'SystemPermission',
|
'SystemPermission',
|
||||||
'SystemRole',
|
'SystemRole',
|
||||||
'UIConfigManager',
|
|
||||||
'UserManagement',
|
'UserManagement',
|
||||||
'userSettings',
|
'userSettings',
|
||||||
]);
|
]);
|
||||||
@@ -35,25 +22,15 @@ const LIGHT_ROUTE_PATH_PREFIXES = [
|
|||||||
'/account-settings',
|
'/account-settings',
|
||||||
'/ai-platform/agent',
|
'/ai-platform/agent',
|
||||||
'/ai-platform/knowledge',
|
'/ai-platform/knowledge',
|
||||||
|
'/ai-platform/knowledge-base',
|
||||||
'/ai-platform/model',
|
'/ai-platform/model',
|
||||||
'/ai-platform/workflow',
|
'/ai-platform/workflow',
|
||||||
'/ai-platform/workflow-runs',
|
'/ai-platform/workflow-runs',
|
||||||
'/announcement',
|
'/message/announcement',
|
||||||
'/codex',
|
'/system/menu',
|
||||||
'/dept',
|
'/system/new-permission',
|
||||||
'/dict',
|
'/system/role',
|
||||||
'/file-manager',
|
'/system/user',
|
||||||
'/login-log',
|
|
||||||
'/menu',
|
|
||||||
'/message',
|
|
||||||
'/page-render/main_home',
|
|
||||||
'/permission',
|
|
||||||
'/post',
|
|
||||||
'/role',
|
|
||||||
'/server-monitor',
|
|
||||||
'/system-config',
|
|
||||||
'/ui-config',
|
|
||||||
'/user',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export function isLightMenuName(name?: string) {
|
export function isLightMenuName(name?: string) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const routes: RouteRecordRaw[] = [
|
|||||||
meta: { hideInMenu: true },
|
meta: { hideInMenu: true },
|
||||||
name: 'ControlCenterLegacyRedirect',
|
name: 'ControlCenterLegacyRedirect',
|
||||||
path: '/control-center',
|
path: '/control-center',
|
||||||
redirect: '/page-render/main_home',
|
redirect: '/ai-platform/agent',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
meta: { hideInMenu: true },
|
meta: { hideInMenu: true },
|
||||||
|
|||||||
@@ -102,8 +102,6 @@ const componentKeys = [
|
|||||||
'/_core/fallback/forbidden',
|
'/_core/fallback/forbidden',
|
||||||
'/_core/fallback/not-found',
|
'/_core/fallback/not-found',
|
||||||
'/_core/menu/index',
|
'/_core/menu/index',
|
||||||
'/_core/message/index',
|
|
||||||
'/_core/page-render/index',
|
|
||||||
'/_core/permission/index',
|
'/_core/permission/index',
|
||||||
'/_core/role/index',
|
'/_core/role/index',
|
||||||
'/_core/user/index',
|
'/_core/user/index',
|
||||||
|
|||||||
@@ -191,14 +191,6 @@ export function getFormSchema(): VbenFormSchema[] {
|
|||||||
fieldName: 'bio',
|
fieldName: 'bio',
|
||||||
label: $t('user.bio'),
|
label: $t('user.bio'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'DeptSelector',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: $t('user.selectDept'),
|
|
||||||
},
|
|
||||||
fieldName: 'dept_id',
|
|
||||||
label: $t('user.dept'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
component: 'UserSelector',
|
component: 'UserSelector',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
@@ -207,14 +199,6 @@ export function getFormSchema(): VbenFormSchema[] {
|
|||||||
fieldName: 'manager_id',
|
fieldName: 'manager_id',
|
||||||
label: $t('user.manager'),
|
label: $t('user.manager'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'PostSelector',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: $t('user.selectPost'),
|
|
||||||
},
|
|
||||||
fieldName: 'post_id',
|
|
||||||
label: $t('user.post'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
component: 'RoleSelector',
|
component: 'RoleSelector',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
|||||||
Reference in New Issue
Block a user