Procházet zdrojové kódy

💄 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.
t0ng7u před 7 měsíci
rodič
revize
a8a42cbfa8

+ 10 - 8
web/src/components/table/channels/modals/EditChannelModal.jsx

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