feat: remove KnowledgeSearching and add knowledge configuration page and add a run button to the document (#64)

* feat: add a run button to the document

* feat: add knowledge configuration page

* feat: remove KnowledgeSearching
This commit is contained in:
balibabu
2024-02-18 18:18:20 +08:00
committed by GitHub
parent 53be70c7a9
commit f3d0ebd293
22 changed files with 495 additions and 687 deletions

View File

@@ -1,8 +1,5 @@
import { KnowledgeRouteKey } from '@/constants/knowledge';
import {
useDeleteDocumentById,
useKnowledgeBaseId,
} from '@/hooks/knowledgeHook';
import { useKnowledgeBaseId } from '@/hooks/knowledgeHook';
import { Pagination } from '@/interfaces/common';
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
import { getOneNamespaceEffectsLoading } from '@/utils/storeUtil';
@@ -40,7 +37,6 @@ const KnowledgeFile = () => {
const effects = useSelector((state: any) => state.loading.effects);
const { data, total } = kFModel;
const knowledgeBaseId = useKnowledgeBaseId();
const { removeDocument } = useDeleteDocumentById();
const loading = getOneNamespaceEffectsLoading('kFModel', effects, [
'getKfList',
@@ -132,9 +128,7 @@ const KnowledgeFile = () => {
},
});
};
const onRmDocument = () => {
removeDocument(doc_id);
};
const showCEFModal = () => {
dispatch({
type: 'kFModel/updateState',
@@ -144,15 +138,6 @@ const KnowledgeFile = () => {
});
};
const showSegmentSetModal = () => {
dispatch({
type: 'kFModel/updateState',
payload: {
isShowSegmentSetModal: true,
},
});
};
const actionItems: MenuProps['items'] = useMemo(() => {
return [
{
@@ -185,31 +170,6 @@ const KnowledgeFile = () => {
},
];
}, []);
const chunkItems: MenuProps['items'] = [
{
key: '1',
label: (
<div>
<Button type="link" onClick={showSegmentSetModal}>
{' '}
</Button>
</div>
),
},
{
key: '2',
label: (
<div>
<Button type="link" onClick={onRmDocument}>
{' '}
Delete
</Button>
</div>
),
// disabled: true,
},
];
const toChunk = (id: string) => {
navigate(