feat(chat-console): surface Sessions admin via header menu (#183)

This commit is contained in:
matevip 2026-05-20 20:57:58 +08:00
parent 82540a5fcb
commit fe62a98c8f
4 changed files with 14 additions and 1 deletions

View File

@ -181,6 +181,7 @@ export default {
startNewChat: 'Start a new chat above',
messages: '{count} messages',
configModel: 'Configure Model',
openSessions: 'Session Admin',
clearMessages: 'Clear Messages',
goToModelSettings: 'Go to Model Settings',
configModelFirst: 'Please configure a model first',

View File

@ -181,6 +181,7 @@ export default {
startNewChat: '开始新对话吧',
messages: '{count} 条消息',
configModel: '配置模型',
openSessions: '会话管理',
clearMessages: '清空消息',
goToModelSettings: '前往模型设置',
configModelFirst: '请先配置模型',

View File

@ -274,8 +274,17 @@ const router = createRouter({
component: () => import('@/views/Forbidden.vue'),
meta: { title: 'Forbidden' },
},
// ==================== Sessions admin ====================
// Cross-channel conversation manager. Surfaced from ChatConsole's
// header overflow menu so the user can audit / switch model per
// conversation without leaving the chat surface.
{
path: 'sessions',
name: 'Sessions',
component: () => import('@/views/Sessions.vue'),
meta: { title: 'sessions.title' },
},
// ==================== Redirects (backward compatibility) ====================
{ path: 'sessions', redirect: '/chat' },
{ path: 'workspace', redirect: '/settings/agent-context' },
{ path: 'security/workspaces', redirect: '/settings/workspaces' },
{ path: 'security/members', redirect: '/settings/members' },

View File

@ -366,12 +366,14 @@ const headerBtnRef = ref<HTMLElement | null>(null)
const headerMenuItems = computed<DropdownMenuItem[]>(() => [
{ key: 'config', label: t('chat.configModel') },
{ key: 'sessions', label: t('chat.openSessions') },
{ divider: true },
{ key: 'clear', label: t('chat.clearMessages'), danger: true },
])
function onHeaderMenuSelect(item: DropdownMenuItem) {
if (item.key === 'config') goToModelSettings()
else if (item.key === 'sessions') router.push('/sessions')
else if (item.key === 'clear') clearMessages()
}