mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-30 16:55:10 +08:00
### What problem does this PR solve? Feat: Wrap MaxTokenNumber with DatasetConfigurationContainer. #5467 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
2c7428e2ee
commit
aa313e112a
@ -24,6 +24,7 @@ import { useTranslate } from '@/hooks/common-hooks';
|
|||||||
import { IParserConfig } from '@/interfaces/database/document';
|
import { IParserConfig } from '@/interfaces/database/document';
|
||||||
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document';
|
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document';
|
||||||
import { AutoKeywordsItem, AutoQuestionsItem } from '../auto-keywords-item';
|
import { AutoKeywordsItem, AutoQuestionsItem } from '../auto-keywords-item';
|
||||||
|
import { DatasetConfigurationContainer } from '../dataset-configuration-container';
|
||||||
import Delimiter from '../delimiter';
|
import Delimiter from '../delimiter';
|
||||||
import EntityTypesItem from '../entity-types-item';
|
import EntityTypesItem from '../entity-types-item';
|
||||||
import ExcelToHtml from '../excel-to-html';
|
import ExcelToHtml from '../excel-to-html';
|
||||||
@ -105,10 +106,6 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
selectedTag === DocumentParserType.Naive ||
|
selectedTag === DocumentParserType.Naive ||
|
||||||
selectedTag === DocumentParserType.KnowledgeGraph;
|
selectedTag === DocumentParserType.KnowledgeGraph;
|
||||||
|
|
||||||
const hideDivider = [showPages, showOne, showMaxTokenNumber].every(
|
|
||||||
(x) => x === false,
|
|
||||||
);
|
|
||||||
|
|
||||||
const showEntityTypes = selectedTag === DocumentParserType.KnowledgeGraph;
|
const showEntityTypes = selectedTag === DocumentParserType.KnowledgeGraph;
|
||||||
|
|
||||||
const showExcelToHtml =
|
const showExcelToHtml =
|
||||||
@ -151,8 +148,13 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Space>
|
</Space>
|
||||||
{hideDivider || <Divider></Divider>}
|
<Divider></Divider>
|
||||||
<Form name="dynamic_form_nest_item" autoComplete="off" form={form}>
|
<Form
|
||||||
|
name="dynamic_form_nest_item"
|
||||||
|
autoComplete="off"
|
||||||
|
form={form}
|
||||||
|
className="space-y-4"
|
||||||
|
>
|
||||||
{showPages && (
|
{showPages && (
|
||||||
<>
|
<>
|
||||||
<Space>
|
<Space>
|
||||||
@ -257,7 +259,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
</Form.List>
|
</Form.List>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{showOne && <LayoutRecognize></LayoutRecognize>}
|
|
||||||
{showPages && (
|
{showPages && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
noStyle
|
noStyle
|
||||||
@ -283,6 +285,8 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
}
|
}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
<DatasetConfigurationContainer show={showOne || showMaxTokenNumber}>
|
||||||
|
{showOne && <LayoutRecognize></LayoutRecognize>}
|
||||||
{showMaxTokenNumber && (
|
{showMaxTokenNumber && (
|
||||||
<>
|
<>
|
||||||
<MaxTokenNumber
|
<MaxTokenNumber
|
||||||
@ -295,6 +299,10 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
<Delimiter></Delimiter>
|
<Delimiter></Delimiter>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
</DatasetConfigurationContainer>
|
||||||
|
<DatasetConfigurationContainer
|
||||||
|
show={showAutoKeywords(selectedTag) || showExcelToHtml}
|
||||||
|
>
|
||||||
{showAutoKeywords(selectedTag) && (
|
{showAutoKeywords(selectedTag) && (
|
||||||
<>
|
<>
|
||||||
<AutoKeywordsItem></AutoKeywordsItem>
|
<AutoKeywordsItem></AutoKeywordsItem>
|
||||||
@ -302,8 +310,11 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{showExcelToHtml && <ExcelToHtml></ExcelToHtml>}
|
{showExcelToHtml && <ExcelToHtml></ExcelToHtml>}
|
||||||
|
</DatasetConfigurationContainer>
|
||||||
{showRaptorParseConfiguration(selectedTag) && (
|
{showRaptorParseConfiguration(selectedTag) && (
|
||||||
|
<DatasetConfigurationContainer>
|
||||||
<ParseConfiguration></ParseConfiguration>
|
<ParseConfiguration></ParseConfiguration>
|
||||||
|
</DatasetConfigurationContainer>
|
||||||
)}
|
)}
|
||||||
{showGraphRagItems(selectedTag) && <GraphRagItems></GraphRagItems>}
|
{showGraphRagItems(selectedTag) && <GraphRagItems></GraphRagItems>}
|
||||||
{showEntityTypes && <EntityTypesItem></EntityTypesItem>}
|
{showEntityTypes && <EntityTypesItem></EntityTypesItem>}
|
||||||
|
@ -3,13 +3,15 @@ import { PropsWithChildren } from 'react';
|
|||||||
|
|
||||||
type DatasetConfigurationContainerProps = {
|
type DatasetConfigurationContainerProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
show?: boolean;
|
||||||
} & PropsWithChildren;
|
} & PropsWithChildren;
|
||||||
|
|
||||||
export function DatasetConfigurationContainer({
|
export function DatasetConfigurationContainer({
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
|
show = true,
|
||||||
}: DatasetConfigurationContainerProps) {
|
}: DatasetConfigurationContainerProps) {
|
||||||
return (
|
return show ? (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'border p-2 rounded-lg bg-slate-50 dark:bg-gray-600',
|
'border p-2 rounded-lg bg-slate-50 dark:bg-gray-600',
|
||||||
@ -18,5 +20,7 @@ export function DatasetConfigurationContainer({
|
|||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
children
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user