mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
perf: 并行化 admin 聚合路由并完善前端缓存预取
- gateway: usage detail / provider summary / pool overview / users list 改为 tokio join 并行拉取依赖数据 - usage: interval timeline 支持自动刷新并按查询区间动态展示,取消服务端 120 分钟过滤并在 ScatterChart 统一封顶 - frontend: 新增管理端导航预取工具及 SidebarNav/MainLayout 触发,admin 读接口统一走 cachedRequest 的短期缓存 - dashboard: request detail 支持短 TTL 缓存并在 UsageRecordsTable mousedown 时预取 - data: migrate 测试在 wait_for_postgres 失败时清理子进程,避免遗留
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
<SidebarNav
|
||||
:items="navigation"
|
||||
:is-active="isNavActive"
|
||||
@prefetch="prefetchNavigationItem"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -195,6 +196,9 @@
|
||||
:class="isNavActive(item.href)
|
||||
? 'bg-[#cc785c]/10 dark:bg-[#cc785c]/20 text-[#cc785c] dark:text-[#d4a27f]'
|
||||
: 'text-[#666663] dark:text-muted-foreground hover:bg-black/5 dark:hover:bg-white/5 hover:text-[#191919] dark:hover:text-white'"
|
||||
@mouseenter="prefetchNavigationItem(item.href)"
|
||||
@focus="prefetchNavigationItem(item.href)"
|
||||
@pointerdown="prefetchNavigationItem(item.href)"
|
||||
@click="mobileMenuOpen = false"
|
||||
>
|
||||
<component
|
||||
@@ -382,6 +386,7 @@ import {
|
||||
|
||||
import GithubIcon from '@/components/icons/GithubIcon.vue'
|
||||
import { BUILTIN_TOOL_BREADCRUMBS } from '@/config/builtin-tools'
|
||||
import { prefetchAdminNavigationTarget } from '@/utils/adminNavigationPrefetch'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -508,6 +513,10 @@ function isNavActive(href: string) {
|
||||
return route.path === href || route.path.startsWith(`${href}/`)
|
||||
}
|
||||
|
||||
function prefetchNavigationItem(href: string) {
|
||||
prefetchAdminNavigationTarget(href)
|
||||
}
|
||||
|
||||
// Navigation Data
|
||||
const navigation = computed(() => {
|
||||
const baseNavigation = [
|
||||
|
||||
Reference in New Issue
Block a user