mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
fix: workflow route
This commit is contained in:
parent
ac40eb8d87
commit
bd205f63cc
@ -122,12 +122,12 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
|
|||||||
})
|
})
|
||||||
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
|
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
|
||||||
if (!isCurrentWorkspaceManager) {
|
if (!isCurrentWorkspaceManager) {
|
||||||
push(`/app/${newApp.id}/'overview'`)
|
push(`/app/${newApp.id}/overview`)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (newApp.mode === 'workflow' || newApp.mode === 'advanced-chat')
|
if (newApp.mode === 'workflow' || newApp.mode === 'advanced-chat')
|
||||||
push(`/app/${newApp.id}/'workflow'`)
|
push(`/app/${newApp.id}/workflow`)
|
||||||
push(`/app/${newApp.id}/'configuration'`)
|
push(`/app/${newApp.id}/configuration`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@ -74,12 +74,13 @@ const AppForm = ({
|
|||||||
onHide()
|
onHide()
|
||||||
mutateApps()
|
mutateApps()
|
||||||
if (!isCurrentWorkspaceManager) {
|
if (!isCurrentWorkspaceManager) {
|
||||||
router.push(`/app/${app.id}/'overview'`)
|
router.push(`/app/${app.id}/overview`)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
||||||
router.push(`/app/${app.id}/'workflow'`)
|
router.push(`/app/${app.id}/workflow`)
|
||||||
router.push(`/app/${app.id}/'configuration'`)
|
else
|
||||||
|
router.push(`/app/${app.id}/configuration`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@ -68,12 +68,12 @@ const CreateFromDSLModal = ({ show, onSuccess, onClose }: CreateFromDSLModalProp
|
|||||||
notify({ type: 'success', message: t('app.newApp.appCreated') })
|
notify({ type: 'success', message: t('app.newApp.appCreated') })
|
||||||
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
|
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
|
||||||
if (!isCurrentWorkspaceManager) {
|
if (!isCurrentWorkspaceManager) {
|
||||||
router.push(`/app/${app.id}/'overview'`)
|
router.push(`/app/${app.id}/overview`)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
||||||
router.push(`/app/${app.id}/'workflow'`)
|
router.push(`/app/${app.id}/workflow`)
|
||||||
router.push(`/app/${app.id}/'configuration'`)
|
router.push(`/app/${app.id}/configuration`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@ -90,12 +90,12 @@ const Apps = ({
|
|||||||
})
|
})
|
||||||
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
|
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
|
||||||
if (!isCurrentWorkspaceManager) {
|
if (!isCurrentWorkspaceManager) {
|
||||||
router.push(`/app/${app.id}/'overview'`)
|
router.push(`/app/${app.id}/overview`)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
|
||||||
router.push(`/app/${app.id}/'workflow'`)
|
router.push(`/app/${app.id}/workflow`)
|
||||||
router.push(`/app/${app.id}/'configuration'`)
|
router.push(`/app/${app.id}/configuration`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@ -55,11 +55,14 @@ export const useWorkflow = () => {
|
|||||||
} = store.getState()
|
} = store.getState()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
|
||||||
const newNodes = produce(getNodes(), (draft) => {
|
const nodes = getNodes()
|
||||||
|
|
||||||
|
const newNodes = produce(nodes, (draft) => {
|
||||||
const currentNode = draft.find(n => n.id === node.id)!
|
const currentNode = draft.find(n => n.id === node.id)!
|
||||||
|
|
||||||
currentNode.position = node.position
|
currentNode.position = node.position
|
||||||
})
|
})
|
||||||
|
|
||||||
setNodes(newNodes)
|
setNodes(newNodes)
|
||||||
}, [store])
|
}, [store])
|
||||||
|
|
||||||
|
|||||||
@ -47,8 +47,6 @@ const Workflow: FC<WorkflowProps> = memo(({
|
|||||||
const [edges, _, onEdgesChange] = useEdgesState(initialEdges)
|
const [edges, _, onEdgesChange] = useEdgesState(initialEdges)
|
||||||
// const nodesInitialized = useNodesInitialized()
|
// const nodesInitialized = useNodesInitialized()
|
||||||
|
|
||||||
console.log(nodes)
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
// handleLayout,
|
// handleLayout,
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user