From 3d22e050f34fa305f85781f12aabf552cb21be63 Mon Sep 17 00:00:00 2001 From: sophie <16087569+sophie_liang@user.noreply.gitee.com> Date: Fri, 10 Apr 2026 09:34:33 +0800 Subject: [PATCH 01/32] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/i18n.ts | 76 ++++++++++++++++++++++++++++++-- frontend/src/views/AdminView.vue | 44 +++++++++--------- 2 files changed, 94 insertions(+), 26 deletions(-) diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 81f8cc79..96cbdcb2 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -315,7 +315,24 @@ const messages = { descPlaceholder: 'Briefly describe what this agent does...' }, confirmDelete: 'Are you sure you want to delete this agent?', - manageAccess: 'Manage Access' + manageAccess: 'Manage Access', + test: 'Test', + delete: 'Delete Agent', + idLabel: 'ID', + urlLabel: 'URL', + testModalTitle: 'Agent Test', + testModalAgent: 'Agent', + testedAt: 'Test Time', + testing: 'Testing...', + retest: 'Retest', + testingInProgress: 'Running test, please wait...', + requestUrl: 'Request URL', + outputInfo: 'Output Information', + analysis: 'Final Analysis', + testDone: 'Test completed.', + testFailed: 'Test failed.', + testFailedRequestException: 'Test failed: request exception occurred.', + networkError: 'Network error' }, // Common Questions @@ -983,7 +1000,24 @@ const messages = { descPlaceholder: '简要描述该应用的功能...' }, confirmDelete: '确定要删除该应用吗?', - manageAccess: '管理权限' + manageAccess: '管理权限', + test: '测试', + delete: '删除应用', + idLabel: 'ID', + urlLabel: '链接', + testModalTitle: '应用测试', + testModalAgent: '应用', + testedAt: '测试时间', + testing: '测试中...', + retest: '重新测试', + testingInProgress: '正在执行测试,请稍候...', + requestUrl: '请求地址', + outputInfo: '输出信息', + analysis: '最终结果分析', + testDone: '测试已完成。', + testFailed: '测试失败。', + testFailedRequestException: '测试失败:请求过程出现异常。', + networkError: '网络错误' }, // Common Questions @@ -1624,7 +1658,24 @@ const messages = { descPlaceholder: '簡要描述該應用的功能...' }, confirmDelete: '確定要刪除該應用嗎?', - manageAccess: '管理權限' + manageAccess: '管理權限', + test: '測試', + delete: '刪除應用', + idLabel: 'ID', + urlLabel: '連結', + testModalTitle: '應用測試', + testModalAgent: '應用', + testedAt: '測試時間', + testing: '測試中...', + retest: '重新測試', + testingInProgress: '正在執行測試,請稍候...', + requestUrl: '請求位址', + outputInfo: '輸出資訊', + analysis: '最終結果分析', + testDone: '測試已完成。', + testFailed: '測試失敗。', + testFailedRequestException: '測試失敗:請求過程發生異常。', + networkError: '網路錯誤' }, // Common Questions @@ -2265,7 +2316,24 @@ const messages = { descPlaceholder: 'อธิบายสั้นๆ เกี่ยวกับตัวแทนนี้...' }, confirmDelete: 'คุณแน่ใจหรือไม่ว่าต้องการลบตัวแทนนี้?', - manageAccess: 'จัดการสิทธิ์' + manageAccess: 'จัดการสิทธิ์', + test: 'ทดสอบ', + delete: 'ลบแอป', + idLabel: 'ID', + urlLabel: 'ลิงก์', + testModalTitle: 'ทดสอบแอป', + testModalAgent: 'แอป', + testedAt: 'เวลาทดสอบ', + testing: 'กำลังทดสอบ...', + retest: 'ทดสอบอีกครั้ง', + testingInProgress: 'กำลังดำเนินการทดสอบ โปรดรอสักครู่...', + requestUrl: 'ที่อยู่คำขอ', + outputInfo: 'ข้อมูลเอาต์พุต', + analysis: 'วิเคราะห์ผลลัพธ์สุดท้าย', + testDone: 'ทดสอบเสร็จสิ้น', + testFailed: 'ทดสอบล้มเหลว', + testFailedRequestException: 'ทดสอบล้มเหลว: เกิดข้อผิดพลาดระหว่างการร้องขอ', + networkError: 'เครือข่ายผิดพลาด' }, // Common Questions diff --git a/frontend/src/views/AdminView.vue b/frontend/src/views/AdminView.vue index 0113dded..c52db531 100644 --- a/frontend/src/views/AdminView.vue +++ b/frontend/src/views/AdminView.vue @@ -1115,7 +1115,7 @@ const runAgentTest = async (agent?: AgentRow) => { success: !!data.success, request_url: data.request_url || '', output_info: data.output_info || '', - analysis: data.analysis || (res.ok ? '测试已完成。' : '测试失败。'), + analysis: data.analysis || (res.ok ? t('admin.agent.testDone') : t('admin.agent.testFailed')), http_status: data.http_status, tested_at: data.tested_at }; @@ -1136,8 +1136,8 @@ const runAgentTest = async (agent?: AgentRow) => { agentTestResult.value = { success: false, request_url: '', - output_info: e?.message || 'Network error', - analysis: '测试失败:请求过程出现异常。', + output_info: e?.message || t('admin.agent.networkError'), + analysis: t('admin.agent.testFailedRequestException'), http_status: 0 }; } finally { @@ -2557,10 +2557,10 @@ const handlePermissionImport = async (event: Event) => { - ID: {{ agent.dify_app_id }} + {{ t('admin.agent.idLabel') }}: {{ agent.dify_app_id }} - URL: {{ agent.extra_config?.iframe_url }} + {{ t('admin.agent.urlLabel') }}: {{ agent.extra_config?.iframe_url }} @@ -2576,21 +2576,21 @@ const handlePermissionImport = async (event: Event) => { @@ -2914,20 +2914,20 @@ const handlePermissionImport = async (event: Event) => {

