From 52fe92ed7fdafa170ab39e9eea03d99c387ad505 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Mon, 14 Jul 2025 13:12:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Ensure=20channel=20toolti?= =?UTF-8?q?p=20displays=20correctly=20in=20`LogsTable`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactored the render logic of the **Channel** column * Wrapped tooltip around the first `Tag` only to restore hover behavior when multi-key mode is enabled * Added i18n-friendly fallback (`t('未知渠道')`) for cases where `channel_name` is missing * Improves user experience for administrators by reliably showing channel names even with multiple keys --- web/src/components/table/LogsTable.js | 49 ++++++++++----------------- web/src/i18n/locales/en.json | 3 +- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/web/src/components/table/LogsTable.js b/web/src/components/table/LogsTable.js index 72f606dd..964dac23 100644 --- a/web/src/components/table/LogsTable.js +++ b/web/src/components/table/LogsTable.js @@ -367,38 +367,23 @@ const LogsTable = () => { } } - return isAdminUser ? ( - record.type === 0 || record.type === 2 || record.type === 5 ? ( - <> - { - - - - {text} - - { - isMultiKey && ( - - {multiKeyIndex} - - ) - } - - - } - - ) : ( - <> - ) - ) : ( - <> - ); + return isAdminUser && (record.type === 0 || record.type === 2 || record.type === 5) ? ( + + + + {text} + + + {isMultiKey && ( + + {multiKeyIndex} + + )} + + ) : null; }, }, { diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index 40864582..66295f34 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -1773,5 +1773,6 @@ "请上传密钥文件": "Please upload the key file", "请填写部署地区": "Please fill in the deployment region", "请输入部署地区,例如:us-central1\n支持使用模型映射格式\n{\n \"default\": \"us-central1\",\n \"claude-3-5-sonnet-20240620\": \"europe-west1\"\n}": "Please enter the deployment region, for example: us-central1\nSupports using model mapping format\n{\n \"default\": \"us-central1\",\n \"claude-3-5-sonnet-20240620\": \"europe-west1\"\n}", - "其他": "Other" + "其他": "Other", + "未知渠道": "Unknown channel" } \ No newline at end of file