fix: restore dashboard renderer quality
This commit is contained in:
@@ -9,6 +9,7 @@ import { preferences } from '@vben/preferences';
|
||||
|
||||
import { getAllMenusApi } from '#/api/core/menu';
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
import { ensureAdminRuntime } from '#/runtime/admin';
|
||||
import { useAppContextStore } from '#/store/app-context';
|
||||
|
||||
import { createAdminRuntimePage } from './admin-runtime-page';
|
||||
@@ -93,6 +94,7 @@ function withAdminRuntimePages(pageMap: ComponentRecordType) {
|
||||
|
||||
const PREFETCH_LIGHT_PAGE_KEYS = [
|
||||
'../views/_core/menu/index.vue',
|
||||
'../views/_core/permission/index.vue',
|
||||
'../views/_core/role/index.vue',
|
||||
'../views/_core/user/index.vue',
|
||||
];
|
||||
@@ -114,6 +116,7 @@ function prefetchLightPages(pageMap: ComponentRecordType) {
|
||||
lightPagesPrefetched = true;
|
||||
window.setTimeout(() => {
|
||||
scheduleIdleTask(() => {
|
||||
void ensureAdminRuntime().catch(() => undefined);
|
||||
for (const key of PREFETCH_LIGHT_PAGE_KEYS) {
|
||||
const loader = pageMap[key];
|
||||
if (typeof loader === 'function') {
|
||||
@@ -121,7 +124,7 @@ function prefetchLightPages(pageMap: ComponentRecordType) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 12_000);
|
||||
}, 3_000);
|
||||
}
|
||||
|
||||
const LIGHT_AI_PLATFORM_MENU_ROUTES = [
|
||||
@@ -289,7 +292,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
layoutMap,
|
||||
pageMap,
|
||||
});
|
||||
prefetchLightPages(pageMap);
|
||||
prefetchLightPages(rawPageMap);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user