Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
8d8b062e
authored
Jul 03, 2025
by
Archer
Committed by
GitHub
Jul 03, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add max count to image import (#5144)
parent
2078cdf0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
projects/app/src/pageComponents/dataset/detail/components/FileSelector.tsx
+10
-7
No files found.
projects/app/src/pageComponents/dataset/detail/components/FileSelector.tsx
View file @
8d8b062e
...
...
@@ -39,16 +39,19 @@ const FileSelector = ({
const
systemMaxSize
=
(
feConfigs
?.
uploadFileMaxSize
||
1024
)
*
1024
*
1024
;
const
displayMaxSize
=
maxSize
||
formatFileSize
(
systemMaxSize
);
const
formatMaxCount
=
feConfigs
.
uploadFileMaxAmount
?
Math
.
min
(
maxCount
,
feConfigs
.
uploadFileMaxAmount
)
:
maxCount
;
const
{
File
,
onOpen
}
=
useSelectFile
({
fileType
,
multiple
:
m
axCount
>
1
,
maxCount
multiple
:
formatM
axCount
>
1
,
maxCount
:
formatMaxCount
});
const
[
isDragging
,
setIsDragging
]
=
useState
(
false
);
const
isMaxSelected
=
useMemo
(
()
=>
selectFiles
.
length
>=
m
axCount
,
[
m
axCount
,
selectFiles
.
length
]
()
=>
selectFiles
.
length
>=
formatM
axCount
,
[
formatM
axCount
,
selectFiles
.
length
]
);
const
filterTypeReg
=
new
RegExp
(
...
...
@@ -68,10 +71,10 @@ const FileSelector = ({
size
:
formatFileSize
(
file
.
size
)
}));
const
newFiles
=
[...
fileList
,
...
selectFiles
].
slice
(
0
,
m
axCount
);
const
newFiles
=
[...
fileList
,
...
selectFiles
].
slice
(
0
,
formatM
axCount
);
setSelectFiles
(
newFiles
);
},
[
m
axCount
,
selectFiles
,
setSelectFiles
]
[
formatM
axCount
,
selectFiles
,
setSelectFiles
]
);
const
handleDragEnter
=
(
e
:
DragEvent
<
HTMLDivElement
>
)
=>
{
...
...
@@ -206,7 +209,7 @@ const FileSelector = ({
)
}
<
Box
color=
{
'myGray.500'
}
fontSize=
{
'xs'
}
>
{
/* max count */
}
{
maxCount
&&
<>
{
t
(
'file:support_max_count'
,
{
m
axCount
})
}
,
</>
}
{
formatMaxCount
&&
<>
{
t
(
'file:support_max_count'
,
{
maxCount
:
formatM
axCount
})
}
,
</>
}
{
/* max size */
}
{
t
(
'file:support_max_size'
,
{
maxSize
:
displayMaxSize
})
}
</
Box
>
...
...
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