Feat: Supports page rank score for different knowledge bases. #3794 (#3800)

### What problem does this PR solve?

Feat: Supports page rank score for different knowledge bases. #3794

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-12-02 19:00:11 +08:00
committed by GitHub
parent 69fb323581
commit 8b650fc9ef
6 changed files with 46 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import { Form, FormInstance, Input, InputRef, Typography } from 'antd';
import React, { useContext, useEffect, useRef, useState } from 'react';
const EditableContext = React.createContext<FormInstance<any> | null>(null);
const { Paragraph, Text } = Typography;
const { Text } = Typography;
interface EditableRowProps {
index: number;
@ -95,9 +95,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({
// style={{ paddingRight: 24 }}
onClick={toggleEdit}
>
<Text ellipsis={{ tooltip: children }} style={{ width: 70 }}>
{children}
</Text>
<Text>{children}</Text>
</div>
);
}

View File

@ -0,0 +1,33 @@
import { useTranslate } from '@/hooks/common-hooks';
import { Flex, Form, InputNumber, Slider } from 'antd';
const PageRank = () => {
const { t } = useTranslate('knowledgeConfiguration');
return (
<Form.Item label={t('pageRank')} tooltip={t('pageRankTip')}>
<Flex gap={20} align="center">
<Flex flex={1}>
<Form.Item
name={['parser_config', 'pagerank']}
noStyle
initialValue={0}
rules={[{ required: true }]}
>
<Slider max={100} style={{ width: '100%' }} />
</Form.Item>
</Flex>
<Form.Item
name={['parser_config', 'pagerank']}
noStyle
initialValue={0}
rules={[{ required: true }]}
>
<InputNumber max={100} min={0} />
</Form.Item>
</Flex>
</Form.Item>
);
};
export default PageRank;