balibabu
commited on
Commit
·
dfddc2c
1
Parent(s):
70aabba
feat: Limit the maximum value of auto keywords to 30 #2687 (#2991)
Browse files### What problem does this PR solve?
feat: Limit the maximum value of auto keywords to 30 #2687
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/components/auto-keywords-item.tsx
CHANGED
|
@@ -1,21 +1,29 @@
|
|
| 1 |
import { useTranslate } from '@/hooks/common-hooks';
|
| 2 |
-
import { Form, InputNumber } from 'antd';
|
| 3 |
-
|
| 4 |
-
const style = {
|
| 5 |
-
width: '100%',
|
| 6 |
-
};
|
| 7 |
|
| 8 |
export const AutoKeywordsItem = () => {
|
| 9 |
const { t } = useTranslate('knowledgeDetails');
|
| 10 |
|
| 11 |
return (
|
| 12 |
-
<Form.Item
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</Form.Item>
|
| 20 |
);
|
| 21 |
};
|
|
@@ -24,13 +32,25 @@ export const AutoQuestionsItem = () => {
|
|
| 24 |
const { t } = useTranslate('knowledgeDetails');
|
| 25 |
|
| 26 |
return (
|
| 27 |
-
<Form.Item
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
</Form.Item>
|
| 35 |
);
|
| 36 |
};
|
|
|
|
| 1 |
import { useTranslate } from '@/hooks/common-hooks';
|
| 2 |
+
import { Flex, Form, InputNumber, Slider } from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
export const AutoKeywordsItem = () => {
|
| 5 |
const { t } = useTranslate('knowledgeDetails');
|
| 6 |
|
| 7 |
return (
|
| 8 |
+
<Form.Item label={t('autoKeywords')} tooltip={t('autoKeywordsTip')}>
|
| 9 |
+
<Flex gap={20} align="center">
|
| 10 |
+
<Flex flex={1}>
|
| 11 |
+
<Form.Item
|
| 12 |
+
name={['parser_config', 'auto_keywords']}
|
| 13 |
+
noStyle
|
| 14 |
+
initialValue={0}
|
| 15 |
+
>
|
| 16 |
+
<Slider max={30} style={{ width: '100%' }} />
|
| 17 |
+
</Form.Item>
|
| 18 |
+
</Flex>
|
| 19 |
+
<Form.Item
|
| 20 |
+
name={['parser_config', 'auto_keywords']}
|
| 21 |
+
noStyle
|
| 22 |
+
initialValue={0}
|
| 23 |
+
>
|
| 24 |
+
<InputNumber max={30} min={0} />
|
| 25 |
+
</Form.Item>
|
| 26 |
+
</Flex>
|
| 27 |
</Form.Item>
|
| 28 |
);
|
| 29 |
};
|
|
|
|
| 32 |
const { t } = useTranslate('knowledgeDetails');
|
| 33 |
|
| 34 |
return (
|
| 35 |
+
<Form.Item label={t('autoQuestions')} tooltip={t('autoQuestionsTip')}>
|
| 36 |
+
<Flex gap={20} align="center">
|
| 37 |
+
<Flex flex={1}>
|
| 38 |
+
<Form.Item
|
| 39 |
+
name={['parser_config', 'auto_questions']}
|
| 40 |
+
noStyle
|
| 41 |
+
initialValue={0}
|
| 42 |
+
>
|
| 43 |
+
<Slider max={10} style={{ width: '100%' }} />
|
| 44 |
+
</Form.Item>
|
| 45 |
+
</Flex>
|
| 46 |
+
<Form.Item
|
| 47 |
+
name={['parser_config', 'auto_questions']}
|
| 48 |
+
noStyle
|
| 49 |
+
initialValue={0}
|
| 50 |
+
>
|
| 51 |
+
<InputNumber max={10} min={0} />
|
| 52 |
+
</Form.Item>
|
| 53 |
+
</Flex>
|
| 54 |
</Form.Item>
|
| 55 |
);
|
| 56 |
};
|