diff --git a/web/app/components/workflow/nodes/_base/components/field.tsx b/web/app/components/workflow/nodes/_base/components/field.tsx index 2c3f9ac166..8a4dcd70e7 100644 --- a/web/app/components/workflow/nodes/_base/components/field.tsx +++ b/web/app/components/workflow/nodes/_base/components/field.tsx @@ -5,7 +5,7 @@ import cn from 'classnames' import { useBoolean } from 'ahooks' import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general' import TooltipPlus from '@/app/components/base/tooltip-plus' -import { ChevronDown, ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows' +import { ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows' type Props = { title: string tooltip?: string @@ -26,10 +26,11 @@ const Filed: FC = ({ const [fold, { toggle: toggleFold, }] = useBoolean(true) - const FoldHandler = fold ? ChevronRight : ChevronDown return ( -
-
+
+
supportFold && toggleFold()} + className='flex justify-between items-center'>
{title}
{tooltip && ( @@ -45,7 +46,7 @@ const Filed: FC = ({
{operations &&
{operations}
} {supportFold && ( - + )}
diff --git a/web/app/components/workflow/nodes/start/components/var-item.tsx b/web/app/components/workflow/nodes/start/components/var-item.tsx index da30bc4b30..f94bb68511 100644 --- a/web/app/components/workflow/nodes/start/components/var-item.tsx +++ b/web/app/components/workflow/nodes/start/components/var-item.tsx @@ -13,15 +13,17 @@ import ConfigVarModal from '@/app/components/app/configuration/config-var/config type Props = { readonly: boolean payload: InputVar - onChange: (item: InputVar, moreInfo?: MoreInfo) => void - onRemove: () => void + onChange?: (item: InputVar, moreInfo?: MoreInfo) => void + onRemove?: () => void + rightContent?: JSX.Element } const VarItem: FC = ({ readonly, payload, - onChange, - onRemove, + onChange = () => { }, + onRemove = () => { }, + rightContent, }) => { const { t } = useTranslation() @@ -41,29 +43,33 @@ const VarItem: FC = ({
{payload.variable}
-
·
-
{payload.label}
+ {payload.label && (<>
·
+
{payload.label}
+ )}
- {(!isHovering || readonly) - ? ( - <> - {payload.required && ( -
{t('workflow.nodes.start.required')}
- )} - - - ) - : (!readonly && ( - <> -
- -
-
- -
- - ))} + {rightContent || (<> + {(!isHovering || readonly) + ? ( + <> + {payload.required && ( +
{t('workflow.nodes.start.required')}
+ )} + + + ) + : (!readonly && ( + <> +
+ +
+
+ +
+ + ))} + )} +
{ isShowEditVarModal && ( diff --git a/web/app/components/workflow/nodes/start/panel.tsx b/web/app/components/workflow/nodes/start/panel.tsx index b244d269bf..9ab362c0a0 100644 --- a/web/app/components/workflow/nodes/start/panel.tsx +++ b/web/app/components/workflow/nodes/start/panel.tsx @@ -3,11 +3,11 @@ import React from 'react' import { useTranslation } from 'react-i18next' import RemoveEffectVarConfirm from '../_base/components/remove-effect-var-confirm' import VarList from './components/var-list' +import VarItem from './components/var-item' import useConfig from './use-config' import type { StartNodeType } from './types' import Split from '@/app/components/workflow/nodes/_base/components/split' import Field from '@/app/components/workflow/nodes/_base/components/field' -import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import AddButton from '@/app/components/base/button/add-button' import ConfigVarModal from '@/app/components/app/configuration/config-var/config-modal' import type { InputVar, NodePanelProps } from '@/app/components/workflow/types' @@ -40,57 +40,52 @@ const Panel: FC> = ({ return (
-
+
: undefined } > - + <> + + + { + isChatMode && ( +
+ + + String +
+ } + /> + + Array[File] +
+ } + /> +
+ ) + } +
- {isChatMode && } - {isChatMode && ( -
- - <> - - {/* Now not support sys.memories */} - {/* */} - - - -
- )} {isShowAddVarModal && (