feat: add loading to ChatContainer and set font family to inter and add tooltip to Form.Item and download documents on the document list page (#136)
* feat: download documents on the document list page * feat: add tooltip to Form.Item * feat: set font family to inter * feat: add loading to ChatContainer
This commit is contained in:
@@ -4,7 +4,6 @@ import kbService, { getDocumentFile } from '@/services/kbService';
|
||||
import { message } from 'antd';
|
||||
import omit from 'lodash/omit';
|
||||
import pick from 'lodash/pick';
|
||||
import { Nullable } from 'typings';
|
||||
import { DvaModel } from 'umi';
|
||||
|
||||
export interface KFModelState extends BaseState {
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
import showDeleteConfirm from '@/components/deleting-confirm';
|
||||
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
||||
import { DeleteOutlined, EditOutlined, ToolOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
DeleteOutlined,
|
||||
DownloadOutlined,
|
||||
EditOutlined,
|
||||
ToolOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { Button, Dropdown, MenuProps, Space, Tooltip } from 'antd';
|
||||
import { useDispatch } from 'umi';
|
||||
import { isParserRunning } from '../utils';
|
||||
|
||||
import { api_host } from '@/utils/api';
|
||||
import { downloadFile } from '@/utils/fileUtil';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
@@ -38,6 +45,13 @@ const ParsingActionCell = ({
|
||||
}
|
||||
};
|
||||
|
||||
const onDownloadDocument = () => {
|
||||
downloadFile({
|
||||
url: `${api_host}/document/get/${documentId}`,
|
||||
filename: record.name,
|
||||
});
|
||||
};
|
||||
|
||||
const setCurrentRecord = () => {
|
||||
dispatch({
|
||||
type: 'kFModel/setCurrentRecord',
|
||||
@@ -110,6 +124,14 @@ const ParsingActionCell = ({
|
||||
>
|
||||
<DeleteOutlined size={20} />
|
||||
</Button>
|
||||
<Button
|
||||
type="text"
|
||||
disabled={isRunning}
|
||||
onClick={onDownloadDocument}
|
||||
className={styles.iconButton}
|
||||
>
|
||||
<DownloadOutlined size={20} />
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -91,6 +91,7 @@ const Configuration = () => {
|
||||
<Form.Item
|
||||
name="permission"
|
||||
label="Permissions"
|
||||
tooltip="coming soon"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Radio.Group>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
.knowledgeLogo {
|
||||
}
|
||||
.knowledgeTitle {
|
||||
font-family: 'Nunito Sans';
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
font-weight: @fontWeight700;
|
||||
@@ -16,7 +15,6 @@
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.knowledgeDescription {
|
||||
font-family: 'Nunito Sans';
|
||||
font-size: 12px;
|
||||
font-weight: @fontWeight600;
|
||||
color: @gray8;
|
||||
@@ -55,7 +53,6 @@
|
||||
|
||||
.menuText {
|
||||
color: @gray3;
|
||||
font-family: @fontFamilyNunitoSans;
|
||||
font-size: @fontSize14;
|
||||
font-weight: @fontWeight700;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,12 @@ const TestingControl = ({ form, handleTesting }: IProps) => {
|
||||
top_k: 1024,
|
||||
}}
|
||||
>
|
||||
<SimilaritySlider></SimilaritySlider>
|
||||
<Form.Item<FieldType> label="Top k" name={'top_k'}>
|
||||
<SimilaritySlider isTooltipShown></SimilaritySlider>
|
||||
<Form.Item<FieldType>
|
||||
label="Top k"
|
||||
name={'top_k'}
|
||||
tooltip="coming soon"
|
||||
>
|
||||
<Slider marks={{ 0: 0, 2048: 2048 }} max={2048} />
|
||||
</Form.Item>
|
||||
<Card size="small" title="Test text">
|
||||
|
||||
Reference in New Issue
Block a user