mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-15 03:55:09 +08:00
feat(chat-console): surface Sessions admin via header menu (#183)
This commit is contained in:
parent
82540a5fcb
commit
fe62a98c8f
@ -181,6 +181,7 @@ export default {
|
|||||||
startNewChat: 'Start a new chat above',
|
startNewChat: 'Start a new chat above',
|
||||||
messages: '{count} messages',
|
messages: '{count} messages',
|
||||||
configModel: 'Configure Model',
|
configModel: 'Configure Model',
|
||||||
|
openSessions: 'Session Admin',
|
||||||
clearMessages: 'Clear Messages',
|
clearMessages: 'Clear Messages',
|
||||||
goToModelSettings: 'Go to Model Settings',
|
goToModelSettings: 'Go to Model Settings',
|
||||||
configModelFirst: 'Please configure a model first',
|
configModelFirst: 'Please configure a model first',
|
||||||
|
|||||||
@ -181,6 +181,7 @@ export default {
|
|||||||
startNewChat: '开始新对话吧',
|
startNewChat: '开始新对话吧',
|
||||||
messages: '{count} 条消息',
|
messages: '{count} 条消息',
|
||||||
configModel: '配置模型',
|
configModel: '配置模型',
|
||||||
|
openSessions: '会话管理',
|
||||||
clearMessages: '清空消息',
|
clearMessages: '清空消息',
|
||||||
goToModelSettings: '前往模型设置',
|
goToModelSettings: '前往模型设置',
|
||||||
configModelFirst: '请先配置模型',
|
configModelFirst: '请先配置模型',
|
||||||
|
|||||||
@ -274,8 +274,17 @@ const router = createRouter({
|
|||||||
component: () => import('@/views/Forbidden.vue'),
|
component: () => import('@/views/Forbidden.vue'),
|
||||||
meta: { title: 'Forbidden' },
|
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) ====================
|
// ==================== Redirects (backward compatibility) ====================
|
||||||
{ path: 'sessions', redirect: '/chat' },
|
|
||||||
{ path: 'workspace', redirect: '/settings/agent-context' },
|
{ path: 'workspace', redirect: '/settings/agent-context' },
|
||||||
{ path: 'security/workspaces', redirect: '/settings/workspaces' },
|
{ path: 'security/workspaces', redirect: '/settings/workspaces' },
|
||||||
{ path: 'security/members', redirect: '/settings/members' },
|
{ path: 'security/members', redirect: '/settings/members' },
|
||||||
|
|||||||
@ -366,12 +366,14 @@ const headerBtnRef = ref<HTMLElement | null>(null)
|
|||||||
|
|
||||||
const headerMenuItems = computed<DropdownMenuItem[]>(() => [
|
const headerMenuItems = computed<DropdownMenuItem[]>(() => [
|
||||||
{ key: 'config', label: t('chat.configModel') },
|
{ key: 'config', label: t('chat.configModel') },
|
||||||
|
{ key: 'sessions', label: t('chat.openSessions') },
|
||||||
{ divider: true },
|
{ divider: true },
|
||||||
{ key: 'clear', label: t('chat.clearMessages'), danger: true },
|
{ key: 'clear', label: t('chat.clearMessages'), danger: true },
|
||||||
])
|
])
|
||||||
|
|
||||||
function onHeaderMenuSelect(item: DropdownMenuItem) {
|
function onHeaderMenuSelect(item: DropdownMenuItem) {
|
||||||
if (item.key === 'config') goToModelSettings()
|
if (item.key === 'config') goToModelSettings()
|
||||||
|
else if (item.key === 'sessions') router.push('/sessions')
|
||||||
else if (item.key === 'clear') clearMessages()
|
else if (item.key === 'clear') clearMessages()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user