feat: locate the specific location of the document based on the coordinates of the chunk and add Upload to AssistantSetting (#92)

* feat: add Upload to AssistantSetting

* feat: locate the specific location of the document based on the coordinates of the chunk
This commit is contained in:
balibabu
2024-03-04 17:03:23 +08:00
committed by GitHub
parent 685b4d8a95
commit fae00827e6
12 changed files with 231 additions and 61 deletions

View File

@@ -23,7 +23,7 @@ import {
import type { ColumnsType } from 'antd/es/table';
import { PaginationProps } from 'antd/lib';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Link, useDispatch, useNavigate, useSelector } from 'umi';
import { useDispatch, useNavigate, useSelector } from 'umi';
import CreateEPModal from './createEFileModal';
import styles from './index.less';
import ParsingActionCell from './parsing-action-cell';
@@ -144,19 +144,22 @@ const KnowledgeFile = () => {
});
}, [dispatch]);
const linkToUploadPage = useCallback(() => {
navigate(`/knowledge/dataset/upload?id=${knowledgeBaseId}`);
}, [navigate, knowledgeBaseId]);
const actionItems: MenuProps['items'] = useMemo(() => {
return [
{
key: '1',
onClick: linkToUploadPage,
label: (
<div>
<Button type="link">
<Link to={`/knowledge/dataset/upload?id=${knowledgeBaseId}`}>
<Space>
<FileTextOutlined />
Local files
</Space>
</Link>
<Space>
<FileTextOutlined />
Local files
</Space>
</Button>
</div>
),
@@ -164,9 +167,10 @@ const KnowledgeFile = () => {
{ type: 'divider' },
{
key: '2',
onClick: showCEFModal,
label: (
<div>
<Button type="link" onClick={showCEFModal}>
<Button type="link">
<FileOutlined />
Create empty file
</Button>
@@ -175,7 +179,7 @@ const KnowledgeFile = () => {
// disabled: true,
},
];
}, [knowledgeBaseId, showCEFModal]);
}, [linkToUploadPage, showCEFModal]);
const toChunk = (id: string) => {
navigate(