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

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