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:
balibabu
2024-03-20 18:20:42 +08:00
committed by GitHub
parent 6999598101
commit fce14ee187
65 changed files with 434 additions and 59 deletions

View File

@@ -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 {

View File

@@ -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>
);
};

View File

@@ -91,6 +91,7 @@ const Configuration = () => {
<Form.Item
name="permission"
label="Permissions"
tooltip="coming soon"
rules={[{ required: true }]}
>
<Radio.Group>

View File

@@ -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;
}

View File

@@ -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">