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