feat(admin): tracker api 模块与路由
- api/tracker/{visitors,dashboard,sites}.ts:类型逐字段对齐 server/tracker/api 序列化输出
(stay 一律 stay_ms,不引用已移除的 duration_ms;last_ip/时间线孤立会话组的
started_at 按后端可为 null;TrendPoint 含 new_visitors)
- 路由模块 tracker:数据总览/访客管理/站点管理三项菜单,访客详情 isHide 不进菜单
(query: visitor_id,activePath 回指访客管理),zh/en 语言包补 menus.tracker
- 4 个占位视图(Task 19-21 填充真实内容),vue-tsc 构建通过
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { dashboardRoutes } from './dashboard'
|
||||
import { systemRoutes } from './system'
|
||||
import { resultRoutes } from './result'
|
||||
import { exceptionRoutes } from './exception'
|
||||
import { trackerRoutes } from './tracker'
|
||||
|
||||
/**
|
||||
* 导出所有模块化路由
|
||||
@@ -11,5 +12,6 @@ export const routeModules: AppRouteRecord[] = [
|
||||
dashboardRoutes,
|
||||
systemRoutes,
|
||||
resultRoutes,
|
||||
exceptionRoutes
|
||||
exceptionRoutes,
|
||||
trackerRoutes
|
||||
]
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import { AppRouteRecord } from '@/types/router'
|
||||
|
||||
/**
|
||||
* 访客统计模块路由
|
||||
*
|
||||
* 菜单:数据总览 / 访客管理 / 站点管理;访客详情不进菜单(isHide),
|
||||
* 由列表页跳转并携带 query: visitor_id,activePath 让"访客管理"保持高亮。
|
||||
*/
|
||||
export const trackerRoutes: AppRouteRecord = {
|
||||
path: '/tracker',
|
||||
name: 'Tracker',
|
||||
component: '/index/index',
|
||||
meta: {
|
||||
title: 'menus.tracker.title',
|
||||
icon: 'ri:bar-chart-box-line',
|
||||
roles: ['R_SUPER', 'R_ADMIN']
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'dashboard',
|
||||
name: 'TrackerDashboard',
|
||||
component: '/tracker/dashboard/index',
|
||||
meta: {
|
||||
title: 'menus.tracker.dashboard',
|
||||
keepAlive: true,
|
||||
roles: ['R_SUPER', 'R_ADMIN']
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'visitor',
|
||||
name: 'TrackerVisitor',
|
||||
component: '/tracker/visitor/index',
|
||||
meta: {
|
||||
title: 'menus.tracker.visitor',
|
||||
keepAlive: true,
|
||||
roles: ['R_SUPER', 'R_ADMIN']
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'visitor/detail',
|
||||
name: 'TrackerVisitorDetail',
|
||||
component: '/tracker/visitor/detail',
|
||||
meta: {
|
||||
title: 'menus.tracker.visitorDetail',
|
||||
isHide: true,
|
||||
keepAlive: true,
|
||||
activePath: '/tracker/visitor'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'site',
|
||||
name: 'TrackerSite',
|
||||
component: '/tracker/site/index',
|
||||
meta: {
|
||||
title: 'menus.tracker.site',
|
||||
keepAlive: true,
|
||||
roles: ['R_SUPER', 'R_ADMIN']
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user