{`Test Run${!workflowRunningData?.result.sequence_number ? '' : `#${workflowRunningData?.result.sequence_number}`}`}
- {showInputsPanel && workflowRunningData?.result?.status !== WorkflowRunningStatus.Running && (
-
handleRunSetting(true)}>
-
-
- )}
+
handleCancelDebugAndPreviewPanel()}>
+
+
@@ -107,7 +111,7 @@ const WorkflowPreview = () => {
'grow bg-white h-0 overflow-y-auto rounded-b-2xl',
(currentTab === 'RESULT' || currentTab === 'TRACING') && '!bg-gray-50',
)}>
- {currentTab === 'INPUT' && (
+ {currentTab === 'INPUT' && showInputsPanel && (
switchTab('RESULT')} />
)}
{currentTab === 'RESULT' && (
diff --git a/web/app/components/workflow/store.ts b/web/app/components/workflow/store.ts
index 9186a610f7..e7db357fb7 100644
--- a/web/app/components/workflow/store.ts
+++ b/web/app/components/workflow/store.ts
@@ -23,9 +23,9 @@ type Shape = {
appId: string
panelWidth: number
workflowRunningData?: WorkflowRunningData
- setWorkflowRunningData: (workflowData: WorkflowRunningData) => void
+ setWorkflowRunningData: (workflowData?: WorkflowRunningData) => void
historyWorkflowData?: HistoryWorkflowData
- setHistoryWorkflowData: (historyWorkflowData: HistoryWorkflowData) => void
+ setHistoryWorkflowData: (historyWorkflowData?: HistoryWorkflowData) => void
showRunHistory: boolean
setShowRunHistory: (showRunHistory: boolean) => void
showFeaturesPanel: boolean
@@ -68,6 +68,8 @@ type Shape = {
setClipboardElements: (clipboardElements: Node[]) => void
shortcutsDisabled: boolean
setShortcutsDisabled: (shortcutsDisabled: boolean) => void
+ showDebugAndPreviewPanel: boolean
+ setShowDebugAndPreviewPanel: (showDebugAndPreviewPanel: boolean) => void
}
export const createWorkflowStore = () => {
@@ -117,6 +119,8 @@ export const createWorkflowStore = () => {
setClipboardElements: clipboardElements => set(() => ({ clipboardElements })),
shortcutsDisabled: false,
setShortcutsDisabled: shortcutsDisabled => set(() => ({ shortcutsDisabled })),
+ showDebugAndPreviewPanel: false,
+ setShowDebugAndPreviewPanel: showDebugAndPreviewPanel => set(() => ({ showDebugAndPreviewPanel })),
}))
}
diff --git a/web/app/components/workflow/types.ts b/web/app/components/workflow/types.ts
index aa4238b27c..50d6922c9c 100644
--- a/web/app/components/workflow/types.ts
+++ b/web/app/components/workflow/types.ts
@@ -1,6 +1,7 @@
import type {
Edge as ReactFlowEdge,
Node as ReactFlowNode,
+ Viewport,
} from 'reactflow'
import type { TransferMethod } from '@/types/app'
import type { ToolDefaultValue } from '@/app/components/workflow/block-selector/types'
@@ -60,6 +61,12 @@ export type NodePanelProps = {
}
export type Edge = ReactFlowEdge
+export type WorkflowDataUpdator = {
+ nodes: Node[]
+ edges: Edge[]
+ viewport: Viewport
+}
+
export type ValueSelector = string[] // [nodeId, key | obj key path]
export type Variable = {
diff --git a/web/app/components/workflow/utils.ts b/web/app/components/workflow/utils.ts
index 40867e4637..6a5f0d9e47 100644
--- a/web/app/components/workflow/utils.ts
+++ b/web/app/components/workflow/utils.ts
@@ -79,7 +79,9 @@ const getCycleEdges = (nodes: Node[], edges: Edge[]) => {
return cycleEdges
}
-export const initialNodes = (nodes: Node[], edges: Edge[]) => {
+export const initialNodes = (originNodes: Node[], originEdges: Edge[]) => {
+ const nodes = cloneDeep(originNodes)
+ const edges = cloneDeep(originEdges)
const firstNode = nodes[0]
if (!firstNode?.position) {
@@ -121,7 +123,9 @@ export const initialNodes = (nodes: Node[], edges: Edge[]) => {
})
}
-export const initialEdges = (edges: Edge[], nodes: Node[]) => {
+export const initialEdges = (originEdges: Edge[], originNodes: Node[]) => {
+ const nodes = cloneDeep(originNodes)
+ const edges = cloneDeep(originEdges)
let selectedNode: Node | null = null
const nodesMap = nodes.reduce((acc, node) => {
acc[node.id] = node
diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts
index 0d1ced6120..d6997164aa 100644
--- a/web/i18n/en-US/workflow.ts
+++ b/web/i18n/en-US/workflow.ts
@@ -49,6 +49,8 @@ const translation = {
processData: 'Process Data',
input: 'Input',
output: 'Output',
+ viewOnly: 'View Only',
+ showRunHistory: 'Show Run History',
},
errorMsg: {
fieldRequired: '{{field}} is required',
diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts
index 2771f8c1ca..4bb75bf3bd 100644
--- a/web/i18n/zh-Hans/workflow.ts
+++ b/web/i18n/zh-Hans/workflow.ts
@@ -49,6 +49,8 @@ const translation = {
processData: '数据处理',
input: '输入',
output: '输出',
+ viewOnly: '只读',
+ showRunHistory: '显示运行历史',
},
errorMsg: {
fieldRequired: '{{field}} 不能为空',