diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 6f3db55e1127388dc6b636572e919a1376960139..87d0402f6c1bd21501e4a684267850470171b21b 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -1358,6 +1358,25 @@ export default { no_todo_message: 'No to-do messages', empty_message: 'No {type} messages' }, + // User Info related + userInfo: { + admin: 'Administrator', + regular_user: 'Regular User', + preferences_settings: 'Preferences Settings', + auto_execute_enabled: 'Enabled', + auto_execute_disabled: 'Disabled', + chain_of_thought_enabled: 'Enabled', + chain_of_thought_disabled: 'Disabled', + reasoning_model: 'Reasoning Model', + embedding_model: 'Embedding Model', + reranker_model: 'Reranker Model', + default_model: 'Default', + not_logged_in: 'Not Logged In', + login_prompt: 'Please log in to use full features', + login_button: 'Log In', + user_avatar: 'User Avatar', + message_notification: 'Message' + }, // Debug Variable Panel related debugVariablePanel: { variable_config: 'Variable Configuration', diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index fcdaa7b9fc811452e4dba334935647910b3eba7e..378d4de376b1853dff89130397dacc3aea773b06 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -1388,6 +1388,25 @@ export default { no_todo_message: '暂无待办消息', empty_message: '暂无{type}消息' }, + // 用户信息相关 + userInfo: { + admin: '管理员', + regular_user: '普通用户', + preferences_settings: '偏好设置', + auto_execute_enabled: '已开启', + auto_execute_disabled: '已关闭', + chain_of_thought_enabled: '已开启', + chain_of_thought_disabled: '已关闭', + reasoning_model: '推理模型', + embedding_model: '嵌入模型', + reranker_model: '重排序模型', + default_model: '默认', + not_logged_in: '未登录', + login_prompt: '请登录以使用完整功能', + login_button: '登录', + user_avatar: '用户头像', + message_notification: '消息' + }, // 调试变量面板相关 debugVariablePanel: { variable_config: '变量配置', diff --git a/src/views/dialogue/components/TitleBar.vue b/src/views/dialogue/components/TitleBar.vue index b0667fd27ae0758fd5c6a0feeb8a783ecc9e4990..e82f2650f8f430bf195e35fb4a80c3b4d10ec060 100644 --- a/src/views/dialogue/components/TitleBar.vue +++ b/src/views/dialogue/components/TitleBar.vue @@ -82,6 +82,25 @@ const logoutHandler = () => { totalMessageCount.value = 0; }; +// 处理用户信息区域点击 +const handleUserInfoClick = async () => { + const store = useAccountStore(); + const authUrl = await store.getAuthUrl('authenticated'); + if (authUrl) { + const w = 1000; + const h = 750; + const left = (screen.width - w) / 2; + const top = (screen.height - h) / 2; + + // 直接使用后端返回的URL,它已经是完整的authelia用户配置页面URL + window.open( + authUrl, + 'userProfileWindow', + `width=${w},height=${h},resizable=yes,scrollbars=yes,top=${top},left=${left}`, + ); + } +}; + const handleLogin = async () => { // 复用现有的登录逻辑 const store = useAccountStore(); @@ -241,7 +260,7 @@ const headerStyles = computed(() => { :size="24" :class="['bell-icon', { 'bell-icon--active': messageIconActive }]" > - 消息 + (() => { :size="24" :class="['bell-icon', { 'bell-icon--active': messageIconActive }]" > - 消息 + @@ -289,17 +308,17 @@ const headerStyles = computed(() => { @@ -587,6 +606,18 @@ const headerStyles = computed(() => { display: flex; align-items: center; gap: 12px; + cursor: pointer; + padding: 8px; + border-radius: 6px; + transition: background-color 0.2s ease-in-out; + + &:hover { + background-color: var(--o-fill-color-light); + } + + &:active { + background-color: var(--o-fill-color-extra-light); + } .user-avatar { flex-shrink: 0;