{{ t('admin.wecom.auditTitle') }}

-
- -
@@ -3469,32 +3469,32 @@ const handlePermissionImport = async (event: Event) => {
- 测试时间:{{ agentTestResult.tested_at }} + {{ t('admin.agent.testedAt') }}:{{ agentTestResult.tested_at }}
-
正在执行测试,请稍候...
+
{{ t('admin.agent.testingInProgress') }}
diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 34ed3309..b83d7262 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -78,6 +78,12 @@ const messages = { }, workspace: { title: 'AI Workspace', + brandTitle: 'Hexin AI Workspace', + languageLabel: 'Language', + languageOptionEn: 'English', + languageOptionZhCN: 'Chinese (Simplified)', + languageOptionZhTW: 'Chinese (Traditional)', + languageOptionTh: 'Thai', userTitle: '{username}\'s AI Workspace', subtitle: 'Choose an agent or click a quick question to start', search: 'Search agents...', @@ -762,6 +768,12 @@ const messages = { }, workspace: { title: 'AI 工作台', + brandTitle: '和信AI工作台', + languageLabel: '语言', + languageOptionEn: '英文', + languageOptionZhCN: '简体中文', + languageOptionZhTW: '繁體中文', + languageOptionTh: '泰语', userTitle: '{username} 的 AI 工作台', subtitle: '选择一个助手,或点击常用问题快速开始', search: '搜索应用...', @@ -1425,6 +1437,12 @@ const messages = { }, workspace: { title: 'AI 工作台', + brandTitle: '和信AI工作台', + languageLabel: '語言', + languageOptionEn: '英文', + languageOptionZhCN: '簡體中文', + languageOptionZhTW: '繁體中文', + languageOptionTh: '泰語', userTitle: '{username} 的 AI 工作台', subtitle: '選擇一個助手,或點擊常用問題快速開始', search: '搜索應用...', @@ -2088,6 +2106,12 @@ const messages = { }, workspace: { title: 'พื้นที่ทำงาน AI', + brandTitle: 'Hexin AI Workspace', + languageLabel: 'ภาษา', + languageOptionEn: 'อังกฤษ', + languageOptionZhCN: 'จีน (ตัวย่อ)', + languageOptionZhTW: 'จีน (ตัวเต็ม)', + languageOptionTh: 'ไทย', userTitle: 'พื้นที่ทำงาน AI ของ {username}', subtitle: 'เลือกผู้ช่วยหรือคลิกคำถามด่วนเพื่อเริ่ม', search: 'ค้นหาตัวแทน...', diff --git a/frontend/src/style.css b/frontend/src/style.css index f4ebedef..2afbb14f 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -101,6 +101,27 @@ @apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300; } + /* Mobile-first layout tokens for consistent spacing and density. */ + .page-shell-mobile { + @apply px-3 md:px-8; + } + + .section-gap-mobile { + @apply mb-3 md:mb-8; + } + + .card-mobile-compact { + @apply p-3 sm:p-5; + } + + .icon-box-mobile { + @apply w-8 h-8 sm:w-10 sm:h-10; + } + + .icon-glyph-mobile { + @apply w-4 h-4 sm:w-6 sm:h-6; + } + .badge { @apply px-2.5 py-0.5 rounded-full text-xs font-medium border; } diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index baa273dc..a5d83f0c 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -65,14 +65,14 @@ interface SourceFileLink { } // 源文件展示配置(来自 config.ts) -const sourceFileConfig = { - // 是否显示整个“源文件”区域 - showSourceFiles: config.workspace?.sourceFiles?.showSourceFiles !== false, - // 是否显示 MD 源文件(.md/.markdown) - showMdFiles: config.workspace?.sourceFiles?.showMdFiles !== false, - // MD 源文件是否默认展开“源文档”详情 - expandMdByDefault: config.workspace?.sourceFiles?.expandMdByDefault === true, -}; +// const sourceFileConfig = { +// // 是否显示整个“源文件”区域 +// showSourceFiles: config.workspace?.sourceFiles?.showSourceFiles !== false, +// // 是否显示 MD 源文件(.md/.markdown) +// showMdFiles: config.workspace?.sourceFiles?.showMdFiles !== false, +// // MD 源文件是否默认展开“源文档”详情 +// expandMdByDefault: config.workspace?.sourceFiles?.expandMdByDefault === true, +// }; const PREFERRED_SOURCE_EXTS = new Set([ 'pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'csv', @@ -232,7 +232,7 @@ const getSourceLinks = (resources: any[] = []): SourceFileLink[] => { // Skip links whose display name itself is noisy. if (isNoisySourceName(name)) continue; // 根据配置决定是否显示 MD 文件 - if (!sourceFileConfig.showMdFiles && (isMarkdownFileName(name) || isMarkdownByUrl(url))) continue; + if ( (isMarkdownFileName(name) || isMarkdownByUrl(url))) continue; const key = `${name}|${url}`; if (!map.has(key)) { map.set(key, { name, url }); @@ -245,7 +245,10 @@ const getSourceLinks = (resources: any[] = []): SourceFileLink[] => { }; const getMessageLinks = (msg: any): SourceFileLink[] => { - if (!sourceFileConfig.showSourceFiles) return []; + // if (!sourceFileConfig.showSourceFiles) { + // console.info('showSourceFiles is false'); + // return []; + // } const map = new Map(); const merge = (links: SourceFileLink[]) => { @@ -253,7 +256,7 @@ const getMessageLinks = (msg: any): SourceFileLink[] => { if (isChunkLikeLink(link.url)) continue; // 文件名有效时,保留文件按钮(即便 URL 是临时签名地址)。 if (isNoisySourceName(link.name)) continue; - if (!sourceFileConfig.showMdFiles && (isMarkdownFileName(link.name) || isMarkdownByUrl(link.url))) continue; + if ( (isMarkdownFileName(link.name) || isMarkdownByUrl(link.url))) continue; if (isMarkdownFileName(link.name)) { const key = `${link.name}|${link.url}`; if (!map.has(key)) map.set(key, link); @@ -277,9 +280,9 @@ const getMessageLinks = (msg: any): SourceFileLink[] => { }; const getDisplayRetrieverResources = (msg: any): any[] => { - if (!sourceFileConfig.showSourceFiles) return []; + // if (!sourceFileConfig.showSourceFiles) return []; const list = Array.isArray(msg?.retriever_resources) ? msg.retriever_resources : []; - if (sourceFileConfig.showMdFiles) return list; + // if (sourceFileConfig.showMdFiles) return list; return list.filter((doc: any) => { const name = doc?.source_filename || doc?.document_name || doc?.title || ''; const url = doc?.source_download_url || doc?.url || doc?.file_url || doc?.document_url || ''; @@ -288,8 +291,12 @@ const getDisplayRetrieverResources = (msg: any): any[] => { }; const shouldExpandSourceDetails = (msg: any): boolean => { - if (!sourceFileConfig.showSourceFiles) return false; - if (!sourceFileConfig.showMdFiles || !sourceFileConfig.expandMdByDefault) return false; + // if (!sourceFileConfig.showSourceFiles) { + // console.info('showSourceFiles is false'); + // return false; + // } + + // if (!sourceFileConfig.showMdFiles || !sourceFileConfig.expandMdByDefault) return false; return getMessageLinks(msg).some((link) => isMarkdownFileName(link.name) || isMarkdownByUrl(link.url)); }; @@ -521,10 +528,10 @@ const submitFeedback = async () => { >
@@ -584,7 +589,7 @@ const submitFeedback = async () => {
- @@ -606,15 +611,15 @@ const submitFeedback = async () => {