From 343fc2216827934fed85bfeb076c1d56c5d3b397 Mon Sep 17 00:00:00 2001 From: IGCrystal Date: Wed, 18 Jun 2025 17:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E4=BF=AE=E6=94=B9chat?= =?UTF-8?q?=E4=B8=AD=E5=BD=95=E9=9F=B3=E7=9A=84=E9=94=AE=E4=BD=8D=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E8=AF=AF=E8=A7=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改键位为Ctrl + A ,以及还加入SSE断连提示 --- .../src/i18n/locales/en-US/features/chat.json | 18 ++- .../src/i18n/locales/zh-CN/features/chat.json | 18 ++- dashboard/src/views/ChatPage.vue | 113 +++++++++++++----- 3 files changed, 115 insertions(+), 34 deletions(-) diff --git a/dashboard/src/i18n/locales/en-US/features/chat.json b/dashboard/src/i18n/locales/en-US/features/chat.json index 4b2ead587..faacf7ffe 100644 --- a/dashboard/src/i18n/locales/en-US/features/chat.json +++ b/dashboard/src/i18n/locales/en-US/features/chat.json @@ -52,10 +52,24 @@ "modes": { "darkMode": "Switch to Dark Mode", "lightMode": "Switch to Light Mode" - }, - "shortcuts": { + }, "shortcuts": { "help": "Get Help", "voiceRecord": "Record Voice", "pasteImage": "Paste Image" + }, + "connection": { + "title": "Connection Status Notice", + "message": "The system detected that the chat connection needs to be re-established.", + "reasons": "This may be due to:", + "reasonWindowResize": "Switching chat window size (normal behavior)", + "reasonMultipleTabs": "Opening chat pages in other tabs", + "reasonNetworkIssue": "Temporary network interruption", + "notice": "Note: To ensure proper message delivery, the system only allows one active chat connection at a time. If you're using chat in multiple tabs, please keep only one page open.", + "understand": "Got it", + "status": { + "reconnecting": "Reconnecting...", + "reconnected": "Chat connection re-established", + "failed": "Connection failed, please refresh the page" + } } } \ No newline at end of file diff --git a/dashboard/src/i18n/locales/zh-CN/features/chat.json b/dashboard/src/i18n/locales/zh-CN/features/chat.json index ee5909af1..5bd7bbcac 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/chat.json +++ b/dashboard/src/i18n/locales/zh-CN/features/chat.json @@ -52,10 +52,24 @@ "modes": { "darkMode": "切换到夜间模式", "lightMode": "切换到日间模式" - }, - "shortcuts": { + }, "shortcuts": { "help": "获取帮助", "voiceRecord": "录制语音", "pasteImage": "粘贴图片" + }, + "connection": { + "title": "连接状态提醒", + "message": "系统检测到聊天连接需要重新建立。", + "reasons": "这可能是因为:", + "reasonWindowResize": "切换了聊天窗口大小(正常现象)", + "reasonMultipleTabs": "在其他标签页中打开了聊天页面", + "reasonNetworkIssue": "网络连接临时中断", + "notice": "注意:为了确保消息正确接收,系统只允许同时保持一个聊天连接。如果您在多个标签页中使用聊天功能,建议只保留一个页面。", + "understand": "我知道了", + "status": { + "reconnecting": "正在重新连接...", + "reconnected": "聊天连接已重新建立", + "failed": "连接失败,请刷新页面重试" + } } } \ No newline at end of file diff --git a/dashboard/src/views/ChatPage.vue b/dashboard/src/views/ChatPage.vue index fbbc2733c..d2b963645 100644 --- a/dashboard/src/views/ChatPage.vue +++ b/dashboard/src/views/ChatPage.vue @@ -161,7 +161,7 @@
{{ t('core.common.longPress') }} - Ctrl + Ctrl + A {{ tm('shortcuts.voiceRecord') }} 🎤
@@ -265,9 +265,7 @@
- - - + {{ tm('actions.editTitle') }} @@ -281,7 +279,49 @@ {{ t('core.common.save') }} + + + + + mdi-information-outline + {{ tm('connection.title') }} + + +
+ {{ tm('connection.message') }} +
+
+ {{ tm('connection.reasons') }} +
    +
  • {{ tm('connection.reasonWindowResize') }}
  • +
  • {{ tm('connection.reasonMultipleTabs') }}
  • +
  • {{ tm('connection.reasonNetworkIssue') }}
  • +
+
+
+ {{ tm('connection.notice') }} +
+
+ + + {{ tm('connection.understand') }} + +
+ + + + + {{ connectionStatusColor === 'success' ? 'mdi-check-circle' : + connectionStatusColor === 'warning' ? 'mdi-alert-circle' : 'mdi-information' }} + + {{ connectionStatusMessage }} +