Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
d167ca32
Commit
d167ca32
authored
Feb 23, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: free plan not support bathch upload
parent
1308978d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
index.tsx
web/app/components/datasets/create/file-uploader/index.tsx
+3
-1
index.tsx
web/app/components/datasets/create/step-one/index.tsx
+3
-2
No files found.
web/app/components/datasets/create/file-uploader/index.tsx
View file @
d167ca32
...
@@ -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
}
/>
/>
...
...
web/app/components/datasets/create/step-one/index.tsx
View file @
d167ca32
...
@@ -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'
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment