Commit d167ca32 authored by Joel's avatar Joel

feat: free plan not support bathch upload

parent 1308978d
...@@ -23,6 +23,7 @@ type IFileUploaderProps = { ...@@ -23,6 +23,7 @@ type IFileUploaderProps = {
onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void
onFileListUpdate?: (files: FileItem[]) => void onFileListUpdate?: (files: FileItem[]) => void
onPreview: (file: File) => void onPreview: (file: File) => void
notSupportBatchUpload?: boolean
} }
const FileUploader = ({ const FileUploader = ({
...@@ -32,6 +33,7 @@ const FileUploader = ({ ...@@ -32,6 +33,7 @@ const FileUploader = ({
onFileUpdate, onFileUpdate,
onFileListUpdate, onFileListUpdate,
onPreview, onPreview,
notSupportBatchUpload,
}: IFileUploaderProps) => { }: IFileUploaderProps) => {
const { t } = useTranslation() const { t } = useTranslation()
const { notify } = useContext(ToastContext) const { notify } = useContext(ToastContext)
...@@ -258,7 +260,7 @@ const FileUploader = ({ ...@@ -258,7 +260,7 @@ const FileUploader = ({
id="fileUploader" id="fileUploader"
style={{ display: 'none' }} style={{ display: 'none' }}
type="file" type="file"
multiple multiple={!notSupportBatchUpload}
accept={ACCEPTS.join(',')} accept={ACCEPTS.join(',')}
onChange={fileChangeHandle} onChange={fileChangeHandle}
/> />
......
...@@ -39,7 +39,7 @@ export const NotionConnector = ({ onSetting }: NotionConnectorProps) => { ...@@ -39,7 +39,7 @@ export const NotionConnector = ({ onSetting }: NotionConnectorProps) => {
return ( return (
<div className={s.notionConnectionTip}> <div className={s.notionConnectionTip}>
<span className={s.notionIcon}/> <span className={s.notionIcon} />
<div className={s.title}>{t('datasetCreation.stepOne.notionSyncTitle')}</div> <div className={s.title}>{t('datasetCreation.stepOne.notionSyncTitle')}</div>
<div className={s.tip}>{t('datasetCreation.stepOne.notionSyncTip')}</div> <div className={s.tip}>{t('datasetCreation.stepOne.notionSyncTip')}</div>
<Button className='h-8' type='primary' onClick={onSetting}>{t('datasetCreation.stepOne.connect')}</Button> <Button className='h-8' type='primary' onClick={onSetting}>{t('datasetCreation.stepOne.connect')}</Button>
...@@ -92,7 +92,7 @@ const StepOne = ({ ...@@ -92,7 +92,7 @@ const StepOne = ({
const hasNotin = notionPages.length > 0 const hasNotin = notionPages.length > 0
const isVectorSpaceFull = plan.usage.vectorSpace >= plan.total.vectorSpace const isVectorSpaceFull = plan.usage.vectorSpace >= plan.total.vectorSpace
const isShowVectorSpaceFull = (allFileLoaded || hasNotin) && isVectorSpaceFull && enableBilling const isShowVectorSpaceFull = (allFileLoaded || hasNotin) && isVectorSpaceFull && enableBilling
const notSupportBatchUpload = enableBilling && plan.type === 'sandbox'
const nextDisabled = useMemo(() => { const nextDisabled = useMemo(() => {
if (!files.length) if (!files.length)
return true return true
...@@ -169,6 +169,7 @@ const StepOne = ({ ...@@ -169,6 +169,7 @@ const StepOne = ({
onFileListUpdate={updateFileList} onFileListUpdate={updateFileList}
onFileUpdate={updateFile} onFileUpdate={updateFile}
onPreview={updateCurrentFile} onPreview={updateCurrentFile}
notSupportBatchUpload={notSupportBatchUpload}
/> />
{isShowVectorSpaceFull && ( {isShowVectorSpaceFull && (
<div className='max-w-[640px] mb-4'> <div className='max-w-[640px] mb-4'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment