From a8a42cbfa8eb51ef9ecf9b02b53369e65291c8dd Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sat, 26 Jul 2025 17:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style(ui):=20show=20"Force=20For?= =?UTF-8?q?mat"=20toggle=20only=20for=20OpenAI=20channels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the "Force Format" switch was displayed for every channel type although it only applies to OpenAI (type === 1). This change wraps the switch in a conditional so it renders exclusively when the selected channel type is OpenAI. Why: - Prevents user confusion when configuring non-OpenAI channels - Keeps the UI clean and context-relevant Scope: - web/src/components/table/channels/modals/EditChannelModal.jsx No backend logic affected. --- .../table/channels/modals/EditChannelModal.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/web/src/components/table/channels/modals/EditChannelModal.jsx b/web/src/components/table/channels/modals/EditChannelModal.jsx index a4c8ea76..248307c4 100644 --- a/web/src/components/table/channels/modals/EditChannelModal.jsx +++ b/web/src/components/table/channels/modals/EditChannelModal.jsx @@ -1592,14 +1592,16 @@ const EditChannelModal = (props) => { - handleChannelSettingsChange('force_format', value)} - extraText={t('强制将响应格式化为 OpenAI 标准格式(只适用于OpenAI渠道类型)')} - /> + {inputs.type === 1 && ( + handleChannelSettingsChange('force_format', value)} + extraText={t('强制将响应格式化为 OpenAI 标准格式(只适用于OpenAI渠道类型)')} + /> + )}