feat: enhance file uploader and test run panel with batch upload limits and tooltips

This commit is contained in:
twwu
2025-05-28 14:51:10 +08:00
parent b9214ca76b
commit 9e763c9e87
8 changed files with 24 additions and 7 deletions

View File

@ -322,6 +322,7 @@ const FileUploader = ({
<div>{t('datasetCreation.stepOne.uploader.tip', {
size: fileUploadConfig.file_size_limit,
supportTypes: supportTypesShowNames,
batchCount: fileUploadConfig.batch_count_limit,
})}</div>
{dragging && <div ref={dragRef} className='absolute left-0 top-0 h-full w-full' />}
</div>

View File

@ -25,6 +25,7 @@ import ProcessDocuments from './process-documents'
import ChunkPreview from './preview/chunk-preview'
import Processing from './processing'
import { DatasourceType } from '@/models/pipeline'
import { TransferMethod } from '@/types/app'
const TestRunPanel = () => {
const { t } = useTranslation()
@ -137,12 +138,14 @@ const TestRunPanel = () => {
if (datasource.type === DatasourceType.localFile) {
const { id, name, type, size, extension, mime_type } = previewFile.current as File
const documentInfo = {
upload_file_id: id,
related_id: id,
name,
type,
size,
extension,
mime_type,
url: '',
transfer_method: TransferMethod.local_file,
}
datasourceInfoList.push(documentInfo)
}
@ -183,12 +186,14 @@ const TestRunPanel = () => {
fileList.forEach((file) => {
const { id, name, type, size, extension, mime_type } = file.file
const documentInfo = {
upload_file_id: id,
related_id: id,
name,
type,
size,
extension,
mime_type,
url: '',
transfer_method: TransferMethod.local_file,
}
datasourceInfoList.push(documentInfo)
})

View File

@ -274,6 +274,7 @@ const FileUploader = ({
<div>{t('datasetCreation.stepOne.uploader.tip', {
size: fileUploadConfig.file_size_limit,
supportTypes: supportTypesShowNames,
batchCount: fileUploadConfig.batch_count_limit,
})}</div>
{dragging && <div ref={dragRef} className='absolute left-0 top-0 h-full w-full' />}
</div>

View File

@ -18,6 +18,8 @@ import { useTranslation } from 'react-i18next'
import { usePipelineRun } from '../../../hooks'
import type { Datasource } from './types'
import { DatasourceType } from '@/models/pipeline'
import { TransferMethod } from '@/types/app'
import Tooltip from '@/app/components/base/tooltip'
const TestRunPanel = () => {
const { t } = useTranslation()
@ -96,12 +98,14 @@ const TestRunPanel = () => {
if (datasource.type === DatasourceType.localFile) {
const { id, name, type, size, extension, mime_type } = fileList[0].file
const documentInfo = {
upload_file_id: id,
related_id: id,
name,
type,
size,
extension,
mime_type,
url: '',
transfer_method: TransferMethod.local_file,
}
datasourceInfoList.push(documentInfo)
}
@ -140,8 +144,12 @@ const TestRunPanel = () => {
<RiCloseLine className='size-4 text-text-tertiary' />
</button>
<div className='flex flex-col gap-y-0.5 px-3 pb-2 pt-3.5'>
<div className='system-md-semibold-uppercase flex items-center justify-between pl-1 pr-8 text-text-primary'>
{t('datasetPipeline.testRun.title')}
<div className='flex items-center gap-x-1 pl-1 pr-8'>
<span className='system-md-semibold-uppercase text-text-primary'>{t('datasetPipeline.testRun.title')}</span>
<Tooltip
popupContent={t('datasetPipeline.testRun.tooltip')}
popupClassName='max-w-[240px]'
/>
</div>
<StepIndicator steps={steps} currentStep={currentStep} />
</div>