perf(desktop): lazy-load renderer routes and pause polling when hidden
Drop the eager Antd global import in favour of unplugin-vue-components on-demand resolution, async route components, defineAsyncComponent for the shell/login split, and a dynamic Modal import inside showClientActionError. Pair that with a visibility-aware runtime poller that stops the 15s snapshot refresh when the window is hidden and kicks off an immediate refresh on re-show. Refresh DesktopShell nav with inline icons and a calmer active/hover treatment, and land ActionButton/DisclosurePanel/PaginationBar primitives for upcoming views. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,36 @@
|
||||
import { createRouter, createWebHashHistory } from "vue-router";
|
||||
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
|
||||
|
||||
import AccountsView from "./views/AccountsView.vue";
|
||||
import AiPlatformsView from "./views/AiPlatformsView.vue";
|
||||
import DiagnosticsView from "./views/DiagnosticsView.vue";
|
||||
import HomeView from "./views/HomeView.vue";
|
||||
import PublishManagementView from "./views/PublishManagementView.vue";
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/",
|
||||
name: "home",
|
||||
component: () => import("./views/HomeView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/publish-management",
|
||||
name: "publish-management",
|
||||
component: () => import("./views/PublishManagementView.vue"),
|
||||
},
|
||||
{ path: "/tasks", redirect: "/publish-management" },
|
||||
{
|
||||
path: "/media-platforms",
|
||||
name: "media-platforms",
|
||||
component: () => import("./views/AccountsView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/ai-platforms",
|
||||
name: "ai-platforms",
|
||||
component: () => import("./views/AiPlatformsView.vue"),
|
||||
},
|
||||
{ path: "/accounts", redirect: "/media-platforms" },
|
||||
{
|
||||
path: "/diagnostics",
|
||||
name: "diagnostics",
|
||||
component: () => import("./views/DiagnosticsView.vue"),
|
||||
},
|
||||
];
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: [
|
||||
{ path: "/", name: "home", component: HomeView },
|
||||
{ path: "/publish-management", name: "publish-management", component: PublishManagementView },
|
||||
{ path: "/tasks", redirect: "/publish-management" },
|
||||
{ path: "/media-platforms", name: "media-platforms", component: AccountsView },
|
||||
{ path: "/ai-platforms", name: "ai-platforms", component: AiPlatformsView },
|
||||
{ path: "/accounts", redirect: "/media-platforms" },
|
||||
{ path: "/diagnostics", name: "diagnostics", component: DiagnosticsView },
|
||||
],
|
||||
routes,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user