mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
Bugfix/AgentflowV2 State (#4512)
* add persistence state, http node variables, custom function flow state * update marketplace templates
This commit is contained in:
@@ -157,7 +157,8 @@ class CustomFunction_Agentflow implements INode {
|
|||||||
chatflowId: options.chatflowid,
|
chatflowId: options.chatflowid,
|
||||||
sessionId: options.sessionId,
|
sessionId: options.sessionId,
|
||||||
chatId: options.chatId,
|
chatId: options.chatId,
|
||||||
input
|
input,
|
||||||
|
state: newState
|
||||||
}
|
}
|
||||||
|
|
||||||
let sandbox: any = {
|
let sandbox: any = {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class HTTP_Agentflow implements INode {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'HTTP'
|
this.label = 'HTTP'
|
||||||
this.name = 'httpAgentflow'
|
this.name = 'httpAgentflow'
|
||||||
this.version = 1.0
|
this.version = 1.1
|
||||||
this.type = 'HTTP'
|
this.type = 'HTTP'
|
||||||
this.category = 'Agent Flows'
|
this.category = 'Agent Flows'
|
||||||
this.description = 'Send a HTTP request'
|
this.description = 'Send a HTTP request'
|
||||||
@@ -72,6 +72,7 @@ class HTTP_Agentflow implements INode {
|
|||||||
label: 'Headers',
|
label: 'Headers',
|
||||||
name: 'headers',
|
name: 'headers',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
acceptVariable: true,
|
||||||
array: [
|
array: [
|
||||||
{
|
{
|
||||||
label: 'Key',
|
label: 'Key',
|
||||||
@@ -83,7 +84,8 @@ class HTTP_Agentflow implements INode {
|
|||||||
label: 'Value',
|
label: 'Value',
|
||||||
name: 'value',
|
name: 'value',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: ''
|
default: '',
|
||||||
|
acceptVariable: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
optional: true
|
optional: true
|
||||||
@@ -92,6 +94,7 @@ class HTTP_Agentflow implements INode {
|
|||||||
label: 'Query Params',
|
label: 'Query Params',
|
||||||
name: 'queryParams',
|
name: 'queryParams',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
acceptVariable: true,
|
||||||
array: [
|
array: [
|
||||||
{
|
{
|
||||||
label: 'Key',
|
label: 'Key',
|
||||||
@@ -103,7 +106,8 @@ class HTTP_Agentflow implements INode {
|
|||||||
label: 'Value',
|
label: 'Value',
|
||||||
name: 'value',
|
name: 'value',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: ''
|
default: '',
|
||||||
|
acceptVariable: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
optional: true
|
optional: true
|
||||||
@@ -147,6 +151,7 @@ class HTTP_Agentflow implements INode {
|
|||||||
label: 'Body',
|
label: 'Body',
|
||||||
name: 'body',
|
name: 'body',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
acceptVariable: true,
|
||||||
show: {
|
show: {
|
||||||
bodyType: ['xWwwFormUrlencoded', 'formData']
|
bodyType: ['xWwwFormUrlencoded', 'formData']
|
||||||
},
|
},
|
||||||
@@ -161,7 +166,8 @@ class HTTP_Agentflow implements INode {
|
|||||||
label: 'Value',
|
label: 'Value',
|
||||||
name: 'value',
|
name: 'value',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: ''
|
default: '',
|
||||||
|
acceptVariable: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
optional: true
|
optional: true
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Start_Agentflow implements INode {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Start'
|
this.label = 'Start'
|
||||||
this.name = 'startAgentflow'
|
this.name = 'startAgentflow'
|
||||||
this.version = 1.0
|
this.version = 1.1
|
||||||
this.type = 'Start'
|
this.type = 'Start'
|
||||||
this.category = 'Agent Flows'
|
this.category = 'Agent Flows'
|
||||||
this.description = 'Starting point of the agentflow'
|
this.description = 'Starting point of the agentflow'
|
||||||
@@ -153,6 +153,13 @@ class Start_Agentflow implements INode {
|
|||||||
optional: true
|
optional: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Persist State',
|
||||||
|
name: 'startPersistState',
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'Persist the state in the same session',
|
||||||
|
optional: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -161,6 +168,7 @@ class Start_Agentflow implements INode {
|
|||||||
const _flowState = nodeData.inputs?.startState as string
|
const _flowState = nodeData.inputs?.startState as string
|
||||||
const startInputType = nodeData.inputs?.startInputType as string
|
const startInputType = nodeData.inputs?.startInputType as string
|
||||||
const startEphemeralMemory = nodeData.inputs?.startEphemeralMemory as boolean
|
const startEphemeralMemory = nodeData.inputs?.startEphemeralMemory as boolean
|
||||||
|
const startPersistState = nodeData.inputs?.startPersistState as boolean
|
||||||
|
|
||||||
let flowStateArray = []
|
let flowStateArray = []
|
||||||
if (_flowState) {
|
if (_flowState) {
|
||||||
@@ -176,6 +184,13 @@ class Start_Agentflow implements INode {
|
|||||||
flowState[state.key] = state.value
|
flowState[state.key] = state.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const runtimeState = options.agentflowRuntime?.state as ICommonObject
|
||||||
|
if (startPersistState === true && runtimeState && Object.keys(runtimeState).length) {
|
||||||
|
for (const state in runtimeState) {
|
||||||
|
flowState[state] = runtimeState[state]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const inputData: ICommonObject = {}
|
const inputData: ICommonObject = {}
|
||||||
const outputData: ICommonObject = {}
|
const outputData: ICommonObject = {}
|
||||||
|
|
||||||
@@ -202,6 +217,10 @@ class Start_Agentflow implements INode {
|
|||||||
outputData.ephemeralMemory = true
|
outputData.ephemeralMemory = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (startPersistState) {
|
||||||
|
outputData.persistState = true
|
||||||
|
}
|
||||||
|
|
||||||
const returnOutput = {
|
const returnOutput = {
|
||||||
id: nodeData.id,
|
id: nodeData.id,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -160,6 +160,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"id": "startAgentflow_0",
|
"id": "startAgentflow_0",
|
||||||
"label": "Start",
|
"label": "Start",
|
||||||
"version": 1,
|
"version": 1.1,
|
||||||
"name": "startAgentflow",
|
"name": "startAgentflow",
|
||||||
"type": "Start",
|
"type": "Start",
|
||||||
"color": "#7EE787",
|
"color": "#7EE787",
|
||||||
@@ -157,6 +157,15 @@
|
|||||||
],
|
],
|
||||||
"id": "startAgentflow_0-input-startState-array",
|
"id": "startAgentflow_0-input-startState-array",
|
||||||
"display": true
|
"display": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Persist State",
|
||||||
|
"name": "startPersistState",
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Persist the state in the same session",
|
||||||
|
"optional": true,
|
||||||
|
"id": "startAgentflow_0-input-startPersistState-boolean",
|
||||||
|
"display": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputAnchors": [],
|
"inputAnchors": [],
|
||||||
|
|||||||
@@ -1324,6 +1324,24 @@ export const executeAgentFlow = async ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the state is persistent, get the state from the previous execution
|
||||||
|
const startPersistState = nodes.find((node) => node.data.name === 'startAgentflow')?.data.inputs?.startPersistState
|
||||||
|
if (startPersistState === true && previousExecution) {
|
||||||
|
const previousExecutionData = (JSON.parse(previousExecution.executionData) as IAgentflowExecutedData[]) ?? []
|
||||||
|
|
||||||
|
let previousState = {}
|
||||||
|
if (Array.isArray(previousExecutionData) && previousExecutionData.length) {
|
||||||
|
for (const execData of previousExecutionData.reverse()) {
|
||||||
|
if (execData.data.state) {
|
||||||
|
previousState = execData.data.state
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
agentflowRuntime.state = previousState
|
||||||
|
}
|
||||||
|
|
||||||
// If the start input type is form input, get the form values from the previous execution (form values are persisted in the same session)
|
// If the start input type is form input, get the form values from the previous execution (form values are persisted in the same session)
|
||||||
if (startInputType === 'formInput' && previousExecution) {
|
if (startInputType === 'formInput' && previousExecution) {
|
||||||
const previousExecutionData = (JSON.parse(previousExecution.executionData) as IAgentflowExecutedData[]) ?? []
|
const previousExecutionData = (JSON.parse(previousExecution.executionData) as IAgentflowExecutedData[]) ?? []
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export const ArrayRenderer = ({ inputParam, data, disabled }) => {
|
|||||||
|
|
||||||
// Initialize array items and parameters when component mounts or data changes
|
// Initialize array items and parameters when component mounts or data changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const initialArrayItems = cloneDeep(data.inputs[inputParam.name]) || []
|
const initialArrayItems = data.inputs[inputParam.name] || []
|
||||||
setArrayItems(initialArrayItems)
|
setArrayItems(initialArrayItems)
|
||||||
|
|
||||||
// Calculate initial display parameters for each array item
|
// Calculate initial display parameters for each array item
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import {
|
|||||||
IconCopy,
|
IconCopy,
|
||||||
IconTrash,
|
IconTrash,
|
||||||
IconInfoCircle,
|
IconInfoCircle,
|
||||||
IconLoader
|
IconLoader,
|
||||||
|
IconAlertCircleFilled
|
||||||
} from '@tabler/icons-react'
|
} from '@tabler/icons-react'
|
||||||
import StopCircleIcon from '@mui/icons-material/StopCircle'
|
import StopCircleIcon from '@mui/icons-material/StopCircle'
|
||||||
import CancelIcon from '@mui/icons-material/Cancel'
|
import CancelIcon from '@mui/icons-material/Cancel'
|
||||||
@@ -51,11 +52,13 @@ const StyledNodeToolbar = styled(NodeToolbar)(({ theme }) => ({
|
|||||||
const AgentFlowNode = ({ data }) => {
|
const AgentFlowNode = ({ data }) => {
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
const customization = useSelector((state) => state.customization)
|
const customization = useSelector((state) => state.customization)
|
||||||
|
const canvas = useSelector((state) => state.canvas)
|
||||||
const ref = useRef(null)
|
const ref = useRef(null)
|
||||||
const updateNodeInternals = useUpdateNodeInternals()
|
const updateNodeInternals = useUpdateNodeInternals()
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
const [position, setPosition] = useState(0)
|
const [position, setPosition] = useState(0)
|
||||||
const [isHovered, setIsHovered] = useState(false)
|
const [isHovered, setIsHovered] = useState(false)
|
||||||
|
const [warningMessage, setWarningMessage] = useState('')
|
||||||
const { deleteNode, duplicateNode } = useContext(flowContext)
|
const { deleteNode, duplicateNode } = useContext(flowContext)
|
||||||
const [showInfoDialog, setShowInfoDialog] = useState(false)
|
const [showInfoDialog, setShowInfoDialog] = useState(false)
|
||||||
const [infoDialogProps, setInfoDialogProps] = useState({})
|
const [infoDialogProps, setInfoDialogProps] = useState({})
|
||||||
@@ -132,6 +135,28 @@ const AgentFlowNode = ({ data }) => {
|
|||||||
}
|
}
|
||||||
}, [data, ref, updateNodeInternals])
|
}, [data, ref, updateNodeInternals])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const nodeOutdatedMessage = (oldVersion, newVersion) =>
|
||||||
|
`Node version ${oldVersion} outdated\nUpdate to latest version ${newVersion}`
|
||||||
|
const nodeVersionEmptyMessage = (newVersion) => `Node outdated\nUpdate to latest version ${newVersion}`
|
||||||
|
|
||||||
|
const componentNode = canvas.componentNodes.find((nd) => nd.name === data.name)
|
||||||
|
if (componentNode) {
|
||||||
|
if (!data.version) {
|
||||||
|
setWarningMessage(nodeVersionEmptyMessage(componentNode.version))
|
||||||
|
} else if (data.version && componentNode.version > data.version) {
|
||||||
|
setWarningMessage(nodeOutdatedMessage(data.version, componentNode.version))
|
||||||
|
} else if (componentNode.badge === 'DEPRECATING') {
|
||||||
|
setWarningMessage(
|
||||||
|
componentNode?.deprecateMessage ??
|
||||||
|
'This node will be deprecated in the next release. Change to a new node tagged with NEW'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
setWarningMessage('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [canvas.componentNodes, data.name, data.version])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={ref} onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
|
<div ref={ref} onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
|
||||||
<StyledNodeToolbar>
|
<StyledNodeToolbar>
|
||||||
@@ -236,6 +261,24 @@ const AgentFlowNode = ({ data }) => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{warningMessage && (
|
||||||
|
<Tooltip placement='right-start' title={<span style={{ whiteSpace: 'pre-line' }}>{warningMessage}</span>}>
|
||||||
|
<Avatar
|
||||||
|
variant='rounded'
|
||||||
|
sx={{
|
||||||
|
...theme.typography.smallAvatar,
|
||||||
|
borderRadius: '50%',
|
||||||
|
background: 'white',
|
||||||
|
position: 'absolute',
|
||||||
|
top: -10,
|
||||||
|
left: -10
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconAlertCircleFilled color='orange' />
|
||||||
|
</Avatar>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
|
||||||
<Box sx={{ width: '100%' }}>
|
<Box sx={{ width: '100%' }}>
|
||||||
{!data.hideInput && (
|
{!data.hideInput && (
|
||||||
<Handle
|
<Handle
|
||||||
|
|||||||
@@ -1037,6 +1037,7 @@ const NodeInputHandler = ({
|
|||||||
variant='outlined'
|
variant='outlined'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
data.inputs[inputParam.name] = inputParam.codeExample
|
data.inputs[inputParam.name] = inputParam.codeExample
|
||||||
|
setReloadTimestamp(Date.now().toString())
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
See Example
|
See Example
|
||||||
@@ -1044,6 +1045,7 @@ const NodeInputHandler = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
key={`${reloadTimestamp}_${data.id}}`}
|
||||||
style={{
|
style={{
|
||||||
marginTop: '10px',
|
marginTop: '10px',
|
||||||
border: '1px solid',
|
border: '1px solid',
|
||||||
|
|||||||
Reference in New Issue
Block a user