导航: 统一分区侧栏 + 新增用量统计页
- ShellLayout 按所在分区显示独立菜单: 用户控制台(/console) 与 管理后台(/admin) 不混排, 各带跨区跳转(管理→/返回控制台→) - /console 与 /admin 共用 ShellLayout, 移除 ConsoleLayout/AdminLayout 薄包装 - 新增 /admin/usage 用量统计页(全局请求明细, 按模型过滤+分页) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
a8e2cd214c
commit
512e46664c
5 files changed
+159
-77
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
|
||||
const ShellLayout = () => import('@/components/layout/ShellLayout.vue')
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
@@ -9,18 +11,19 @@ export const router = createRouter({
|
||||
{ path: '/register', name: 'register', component: () => import('@/views/RegisterView.vue'), meta: { guest: true } },
|
||||
{
|
||||
path: '/console',
|
||||
component: () => import('@/views/console/ConsoleLayout.vue'),
|
||||
component: ShellLayout,
|
||||
meta: { auth: true },
|
||||
children: [
|
||||
{ path: '', redirect: '/console/dashboard' },
|
||||
{ path: 'dashboard', name: 'dashboard', component: () => import('@/views/console/DashboardView.vue') },
|
||||
{ path: 'keys', name: 'keys', component: () => import('@/views/console/KeysView.vue') },
|
||||
{ path: 'usage', name: 'usage', component: () => import('@/views/console/UsageView.vue') },
|
||||
{ path: 'settings', name: 'settings', component: () => import('@/views/console/SettingsView.vue') },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/admin',
|
||||
component: () => import('@/views/admin/AdminLayout.vue'),
|
||||
component: ShellLayout,
|
||||
meta: { auth: true, admin: true },
|
||||
children: [
|
||||
{ path: '', redirect: '/admin/overview' },
|
||||
@@ -28,6 +31,7 @@ export const router = createRouter({
|
||||
{ path: 'channels', name: 'admin-channels', component: () => import('@/views/admin/ChannelsView.vue') },
|
||||
{ path: 'models', name: 'admin-models', component: () => import('@/views/admin/ModelsView.vue') },
|
||||
{ path: 'users', name: 'admin-users', component: () => import('@/views/admin/UsersView.vue') },
|
||||
{ path: 'usage', name: 'admin-usage', component: () => import('@/views/admin/UsageView.vue') },
|
||||
{ path: 'config', name: 'admin-config', component: () => import('@/views/admin/ConfigView.vue') },
|
||||
],
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user