mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-03 09:05:07 +08:00
Fix: Creating Knowledge Base Support Enter Key (#7258)
### What problem does this PR solve? [https://github.com/infiniflow/ragflow/issues/7180](https://github.com/infiniflow/ragflow/issues/7180) When creating a knowledge base, support the enter key ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -41,6 +41,12 @@ const YiyanModal = ({
|
||||
onOk?.(data);
|
||||
};
|
||||
|
||||
const handleKeyDown = async (e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Enter') {
|
||||
await handleOk();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t('addLlmTitle', { name: llmFactory })}
|
||||
@ -74,21 +80,24 @@ const YiyanModal = ({
|
||||
name="llm_name"
|
||||
rules={[{ required: true, message: t('yiyanModelNameMessage') }]}
|
||||
>
|
||||
<Input placeholder={t('yiyanModelNameMessage')} />
|
||||
<Input
|
||||
placeholder={t('yiyanModelNameMessage')}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item<FieldType>
|
||||
label={t('addyiyanAK')}
|
||||
name="yiyan_ak"
|
||||
rules={[{ required: true, message: t('yiyanAKMessage') }]}
|
||||
>
|
||||
<Input placeholder={t('yiyanAKMessage')} />
|
||||
<Input placeholder={t('yiyanAKMessage')} onKeyDown={handleKeyDown} />
|
||||
</Form.Item>
|
||||
<Form.Item<FieldType>
|
||||
label={t('addyiyanSK')}
|
||||
name="yiyan_sk"
|
||||
rules={[{ required: true, message: t('yiyanSKMessage') }]}
|
||||
>
|
||||
<Input placeholder={t('yiyanSKMessage')} />
|
||||
<Input placeholder={t('yiyanSKMessage')} onKeyDown={handleKeyDown} />
|
||||
</Form.Item>
|
||||
<Form.Item<FieldType>
|
||||
label={t('maxTokens')}
|
||||
|
||||
Reference in New Issue
Block a user