mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 13:33:48 +08:00
### 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)
34 lines
843 B
TypeScript
34 lines
843 B
TypeScript
import { FormLayout } from '@/constants/form';
|
|
import { useTranslate } from '@/hooks/common-hooks';
|
|
import { SliderInputFormField } from './slider-input-form-field';
|
|
|
|
interface IProps {
|
|
initialValue?: number;
|
|
max?: number;
|
|
sliderTestId?: string;
|
|
numberInputTestId?: string;
|
|
}
|
|
|
|
export function MaxTokenNumberFormField({
|
|
max = 2048,
|
|
initialValue,
|
|
sliderTestId,
|
|
numberInputTestId,
|
|
}: IProps) {
|
|
const { t } = useTranslate('knowledgeConfiguration');
|
|
|
|
return (
|
|
<SliderInputFormField
|
|
name={'parser_config.chunk_token_num'}
|
|
label={t('chunkTokenNumber')}
|
|
tooltip={t('chunkTokenNumberTip')}
|
|
max={max}
|
|
defaultValue={initialValue ?? 0}
|
|
layout={FormLayout.Horizontal}
|
|
sliderTestId={sliderTestId}
|
|
numberInputTestId={numberInputTestId}
|
|
min={1}
|
|
></SliderInputFormField>
|
|
);
|
|
}
|