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
9d5a8777
authored
Jun 18, 2026
by
DigHuang
Committed by
GitHub
Jun 18, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(skill): optimize publish flow & upgrade sandbox images (#7132)
parent
e24fef92
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
53 deletions
+35
-53
deploy/dev/docker-compose.cn.yml
+2
-2
deploy/dev/docker-compose.yml
+2
-2
projects/app/src/pageComponents/chat/SandboxEditor/components/EditorContent.tsx
+0
-11
projects/app/src/pageComponents/chat/SandboxEditor/hook.tsx
+2
-2
projects/app/src/pageComponents/dashboard/skill/detail/Content.tsx
+1
-1
projects/app/src/pageComponents/dashboard/skill/detail/Header.tsx
+25
-32
projects/app/src/pageComponents/dashboard/skill/detail/preview/useSkillChatTest.tsx
+2
-2
projects/app/src/pages/skill/detail.tsx
+1
-1
No files found.
deploy/dev/docker-compose.cn.yml
View file @
9d5a8777
...
...
@@ -237,7 +237,7 @@ services:
retries
:
3
fastgpt-agent-sandbox-proxy
:
container_name
:
fastgpt-agent-sandbox-proxy
image
:
ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0-beta
1
image
:
ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0-beta
2
ports
:
-
1006:1006
networks
:
...
...
@@ -318,7 +318,7 @@ services:
retries
:
5
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image
:
image
:
registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0-beta
1
image
:
registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0-beta
2
profiles
:
-
prepull
opensandbox-execd-image
:
...
...
deploy/dev/docker-compose.yml
View file @
9d5a8777
...
...
@@ -237,7 +237,7 @@ services:
retries
:
3
fastgpt-agent-sandbox-proxy
:
container_name
:
fastgpt-agent-sandbox-proxy
image
:
ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0-beta
1
image
:
ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0-beta
2
ports
:
-
1006:1006
networks
:
...
...
@@ -318,7 +318,7 @@ services:
retries
:
5
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image
:
image
:
ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0-beta
1
image
:
ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0-beta
2
profiles
:
-
prepull
opensandbox-execd-image
:
...
...
projects/app/src/pageComponents/chat/SandboxEditor/components/EditorContent.tsx
View file @
9d5a8777
...
...
@@ -218,17 +218,6 @@ const EditorContent = ({
});
}
);
// 失去焦点时自动保存脏文件
editor
.
onDidBlurEditorText
(()
=>
{
if
(
!
canWrite
)
return
;
const
files
=
openedFilesRef
.
current
;
if
(
!
files
)
return
;
const
currentFile
=
files
.
find
((
f
)
=>
f
.
path
===
activeFilePath
);
if
(
currentFile
?.
isDirty
)
{
saveFile
(
activeFilePath
);
}
});
}
}
onChange=
{
(
value
)
=>
{
if
(
!
canWrite
)
return
;
...
...
projects/app/src/pageComponents/chat/SandboxEditor/hook.tsx
View file @
9d5a8777
...
...
@@ -941,7 +941,7 @@ export const useSandboxFileStore = ({
}
}
, [canWrite, openedFilesRef, rpcCall, toast, t]);
//
1.5 秒
防抖自动保存脏文件
//
500ms
防抖自动保存脏文件
useEffect(() =
>
{
const
dirtyFiles
=
openedFiles
.
filter
((
f
)
=>
f
.
isDirty
&&
!
f
.
isBinary
&&
!
f
.
isUnknown
);
if
(
dirtyFiles
.
length
===
0
)
return
;
...
...
@@ -950,7 +950,7 @@ export const useSandboxFileStore = ({
dirtyFiles
.
forEach
((
f
)
=>
{
saveFile
(
f
.
path
);
});
},
1
500
);
},
500
);
return
()
=>
clearTimeout
(
timer
);
}
, [openedFiles, saveFile]);
...
...
projects/app/src/pageComponents/dashboard/skill/detail/Content.tsx
View file @
9d5a8777
...
...
@@ -29,7 +29,7 @@ const Content = () => {
pt=
{
'16px'
}
pb=
{
'16px'
}
pr=
{
'16px'
}
pl=
{
'8px'
}
pl=
{
0
}
>
{
sandboxState
===
'failed'
?
(
<
SandboxError
/>
...
...
projects/app/src/pageComponents/dashboard/skill/detail/Header.tsx
View file @
9d5a8777
...
...
@@ -36,8 +36,6 @@ const EditResourceModal = dynamic(() => import('@/components/common/Modal/EditRe
const
ConfigPerModal
=
dynamic
(()
=>
import
(
'@/components/support/permission/ConfigPerModal'
));
export
const
HeaderContext
=
createContext
<
{
savingAll
:
boolean
;
setSavingAll
:
React
.
Dispatch
<
React
.
SetStateAction
<
boolean
>>
;
editedSkill
:
EditResourceInfoFormType
|
undefined
;
setEditedSkill
:
React
.
Dispatch
<
React
.
SetStateAction
<
EditResourceInfoFormType
|
undefined
>>
;
showPermModal
:
boolean
;
...
...
@@ -55,19 +53,15 @@ export const HeaderContext = createContext<{
)
=>
Promise
<
any
>
;
onExportSkill
:
(
skillId
:
string
,
skillName
:
string
)
=>
Promise
<
any
>
;
onSaveDeploy
:
(
props
:
{
skillId
:
string
;
versionName
:
string
})
=>
Promise
<
any
>
;
handlePublishClick
:
()
=>
Promise
<
void
>
;
handlePublishClick
:
()
=>
void
;
}
|
null
>
(
null
);
export
const
HeaderProvider
=
({
children
}:
{
children
:
React
.
ReactNode
})
=>
{
const
{
t
}
=
useTranslation
();
const
router
=
useRouter
();
const
{
refreshSkillDetail
,
saveAllRef
}
=
useContextSelector
(
SkillDetailContext
,
(
v
)
=>
({
refreshSkillDetail
:
v
.
refreshSkillDetail
,
saveAllRef
:
v
.
saveAllRef
}));
const
refreshSkillDetail
=
useContextSelector
(
SkillDetailContext
,
(
v
)
=>
v
.
refreshSkillDetail
);
const
[
savingAll
,
setSavingAll
]
=
useState
(
false
);
const
[
editedSkill
,
setEditedSkill
]
=
useState
<
EditResourceInfoFormType
>
();
const
[
showPermModal
,
setShowPermModal
]
=
useState
(
false
);
...
...
@@ -128,25 +122,13 @@ export const HeaderProvider = ({ children }: { children: React.ReactNode }) => {
onClose
:
onClosePublishModal
}
=
useDisclosure
();
const
handlePublishClick
=
async
()
=>
{
try
{
setSavingAll
(
true
);
if
(
saveAllRef
&&
saveAllRef
.
current
)
{
await
saveAllRef
.
current
();
}
onOpenPublishModal
();
}
catch
(
error
)
{
console
.
error
(
'Save all before publish failed:'
,
error
);
}
finally
{
setSavingAll
(
false
);
}
const
handlePublishClick
=
()
=>
{
onOpenPublishModal
();
};
return
(
<
HeaderContext
.
Provider
value=
{
{
savingAll
,
setSavingAll
,
editedSkill
,
setEditedSkill
,
showPermModal
,
...
...
@@ -279,7 +261,7 @@ export const LeftHeader = () => {
justifyContent=
{
'space-between'
}
gap=
{
'8px'
}
pl=
{
'24px'
}
pr=
{
0
}
pr=
{
'8px'
}
bg=
{
'transparent'
}
userSelect=
{
'none'
}
>
...
...
@@ -351,7 +333,7 @@ export const LeftHeader = () => {
export
const
RightHeader
=
()
=>
{
const
{
t
}
=
useTranslation
();
const
{
handlePublishClick
,
isSaving
,
savingAll
}
=
useHeader
();
const
{
handlePublishClick
,
isSaving
}
=
useHeader
();
return
(
<
SkillHistoriesPopover
...
...
@@ -361,7 +343,7 @@ export const RightHeader = () => {
h=
{
'34px'
}
px=
{
'14px'
}
variant=
{
'primary'
}
isLoading=
{
isSaving
||
savingAll
}
isLoading=
{
isSaving
}
onClick=
{
handlePublishClick
}
>
{
t
(
'common:Publish'
)
}
...
...
@@ -373,10 +355,15 @@ export const RightHeader = () => {
export
const
HeaderDialogs
=
()
=>
{
const
{
t
}
=
useTranslation
();
const
{
skillDetail
,
refreshSkillDetail
}
=
useContextSelector
(
SkillDetailContext
,
(
v
)
=>
({
skillDetail
:
v
.
skillDetail
,
refreshSkillDetail
:
v
.
refreshSkillDetail
}));
const
{
skillDetail
,
refreshSkillDetail
,
saveAllRef
}
=
useContextSelector
(
SkillDetailContext
,
(
v
)
=>
({
skillDetail
:
v
.
skillDetail
,
refreshSkillDetail
:
v
.
refreshSkillDetail
,
saveAllRef
:
v
.
saveAllRef
})
);
const
[
isConfirmingPublish
,
setIsConfirmingPublish
]
=
useState
(
false
);
const
{
editedSkill
,
...
...
@@ -399,11 +386,17 @@ export const HeaderDialogs = () => {
{
isPublishModalOpen
&&
(
<
SaveAndPublishModal
title=
{
t
(
'common:Publish'
)
}
isLoading=
{
isSaving
}
isLoading=
{
isSaving
||
isConfirmingPublish
}
onClose=
{
onPublishModalClose
}
onConfirm=
{
async
(
versionName
)
=>
{
await
onSaveDeploy
({
skillId
:
skillDetail
.
_id
,
versionName
});
onPublishModalClose
();
try
{
setIsConfirmingPublish
(
true
);
await
saveAllRef
.
current
?.();
await
onSaveDeploy
({
skillId
:
skillDetail
.
_id
,
versionName
});
onPublishModalClose
();
}
finally
{
setIsConfirmingPublish
(
false
);
}
}
}
/>
)
}
...
...
projects/app/src/pageComponents/dashboard/skill/detail/preview/useSkillChatTest.tsx
View file @
9d5a8777
...
...
@@ -110,8 +110,8 @@ export const useSkillChatTest = ({
pl=
{
'16px'
}
pr=
{
0
}
maxW=
{
'100%'
}
boxBodyProps=
{
{
px
:
0
,
maxW
:
'100%'
,
mx
:
0
}
}
inputBodyProps=
{
{
maxW
:
'100%'
,
mx
:
0
,
px
:
0
,
pl
:
0
,
pr
:
0
}
}
boxBodyProps=
{
{
px
:
0
,
pr
:
'8px'
,
maxW
:
'100%'
,
mx
:
0
}
}
inputBodyProps=
{
{
maxW
:
'100%'
,
mx
:
0
,
px
:
0
,
pl
:
0
,
pr
:
'8px'
}
}
EmptyState=
{
<
Flex
flex=
{
1
}
...
...
projects/app/src/pages/skill/detail.tsx
View file @
9d5a8777
...
...
@@ -21,7 +21,7 @@ const MainLayout = () => {
return
(
<
HeaderProvider
>
<
Flex
h=
{
'100%'
}
bg=
{
'myGray.25'
}
overflow=
{
'hidden'
}
gap=
{
'8px'
}
>
<
Flex
h=
{
'100%'
}
bg=
{
'myGray.25'
}
overflow=
{
'hidden'
}
>
{
/* 左栏: 488px 预览对话区域 */
}
<
Flex
w=
{
'488px'
}
...
...
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