|
|
|
@ -20,13 +20,11 @@ const useInspectVarsCrud = () => {
|
|
|
|
const nodesWithInspectVars = useStore(s => s.nodesWithInspectVars)
|
|
|
|
const nodesWithInspectVars = useStore(s => s.nodesWithInspectVars)
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
appId,
|
|
|
|
appId,
|
|
|
|
getNodeInspectVars,
|
|
|
|
|
|
|
|
setNodeInspectVars,
|
|
|
|
setNodeInspectVars,
|
|
|
|
setInspectVarValue,
|
|
|
|
setInspectVarValue,
|
|
|
|
getVarId,
|
|
|
|
getVarId,
|
|
|
|
renameInspectVarName: renameInspectVarNameInStore,
|
|
|
|
renameInspectVarName: renameInspectVarNameInStore,
|
|
|
|
deleteAllInspectVars: deleteAllInspectVarsInStore,
|
|
|
|
deleteAllInspectVars: deleteAllInspectVarsInStore,
|
|
|
|
hasNodeInspectVars,
|
|
|
|
|
|
|
|
deleteNodeInspectVars: deleteNodeInspectVarsInStore,
|
|
|
|
deleteNodeInspectVars: deleteNodeInspectVarsInStore,
|
|
|
|
deleteInspectVar: deleteInspectVarInStore,
|
|
|
|
deleteInspectVar: deleteInspectVarInStore,
|
|
|
|
isInspectVarEdited,
|
|
|
|
isInspectVarEdited,
|
|
|
|
@ -43,6 +41,15 @@ const useInspectVarsCrud = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const { mutate: doEditInspectorVar } = useEditInspectorVar(appId)
|
|
|
|
const { mutate: doEditInspectorVar } = useEditInspectorVar(appId)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getNodeInspectVars = useCallback((nodeId: string) => {
|
|
|
|
|
|
|
|
const node = nodesWithInspectVars.find(node => node.nodeId === nodeId)
|
|
|
|
|
|
|
|
return node
|
|
|
|
|
|
|
|
}, [nodesWithInspectVars])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const hasNodeInspectVars = useCallback((nodeId: string) => {
|
|
|
|
|
|
|
|
return !!getNodeInspectVars(nodeId)
|
|
|
|
|
|
|
|
}, [getNodeInspectVars])
|
|
|
|
|
|
|
|
|
|
|
|
const fetchInspectVarValue = async (selector: ValueSelector) => {
|
|
|
|
const fetchInspectVarValue = async (selector: ValueSelector) => {
|
|
|
|
const nodeId = selector[0]
|
|
|
|
const nodeId = selector[0]
|
|
|
|
const isSystemVar = nodeId === 'sys'
|
|
|
|
const isSystemVar = nodeId === 'sys'
|
|
|
|
@ -131,6 +138,7 @@ const useInspectVarsCrud = () => {
|
|
|
|
conversationVars: conversationVars || [],
|
|
|
|
conversationVars: conversationVars || [],
|
|
|
|
systemVars: systemVars || [],
|
|
|
|
systemVars: systemVars || [],
|
|
|
|
nodesWithInspectVars,
|
|
|
|
nodesWithInspectVars,
|
|
|
|
|
|
|
|
hasNodeInspectVars,
|
|
|
|
fetchInspectVarValue,
|
|
|
|
fetchInspectVarValue,
|
|
|
|
editInspectVarValue,
|
|
|
|
editInspectVarValue,
|
|
|
|
renameInspectVarName,
|
|
|
|
renameInspectVarName,
|
|
|
|
|