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
fea7c51d
authored
Nov 14, 2025
by
heheer
Committed by
GitHub
Nov 14, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: support upload import duplicate plugin (#5926)
parent
b0c6e687
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
10 deletions
+26
-10
packages/web/i18n/en/app.json
+1
-0
packages/web/i18n/zh-CN/app.json
+1
-0
packages/web/i18n/zh-Hant/app.json
+1
-0
projects/app/src/pageComponents/config/ImportPluginModal.tsx
+23
-10
No files found.
packages/web/i18n/en/app.json
View file @
fea7c51d
...
@@ -109,6 +109,7 @@
...
@@ -109,6 +109,7 @@
"custom_plugin_default_installed_label"
:
"Default Installed"
,
"custom_plugin_default_installed_label"
:
"Default Installed"
,
"custom_plugin_delete_success"
:
"Delete successful"
,
"custom_plugin_delete_success"
:
"Delete successful"
,
"custom_plugin_duplicate"
:
"Duplicate ID"
,
"custom_plugin_duplicate"
:
"Duplicate ID"
,
"custom_plugin_duplicate_tip"
:
"Confirm that the import will overwrite the original resources"
,
"custom_plugin_has_token_fee_label"
:
"Charge Token Fee"
,
"custom_plugin_has_token_fee_label"
:
"Charge Token Fee"
,
"custom_plugin_intro_label"
:
"Introduction"
,
"custom_plugin_intro_label"
:
"Introduction"
,
"custom_plugin_intro_placeholder"
:
"Add an introduction for this application"
,
"custom_plugin_intro_placeholder"
:
"Add an introduction for this application"
,
...
...
packages/web/i18n/zh-CN/app.json
View file @
fea7c51d
...
@@ -111,6 +111,7 @@
...
@@ -111,6 +111,7 @@
"custom_plugin_default_installed_label"
:
"默认安装"
,
"custom_plugin_default_installed_label"
:
"默认安装"
,
"custom_plugin_delete_success"
:
"删除成功"
,
"custom_plugin_delete_success"
:
"删除成功"
,
"custom_plugin_duplicate"
:
"ID 重复"
,
"custom_plugin_duplicate"
:
"ID 重复"
,
"custom_plugin_duplicate_tip"
:
"确认导入将覆盖原有资源"
,
"custom_plugin_has_token_fee_label"
:
"是否收取 Token 费用"
,
"custom_plugin_has_token_fee_label"
:
"是否收取 Token 费用"
,
"custom_plugin_intro_label"
:
"介绍"
,
"custom_plugin_intro_label"
:
"介绍"
,
"custom_plugin_intro_placeholder"
:
"为这个应用添加一个介绍"
,
"custom_plugin_intro_placeholder"
:
"为这个应用添加一个介绍"
,
...
...
packages/web/i18n/zh-Hant/app.json
View file @
fea7c51d
...
@@ -108,6 +108,7 @@
...
@@ -108,6 +108,7 @@
"custom_plugin_default_installed_label"
:
"預設安裝"
,
"custom_plugin_default_installed_label"
:
"預設安裝"
,
"custom_plugin_delete_success"
:
"刪除成功"
,
"custom_plugin_delete_success"
:
"刪除成功"
,
"custom_plugin_duplicate"
:
"ID 重複"
,
"custom_plugin_duplicate"
:
"ID 重複"
,
"custom_plugin_duplicate_tip"
:
"確認導入將覆蓋原有資源"
,
"custom_plugin_has_token_fee_label"
:
"是否收取 Token 費用"
,
"custom_plugin_has_token_fee_label"
:
"是否收取 Token 費用"
,
"custom_plugin_intro_label"
:
"介紹"
,
"custom_plugin_intro_label"
:
"介紹"
,
"custom_plugin_intro_placeholder"
:
"為這個應用程式新增一個介紹"
,
"custom_plugin_intro_placeholder"
:
"為這個應用程式新增一個介紹"
,
...
...
projects/app/src/pageComponents/config/ImportPluginModal.tsx
View file @
fea7c51d
...
@@ -82,10 +82,10 @@ const ImportPluginModal = ({
...
@@ -82,10 +82,10 @@ const ImportPluginModal = ({
const
isDuplicated
=
tools
.
some
((
tool
)
=>
tool
.
id
.
includes
(
toolDetail
.
toolId
));
const
isDuplicated
=
tools
.
some
((
tool
)
=>
tool
.
id
.
includes
(
toolDetail
.
toolId
));
setUploadedFiles
((
prev
)
=>
setUploadedFiles
((
prev
)
=>
prev
.
map
((
f
)
=>
prev
.
map
((
prevFile
)
=>
f
.
name
===
file
.
name
prevFile
.
name
===
file
.
name
?
{
?
{
...
f
,
...
prevFile
,
status
:
isDuplicated
?
'duplicate'
:
'success'
,
status
:
isDuplicated
?
'duplicate'
:
'success'
,
toolId
:
parentId
,
toolId
:
parentId
,
toolName
:
parseI18nString
(
toolDetail
.
name
||
''
,
i18n
.
language
),
toolName
:
parseI18nString
(
toolDetail
.
name
||
''
,
i18n
.
language
),
...
@@ -97,12 +97,16 @@ const ImportPluginModal = ({
...
@@ -97,12 +97,16 @@ const ImportPluginModal = ({
return
parseI18nString
(
currentTag
?.
tagName
||
''
,
i18n
.
language
)
||
''
;
return
parseI18nString
(
currentTag
?.
tagName
||
''
,
i18n
.
language
)
||
''
;
})
||
[]
})
||
[]
}
}
:
f
:
prevFile
)
)
);
);
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
setUploadedFiles
((
prev
)
=>
setUploadedFiles
((
prev
)
=>
prev
.
map
((
f
)
=>
(
f
.
name
===
file
.
name
?
{
...
f
,
status
:
'error'
,
errorMsg
:
error
}
:
f
))
prev
.
map
((
prevFile
)
=>
prevFile
.
name
===
file
.
name
?
{
...
prevFile
,
status
:
'error'
,
errorMsg
:
error
.
message
}
:
prevFile
)
);
);
}
}
};
};
...
@@ -160,7 +164,7 @@ const ImportPluginModal = ({
...
@@ -160,7 +164,7 @@ const ImportPluginModal = ({
const
{
runAsync
:
handleConfirmImport
,
loading
:
confirmLoading
}
=
useRequest2
(
const
{
runAsync
:
handleConfirmImport
,
loading
:
confirmLoading
}
=
useRequest2
(
async
()
=>
{
async
()
=>
{
const
successToolIds
=
uploadedFiles
const
successToolIds
=
uploadedFiles
.
filter
((
file
)
=>
file
.
status
===
'success'
&&
file
.
toolId
)
.
filter
((
file
)
=>
(
file
.
status
===
'success'
||
file
.
status
===
'duplicate'
)
&&
file
.
toolId
)
.
map
((
file
)
=>
file
.
toolId
!
);
.
map
((
file
)
=>
file
.
toolId
!
);
await
confirmPkgPluginUpload
({
toolIds
:
successToolIds
});
await
confirmPkgPluginUpload
({
toolIds
:
successToolIds
});
...
@@ -248,11 +252,15 @@ const ImportPluginModal = ({
...
@@ -248,11 +252,15 @@ const ImportPluginModal = ({
textOverflow=
{
'ellipsis'
}
textOverflow=
{
'ellipsis'
}
whiteSpace=
{
'nowrap'
}
whiteSpace=
{
'nowrap'
}
>
>
{
item
.
status
===
'success'
&&
item
.
toolName
?
item
.
toolName
:
item
.
name
}
{
(
item
.
status
===
'success'
||
item
.
status
===
'duplicate'
)
&&
item
.
toolName
?
item
.
toolName
:
item
.
name
}
</
Box
>
</
Box
>
</
Flex
>
</
Flex
>
<
Flex
w=
{
'20%'
}
px=
{
1
}
py=
{
'15px'
}
align=
{
'center'
}
gap=
{
1
}
flexWrap=
{
'wrap'
}
>
<
Flex
w=
{
'20%'
}
px=
{
1
}
py=
{
'15px'
}
align=
{
'center'
}
gap=
{
1
}
flexWrap=
{
'wrap'
}
>
{
item
.
status
===
'success'
&&
item
.
toolTags
&&
item
.
toolTags
.
length
>
0
?
(
{
(
item
.
status
===
'success'
||
item
.
status
===
'duplicate'
)
&&
item
.
toolTags
&&
item
.
toolTags
.
length
>
0
?
(
item
.
toolTags
.
map
((
tag
,
tagIndex
)
=>
(
item
.
toolTags
.
map
((
tag
,
tagIndex
)
=>
(
<
Box
<
Box
key=
{
tagIndex
}
key=
{
tagIndex
}
...
@@ -282,7 +290,9 @@ const ImportPluginModal = ({
...
@@ -282,7 +290,9 @@ const ImportPluginModal = ({
whiteSpace=
{
'nowrap'
}
whiteSpace=
{
'nowrap'
}
alignItems=
{
'center'
}
alignItems=
{
'center'
}
>
>
{
item
.
status
===
'success'
&&
item
.
toolIntro
?
item
.
toolIntro
:
'-'
}
{
(
item
.
status
===
'success'
||
item
.
status
===
'duplicate'
)
&&
item
.
toolIntro
?
item
.
toolIntro
:
'-'
}
</
Flex
>
</
Flex
>
<
Flex
w=
{
'10%'
}
px=
{
1
}
py=
{
'15px'
}
>
<
Flex
w=
{
'10%'
}
px=
{
1
}
py=
{
'15px'
}
>
{
(
item
.
status
===
'uploading'
||
item
.
status
===
'parsing'
)
&&
(
{
(
item
.
status
===
'uploading'
||
item
.
status
===
'parsing'
)
&&
(
...
@@ -303,8 +313,10 @@ const ImportPluginModal = ({
...
@@ -303,8 +313,10 @@ const ImportPluginModal = ({
fontSize=
{
'xs'
}
fontSize=
{
'xs'
}
fontWeight=
{
'medium'
}
fontWeight=
{
'medium'
}
color=
{
'yellow.500'
}
color=
{
'yellow.500'
}
gap=
{
1
}
>
>
{
t
(
'app:custom_plugin_duplicate'
)
}
{
t
(
'app:custom_plugin_duplicate'
)
}
<
QuestionTip
label=
{
t
(
'app:custom_plugin_duplicate_tip'
)
}
/>
</
Flex
>
</
Flex
>
)
}
)
}
{
item
.
status
===
'success'
&&
(
{
item
.
status
===
'success'
&&
(
...
@@ -371,7 +383,8 @@ const ImportPluginModal = ({
...
@@ -371,7 +383,8 @@ const ImportPluginModal = ({
<
Button
<
Button
onClick=
{
handleConfirmImport
}
onClick=
{
handleConfirmImport
}
isDisabled=
{
isDisabled=
{
uploadedFiles
.
length
===
0
||
uploadedFiles
.
every
((
f
)
=>
f
.
status
!==
'success'
)
uploadedFiles
.
length
===
0
||
uploadedFiles
.
every
((
f
)
=>
f
.
status
!==
'success'
&&
f
.
status
!==
'duplicate'
)
}
}
isLoading=
{
confirmLoading
||
uploadLoading
}
isLoading=
{
confirmLoading
||
uploadLoading
}
>
>
...
...
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