mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-05 15:00:38 +08:00
trigger state binding
This commit is contained in:
parent
cc85e53ffc
commit
f126f98514
@ -26,7 +26,7 @@ const Left = ({ handleMenuClick }: Props) => {
|
||||
// const bottomPanelWidth = useStore(s => s.bottomPanelWidth)
|
||||
// const setShowVariableInspectPanel = useStore(s => s.setShowVariableInspectPanel)
|
||||
const {
|
||||
clearCurrentVars,
|
||||
deleteAllInspectorVars,
|
||||
} = useCurrentVars()
|
||||
|
||||
// TODO node selection
|
||||
@ -37,7 +37,7 @@ const Left = ({ handleMenuClick }: Props) => {
|
||||
{/* header */}
|
||||
<div className='flex shrink-0 items-center justify-between gap-1 pl-4 pr-1 pt-2'>
|
||||
<div className='system-sm-semibold-uppercase truncate text-text-primary'>{t('workflow.debug.variableInspect.title')}</div>
|
||||
<Button variant='ghost' size='small' className='shrink-0' onClick={clearCurrentVars}>{t('workflow.debug.variableInspect.clearAll')}</Button>
|
||||
<Button variant='ghost' size='small' className='shrink-0' onClick={deleteAllInspectorVars}>{t('workflow.debug.variableInspect.clearAll')}</Button>
|
||||
</div>
|
||||
{/* content */}
|
||||
<div className='grow overflow-y-auto py-1'>
|
||||
|
@ -21,13 +21,21 @@ const VariableInspectTrigger: FC = () => {
|
||||
return false
|
||||
if (workflowRunningData.result.status === WorkflowRunningStatus.Running)
|
||||
return true
|
||||
// TODO: step running state use data in inspector
|
||||
return (workflowRunningData.tracing || []).some(tracingData => tracingData.status === NodeRunningStatus.Running)
|
||||
}, [workflowRunningData])
|
||||
|
||||
const environmentVariables = useStore(s => s.environmentVariables)
|
||||
const {
|
||||
nodesWithInspectVars: currentVars,
|
||||
clearCurrentVars,
|
||||
conversationVars,
|
||||
systemVars,
|
||||
nodesWithInspectVars,
|
||||
deleteAllInspectorVars,
|
||||
} = useCurrentVars()
|
||||
const currentVars = useMemo(() => {
|
||||
const allVars = [...environmentVariables, ...conversationVars, ...systemVars, ...nodesWithInspectVars]
|
||||
return allVars
|
||||
}, [conversationVars, systemVars, nodesWithInspectVars])
|
||||
|
||||
// ##TODD stop handle
|
||||
|
||||
@ -54,7 +62,7 @@ const VariableInspectTrigger: FC = () => {
|
||||
</div>
|
||||
<div
|
||||
className='system-xs-medium flex h-6 cursor-pointer items-center rounded-md border-[0.5px] border-effects-highlight bg-components-actionbar-bg px-1 text-text-tertiary shadow-lg backdrop-blur-sm hover:bg-components-actionbar-bg-accent hover:text-text-accent'
|
||||
onClick={clearCurrentVars}
|
||||
onClick={deleteAllInspectorVars}
|
||||
>
|
||||
{t('workflow.debug.variableInspect.trigger.clear')}
|
||||
</div>
|
||||
|
@ -198,7 +198,7 @@ const ValueContent = () => {
|
||||
...FILE_EXTS[SupportUploadFileTypes.video],
|
||||
],
|
||||
allowed_file_upload_methods: [TransferMethod.local_file, TransferMethod.remote_url],
|
||||
number_limits: current.var_type === 'file' ? 1 : (fileFeature as any).fileUploadConfig.workflow_file_upload_limit,
|
||||
number_limits: current.var_type === 'file' ? 1 : (fileFeature as any).fileUploadConfig?.workflow_file_upload_limit || 5,
|
||||
fileUploadConfig: (fileFeature as any).fileUploadConfig,
|
||||
}}
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user