fix: update condition for handling datasource selection in DataSourceOptions

This commit is contained in:
twwu 2025-06-06 11:43:00 +08:00
parent 8e4165defe
commit 5193fa2118
4 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ const DataSourceOptions = ({
}, [datasources, onSelect]) }, [datasources, onSelect])
useEffect(() => { useEffect(() => {
if (options.length > 0) if (options.length > 0 && !datasourceNodeId)
handelSelect(options[0].value) handelSelect(options[0].value)
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [])

View File

@ -22,7 +22,7 @@ const DataSourceOptions = ({
}, [datasources, onSelect]) }, [datasources, onSelect])
useEffect(() => { useEffect(() => {
if (options.length > 0) if (options.length > 0 && !dataSourceNodeId)
handelSelect(options[0].value) handelSelect(options[0].value)
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [])

View File

@ -242,7 +242,7 @@ const FileUploader = ({
}, [handleDrop]) }, [handleDrop])
return ( return (
<div> <div className='flex flex-col'>
{!hideUpload && ( {!hideUpload && (
<input <input
ref={fileUploader} ref={fileUploader}

View File

@ -101,7 +101,7 @@ const Crawler = ({
}, [runDatasourceNode, nodeId, pipelineId, onJobIdChange, onCheckedCrawlResultChange, t]) }, [runDatasourceNode, nodeId, pipelineId, onJobIdChange, onCheckedCrawlResultChange, t])
return ( return (
<div> <div className='flex flex-col'>
<Header <Header
isInPipeline isInPipeline
{...headerInfo} {...headerInfo}
@ -117,7 +117,7 @@ const Crawler = ({
/> />
</div> </div>
{!isInit && ( {!isInit && (
<div className='relative'> <div className='relative flex flex-col'>
{isRunning && ( {isRunning && (
<Crawling <Crawling
crawledNum={0} crawledNum={0}