fix: Add dataset file upload restrictions (#29397)

Co-authored-by: kurokobo <kuro664@gmail.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
This commit is contained in:
Wu Tianwei
2025-12-10 16:41:05 +08:00
committed by GitHub
parent 88b20bc6d0
commit bafd093fa9
35 changed files with 206 additions and 151 deletions

View File

@@ -43,13 +43,13 @@ const BeforeRunForm: FC<CustomRunFormProps> = (props) => {
clearWebsiteCrawlData()
else if (datasourceType === DatasourceType.onlineDrive)
clearOnlineDriveData()
}, [datasourceType])
}, [clearOnlineDocumentData, clearOnlineDriveData, clearWebsiteCrawlData, datasourceType])
const handleCredentialChange = useCallback((credentialId: string) => {
const { setCurrentCredentialId } = dataSourceStore.getState()
clearDataSourceData()
setCurrentCredentialId(credentialId)
}, [dataSourceStore])
}, [clearDataSourceData, dataSourceStore])
return (
<PanelWrap
@@ -60,7 +60,7 @@ const BeforeRunForm: FC<CustomRunFormProps> = (props) => {
{datasourceType === DatasourceType.localFile && (
<LocalFile
allowedExtensions={datasourceNodeData.fileExtensions || []}
notSupportBatchUpload
supportBatchUpload={false}
/>
)}
{datasourceType === DatasourceType.onlineDocument && (
@@ -69,6 +69,7 @@ const BeforeRunForm: FC<CustomRunFormProps> = (props) => {
nodeData={datasourceNodeData}
isInPipeline
onCredentialChange={handleCredentialChange}
supportBatchUpload={false}
/>
)}
{datasourceType === DatasourceType.websiteCrawl && (
@@ -77,6 +78,7 @@ const BeforeRunForm: FC<CustomRunFormProps> = (props) => {
nodeData={datasourceNodeData}
isInPipeline
onCredentialChange={handleCredentialChange}
supportBatchUpload={false}
/>
)}
{datasourceType === DatasourceType.onlineDrive && (
@@ -85,6 +87,7 @@ const BeforeRunForm: FC<CustomRunFormProps> = (props) => {
nodeData={datasourceNodeData}
isInPipeline
onCredentialChange={handleCredentialChange}
supportBatchUpload={false}
/>
)}
<div className='flex justify-end gap-x-2'>