|
|
|
@ -1,6 +1,6 @@
|
|
|
|
import { fetchNodeInspectVars } from '@/service/workflow'
|
|
|
|
import { fetchNodeInspectVars } from '@/service/workflow'
|
|
|
|
import { useWorkflowStore } from '../store'
|
|
|
|
import { useWorkflowStore } from '../store'
|
|
|
|
import type { ValueSelector, VarType } from '../types'
|
|
|
|
import type { ValueSelector } from '../types'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
useConversationVarValues,
|
|
|
|
useConversationVarValues,
|
|
|
|
useDeleteAllInspectorVars,
|
|
|
|
useDeleteAllInspectorVars,
|
|
|
|
@ -18,12 +18,12 @@ const useInspectVarsCrud = () => {
|
|
|
|
appId,
|
|
|
|
appId,
|
|
|
|
nodesWithInspectVars,
|
|
|
|
nodesWithInspectVars,
|
|
|
|
setNodeInspectVars,
|
|
|
|
setNodeInspectVars,
|
|
|
|
getInspectVar,
|
|
|
|
|
|
|
|
setInspectVarValue,
|
|
|
|
setInspectVarValue,
|
|
|
|
renameInspectVarName: renameInspectVarNameInStore,
|
|
|
|
renameInspectVarName: renameInspectVarNameInStore,
|
|
|
|
deleteAllInspectVars: deleteAllInspectVarsInStore,
|
|
|
|
deleteAllInspectVars: deleteAllInspectVarsInStore,
|
|
|
|
deleteNodeInspectVars: deleteNodeInspectVarsInStore,
|
|
|
|
deleteNodeInspectVars: deleteNodeInspectVarsInStore,
|
|
|
|
deleteInspectVar: deleteInspectVarInStore,
|
|
|
|
deleteInspectVar: deleteInspectVarInStore,
|
|
|
|
|
|
|
|
isInspectVarEdited,
|
|
|
|
getLastRunVar,
|
|
|
|
getLastRunVar,
|
|
|
|
} = workflowStore.getState()
|
|
|
|
} = workflowStore.getState()
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,21 +90,17 @@ const useInspectVarsCrud = () => {
|
|
|
|
renameInspectVarNameInStore(nodeId, varId, selector)
|
|
|
|
renameInspectVarNameInStore(nodeId, varId, selector)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const editInspectVarValueType = (varId: string, valueType: VarType) => {
|
|
|
|
const editInspectVarValueType = (nodeId: string) => {
|
|
|
|
console.log('edit var value type', varId, valueType)
|
|
|
|
deleteNodeInspectorVars(nodeId)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isInspectVarEdited = (nodeId: string, key: string) => {
|
|
|
|
|
|
|
|
return getInspectVar(nodeId, key) !== getLastRunVar(nodeId, key)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const resetToLastRunVar = (nodeId: string, key: string) => {
|
|
|
|
const resetToLastRunVar = (nodeId: string, key: string) => {
|
|
|
|
const lastRunVar = getLastRunVar(nodeId, key)
|
|
|
|
const lastRunVar = getLastRunVar(nodeId, key)
|
|
|
|
if (lastRunVar)
|
|
|
|
if (lastRunVar)
|
|
|
|
setInspectVarValue(nodeId, key, lastRunVar)
|
|
|
|
editInspectVarValue(nodeId, key, lastRunVar)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log(conversationVars, systemVars)
|
|
|
|
// console.log(conversationVars, systemVars)
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
conversationVars: conversationVars || [],
|
|
|
|
conversationVars: conversationVars || [],
|
|
|
|
|