mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 23:16:58 +08:00
feat: fetch knowledge detail on KnowledgeUploadFile mount and add category column to chunk table and set initial value for the model field of chat setting (#104)
* feat: set initial value for the model field of chat setting * feat: add category column to chunk table * feat: fetch knowledge detail on KnowledgeUploadFile mount
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
import { KnowledgeRouteKey } from '@/constants/knowledge';
|
||||
import { useKnowledgeBaseId } from '@/hooks/knowledgeHook';
|
||||
import {
|
||||
useFetchTenantInfo,
|
||||
useSelectParserList,
|
||||
} from '@/hooks/userSettingHook';
|
||||
import { Pagination } from '@/interfaces/common';
|
||||
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
||||
import { getOneNamespaceEffectsLoading } from '@/utils/storeUtil';
|
||||
@ -45,6 +49,7 @@ const KnowledgeFile = () => {
|
||||
const [doc_id, setDocId] = useState('0');
|
||||
const [parser_id, setParserId] = useState('0');
|
||||
let navigate = useNavigate();
|
||||
const parserList = useSelectParserList();
|
||||
|
||||
const getKfList = useCallback(() => {
|
||||
const payload = {
|
||||
@ -214,6 +219,14 @@ const KnowledgeFile = () => {
|
||||
dataIndex: 'create_date',
|
||||
key: 'create_date',
|
||||
},
|
||||
{
|
||||
title: 'Category',
|
||||
dataIndex: 'parser_id',
|
||||
key: 'parser_id',
|
||||
render: (text) => {
|
||||
return parserList.find((x) => x.value === text)?.label;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Parsing Status',
|
||||
dataIndex: 'run',
|
||||
@ -255,6 +268,8 @@ const KnowledgeFile = () => {
|
||||
className: `${styles.column}`,
|
||||
}));
|
||||
|
||||
useFetchTenantInfo();
|
||||
|
||||
return (
|
||||
<div className={styles.datasetWrapper}>
|
||||
<h3>Dataset</h3>
|
||||
|
||||
@ -62,7 +62,7 @@ const ParsingActionCell = ({
|
||||
label: (
|
||||
<div>
|
||||
<Button type="link" onClick={showSegmentSetModal}>
|
||||
Parser type
|
||||
Category
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
import { useFetchParserList, useSelectParserList } from '@/hooks/knowledgeHook';
|
||||
import {
|
||||
useFetchTenantInfo,
|
||||
useSelectParserList,
|
||||
} from '@/hooks/userSettingHook';
|
||||
import { Modal, Space, Tag } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useDispatch, useSelector } from 'umi';
|
||||
@ -20,7 +23,7 @@ const SegmentSetModal: React.FC<kFProps> = ({
|
||||
const { isShowSegmentSetModal } = kFModel;
|
||||
const parserList = useSelectParserList();
|
||||
|
||||
useFetchParserList();
|
||||
useFetchTenantInfo();
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedTag(parser_id);
|
||||
@ -57,7 +60,7 @@ const SegmentSetModal: React.FC<kFProps> = ({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Parser Type"
|
||||
title="Category"
|
||||
open={isShowSegmentSetModal}
|
||||
onOk={handleOk}
|
||||
onCancel={handleCancel}
|
||||
|
||||
Reference in New Issue
Block a user