perf: X-Pack menu

This commit is contained in:
fit2cloud-chenyw
2025-08-04 14:30:57 +08:00
parent d4f4b8b1eb
commit b985403d85
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ dependencies = [
"pyyaml (>=6.0.2,<7.0.0)",
"fastapi-mcp (>=0.3.4,<0.4.0)",
"tabulate>=0.9.0",
"sqlbot-xpack==0.0.3.10",
"sqlbot-xpack==0.0.3.11",
"fastapi-cache2>=0.2.2",
"sqlparse>=0.5.3",
"redis>=6.2.0",
+1 -1
View File
@@ -168,5 +168,5 @@ const router = createRouter({
},
],
})
watchRouter(router)
await watchRouter(router)
export default router
+3 -2
View File
@@ -6,9 +6,10 @@ const userStore = useUserStore()
const { wsCache } = useCache()
const whiteList = ['/login']
const assistantWhiteList = ['/assistant']
export const watchRouter = (router: any) => {
export const watchRouter = async (router: any) => {
await loadXpackStatic()
LicenseGenerator.generateRouters(router)
router.beforeEach(async (to: any, from: any, next: any) => {
await loadXpackStatic()
if (assistantWhiteList.includes(to.path)) {
next()
return