Add user-scoped Hermes profile access

This commit is contained in:
ekko
2026-05-23 18:44:53 +08:00
committed by ekko
parent 56e7716302
commit 3f6a25d8f1
54 changed files with 2656 additions and 592 deletions
+8 -1
View File
@@ -1,5 +1,5 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import { hasApiKey } from '@/api/client'
import { hasApiKey, isStoredSuperAdmin } from '@/api/client'
const router = createRouter({
history: createWebHashHistory(),
@@ -39,6 +39,7 @@ const router = createRouter({
path: '/hermes/profiles',
name: 'hermes.profiles',
component: () => import('@/views/hermes/ProfilesView.vue'),
meta: { requiresSuperAdmin: true },
},
{
path: '/hermes/logs',
@@ -54,6 +55,7 @@ const router = createRouter({
path: '/hermes/performance',
name: 'hermes.performance',
component: () => import('@/views/hermes/PerformanceView.vue'),
meta: { requiresSuperAdmin: true },
},
{
path: '/hermes/skills-usage',
@@ -121,6 +123,11 @@ router.beforeEach((to, _from, next) => {
return
}
if (to.meta.requiresSuperAdmin && !isStoredSuperAdmin()) {
next({ name: 'hermes.chat' })
return
}
next()
})