mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix: The number of chunks in the file list is not displayed. (#14232)
### What problem does this PR solve? Fix: The number of chunks in the file list is not displayed. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -27,6 +27,7 @@ export function MaxTokenNumberFormField({
|
||||
layout={FormLayout.Horizontal}
|
||||
sliderTestId={sliderTestId}
|
||||
numberInputTestId={numberInputTestId}
|
||||
min={1}
|
||||
></SliderInputFormField>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RunningStatus } from '@/constants/knowledge';
|
||||
|
||||
export interface IDocumentInfo {
|
||||
chunk_num: number;
|
||||
// chunk_num: number;
|
||||
create_date: string;
|
||||
create_time: number;
|
||||
created_by: string;
|
||||
@@ -11,7 +11,7 @@ export interface IDocumentInfo {
|
||||
location: string;
|
||||
name: string;
|
||||
parser_config: IParserConfig;
|
||||
parser_id: string;
|
||||
// parser_id: string;
|
||||
pipeline_id: string;
|
||||
pipeline_name: string;
|
||||
process_begin_at?: string;
|
||||
@@ -29,6 +29,8 @@ export interface IDocumentInfo {
|
||||
update_date: string;
|
||||
update_time: number;
|
||||
meta_fields?: Record<string, any>;
|
||||
chunk_method: string;
|
||||
chunk_count: number;
|
||||
}
|
||||
|
||||
export interface IParserConfig {
|
||||
|
||||
@@ -190,7 +190,7 @@ export function DatasetTable({
|
||||
{changeParserVisible && (
|
||||
<ChunkMethodDialog
|
||||
documentId={changeParserRecord.id}
|
||||
parserId={changeParserRecord.parser_id}
|
||||
parserId={changeParserRecord.chunk_method}
|
||||
pipelineId={changeParserRecord.pipeline_id}
|
||||
parserConfig={changeParserRecord.parser_config}
|
||||
documentExtension={getExtension(changeParserRecord.name)}
|
||||
|
||||
@@ -26,7 +26,7 @@ export const useShowLog = (documents: IDocumentInfo[]) => {
|
||||
uploadDate: formatDate(findRecord.create_date),
|
||||
fileSize: formatBytes(findRecord.size || 0),
|
||||
processBeginAt: formatDate(findRecord.process_begin_at),
|
||||
chunkNumber: findRecord.chunk_num,
|
||||
chunkNumber: findRecord.chunk_count,
|
||||
duration: formatSecondsToHumanReadable(
|
||||
findRecord.process_duration || 0,
|
||||
),
|
||||
|
||||
@@ -39,6 +39,9 @@ const IconMap = {
|
||||
[RunningStatus.FAIL]: (
|
||||
<IconFontFill name="reparse" className="text-accent-primary" />
|
||||
),
|
||||
[RunningStatus.SCHEDULE]: (
|
||||
<IconFontFill name="reparse" className="text-accent-primary" />
|
||||
),
|
||||
};
|
||||
|
||||
const ParseStatusStateMap = {
|
||||
@@ -58,7 +61,7 @@ export function ParseDropdownButton({
|
||||
record: IDocumentInfo;
|
||||
} & UseChangeDocumentParserShowType) {
|
||||
const { t } = useTranslation();
|
||||
const { pipeline_id, pipeline_name, parser_id } = record;
|
||||
const { pipeline_id, pipeline_name, chunk_method } = record;
|
||||
|
||||
const handleShowChangeParserModal = useCallback(() => {
|
||||
showChangeParserModal(record);
|
||||
@@ -73,18 +76,18 @@ export function ParseDropdownButton({
|
||||
<Button variant="static" size="auto" className="capitalize">
|
||||
{pipeline_id
|
||||
? pipeline_name || pipeline_id
|
||||
: parser_id === 'naive'
|
||||
: chunk_method === 'naive'
|
||||
? 'general'
|
||||
: parser_id}
|
||||
: chunk_method}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p className="capitalize">
|
||||
{pipeline_id
|
||||
? pipeline_name || pipeline_id
|
||||
: parser_id === 'naive'
|
||||
: chunk_method === 'naive'
|
||||
? 'general'
|
||||
: parser_id}
|
||||
: chunk_method}
|
||||
</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
@@ -106,7 +109,7 @@ export function ParsingStatusCell({
|
||||
record: IDocumentInfo;
|
||||
showLog: (record: IDocumentInfo) => void;
|
||||
} & UseChangeDocumentParserShowType) {
|
||||
const { run, progress, chunk_num, id } = record;
|
||||
const { run, progress, chunk_count, id } = record;
|
||||
const operationIcon = IconMap[run];
|
||||
const p = Number((progress * 100).toFixed(2));
|
||||
const {
|
||||
@@ -116,7 +119,7 @@ export function ParsingStatusCell({
|
||||
hideModal: hideReparseDialogModal,
|
||||
} = useHandleRunDocumentByIds(id);
|
||||
const isRunning = isParserRunning(run);
|
||||
const isZeroChunk = chunk_num === 0;
|
||||
const isZeroChunk = chunk_count === 0;
|
||||
|
||||
const handleOperationIconClick = (option?: {
|
||||
delete: boolean;
|
||||
@@ -192,7 +195,7 @@ export function ParsingStatusCell({
|
||||
// hidden={false}
|
||||
enable_metadata={record?.parser_config?.enable_metadata}
|
||||
handleOperationIconClick={handleOperationIconClick}
|
||||
chunk_num={chunk_num}
|
||||
chunk_num={chunk_count}
|
||||
visible={reparseDialogVisible}
|
||||
hideModal={hideReparseDialogModal}
|
||||
></ReparseDialog>
|
||||
|
||||
@@ -47,7 +47,7 @@ export function useBulkOperateDataset({
|
||||
return documents
|
||||
.filter((item) => selectedRowKeys.includes(item.id) && item.id)
|
||||
?.reduce((acc, cur) => {
|
||||
return acc + cur.chunk_num;
|
||||
return acc + cur.chunk_count;
|
||||
}, 0);
|
||||
}, [documents, selectedRowKeys]);
|
||||
|
||||
|
||||
@@ -176,10 +176,10 @@ export function useDatasetTableColumns({
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'chunk_num',
|
||||
accessorKey: 'chunk_count',
|
||||
header: t('chunkNumber'),
|
||||
cell: ({ row }) => (
|
||||
<div className="capitalize">{row.getValue('chunk_num')}</div>
|
||||
<div className="capitalize">{row.getValue('chunk_count')}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user