💄 style(ui): show "Force Format" toggle only for OpenAI channels

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.
This commit is contained in:
t0ng7u
2025-07-26 17:18:47 +08:00
parent e7524c85c2
commit a8a42cbfa8

View File

@@ -1592,6 +1592,7 @@ const EditChannelModal = (props) => {
</div> </div>
</div> </div>
{inputs.type === 1 && (
<Form.Switch <Form.Switch
field='force_format' field='force_format'
label={t('强制格式化')} label={t('强制格式化')}
@@ -1600,6 +1601,7 @@ const EditChannelModal = (props) => {
onChange={(value) => handleChannelSettingsChange('force_format', value)} onChange={(value) => handleChannelSettingsChange('force_format', value)}
extraText={t('强制将响应格式化为 OpenAI 标准格式只适用于OpenAI渠道类型')} extraText={t('强制将响应格式化为 OpenAI 标准格式只适用于OpenAI渠道类型')}
/> />
)}
<Form.Switch <Form.Switch
field='thinking_to_content' field='thinking_to_content'