mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox
# Conflicts: # web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx # web/package.json
This commit is contained in:
@ -95,7 +95,7 @@ const Base: FC<Props> = ({
|
||||
}}
|
||||
>
|
||||
{headerRight}
|
||||
{showCodeGenerator && codeLanguages && (
|
||||
{!!(showCodeGenerator && codeLanguages) && (
|
||||
<div className="ml-1">
|
||||
<CodeGeneratorButton
|
||||
onGenerated={onGenerated}
|
||||
@ -119,7 +119,7 @@ const Base: FC<Props> = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{tip && <div className="px-1 py-0.5">{tip}</div>}
|
||||
{!!tip && <div className="px-1 py-0.5">{tip}</div>}
|
||||
<PromptEditorHeightResizeWrap
|
||||
height={isExpand ? editorExpandHeight : editorContentHeight}
|
||||
minHeight={editorContentMinHeight}
|
||||
|
||||
@ -46,7 +46,7 @@ const Field: FC<Props> = ({
|
||||
{' '}
|
||||
{required && <span className="text-text-destructive">*</span>}
|
||||
</div>
|
||||
{tooltip && (
|
||||
{!!tooltip && (
|
||||
<Tooltip
|
||||
popupContent={tooltip}
|
||||
popupClassName="ml-1"
|
||||
@ -55,13 +55,13 @@ const Field: FC<Props> = ({
|
||||
)}
|
||||
</div>
|
||||
<div className="flex">
|
||||
{operations && <div>{operations}</div>}
|
||||
{!!operations && <div>{operations}</div>}
|
||||
{supportFold && (
|
||||
<RiArrowDownSLine className="h-4 w-4 cursor-pointer text-text-tertiary transition-transform" style={{ transform: fold ? 'rotate(-90deg)' : 'rotate(0deg)' }} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{children && (!supportFold || (supportFold && !fold)) && <div className={cn(!inline && 'mt-1')}>{children}</div>}
|
||||
{!!(children && (!supportFold || (supportFold && !fold))) && <div className={cn(!inline && 'mt-1')}>{children}</div>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ const Editor: FC<Props> = ({
|
||||
{' '}
|
||||
{required && <span className="text-text-destructive">*</span>}
|
||||
</div>
|
||||
{titleTooltip && <Tooltip popupContent={titleTooltip} />}
|
||||
{!!titleTooltip && <Tooltip popupContent={titleTooltip} />}
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<div className="text-xs font-medium leading-[18px] text-text-tertiary">{value?.length || 0}</div>
|
||||
|
||||
@ -61,7 +61,7 @@ const VariableLabel = ({
|
||||
notShowFullPath={notShowFullPath}
|
||||
/>
|
||||
{
|
||||
variableType && (
|
||||
!!variableType && (
|
||||
<div className="system-xs-regular shrink-0 text-text-tertiary">
|
||||
{capitalize(variableType)}
|
||||
</div>
|
||||
|
||||
@ -322,7 +322,7 @@ const BaseNode: FC<BaseNodeProps> = ({
|
||||
}
|
||||
</div>
|
||||
{
|
||||
data._iterationLength && data._iterationIndex && data._runningStatus === NodeRunningStatus.Running && (
|
||||
!!(data._iterationLength && data._iterationIndex && data._runningStatus === NodeRunningStatus.Running) && (
|
||||
<div className="mr-1.5 text-xs font-medium text-text-accent">
|
||||
{data._iterationIndex > data._iterationLength ? data._iterationLength : data._iterationIndex}
|
||||
/
|
||||
@ -331,7 +331,7 @@ const BaseNode: FC<BaseNodeProps> = ({
|
||||
)
|
||||
}
|
||||
{
|
||||
data.type === BlockEnum.Loop && data._loopIndex && LoopIndex
|
||||
!!(data.type === BlockEnum.Loop && data._loopIndex) && LoopIndex
|
||||
}
|
||||
{
|
||||
isLoading
|
||||
@ -374,7 +374,7 @@ const BaseNode: FC<BaseNodeProps> = ({
|
||||
)
|
||||
}
|
||||
{
|
||||
data.desc && data.type !== BlockEnum.Iteration && data.type !== BlockEnum.Loop && (
|
||||
!!(data.desc && data.type !== BlockEnum.Iteration && data.type !== BlockEnum.Loop) && (
|
||||
<div className="system-xs-regular whitespace-pre-line break-words px-3 pb-2 pt-1 text-text-tertiary">
|
||||
{data.desc}
|
||||
</div>
|
||||
|
||||
@ -178,7 +178,7 @@ const VarList: FC<Props> = ({
|
||||
className="w-full"
|
||||
/>
|
||||
)}
|
||||
{item.operation === WriteMode.set && assignedVarType && (
|
||||
{!!(item.operation === WriteMode.set && assignedVarType) && (
|
||||
<>
|
||||
{assignedVarType === 'number' && (
|
||||
<Input
|
||||
|
||||
@ -51,7 +51,7 @@ const NodeComponent: FC<NodeProps<AssignerNodeType>> = ({
|
||||
nodeType={node?.data.type}
|
||||
nodeTitle={node?.data.title}
|
||||
rightSlot={
|
||||
value.operation && <Badge className="!ml-auto shrink-0" text={t(`${i18nPrefix}.operations.${value.operation}`, { ns: 'workflow' })} />
|
||||
!!value.operation && <Badge className="!ml-auto shrink-0" text={t(`${i18nPrefix}.operations.${value.operation}`, { ns: 'workflow' })} />
|
||||
}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -41,7 +41,7 @@ const ChunkStructure = ({
|
||||
}}
|
||||
>
|
||||
{
|
||||
chunkStructure && (
|
||||
!!chunkStructure && (
|
||||
<OptionCard
|
||||
{...optionMap[chunkStructure]}
|
||||
selectedId={chunkStructure}
|
||||
|
||||
@ -100,7 +100,7 @@ const OptionCard = memo(({
|
||||
>
|
||||
{effectElement}
|
||||
{
|
||||
icon && (
|
||||
!!icon && (
|
||||
<div className="mr-1 flex h-[18px] w-[18px] shrink-0 items-center justify-center">
|
||||
{typeof icon === 'function' ? icon(isActive) : icon}
|
||||
</div>
|
||||
@ -139,7 +139,7 @@ const OptionCard = memo(({
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
children && isActive && (
|
||||
!!(children && isActive) && (
|
||||
<div className="relative rounded-b-xl bg-components-panel-bg p-3">
|
||||
<ArrowShape className="absolute left-[14px] top-[-11px] h-4 w-4 text-components-panel-bg" />
|
||||
{children}
|
||||
|
||||
@ -118,7 +118,7 @@ const Panel: FC<NodePanelProps<KnowledgeBaseNodeType>> = ({
|
||||
/>
|
||||
</Group>
|
||||
{
|
||||
data.chunk_structure && (
|
||||
!!data.chunk_structure && (
|
||||
<>
|
||||
<BoxGroupField
|
||||
boxGroupProps={{
|
||||
|
||||
@ -110,7 +110,7 @@ const DatasetItem: FC<Props> = ({
|
||||
</div>
|
||||
)}
|
||||
{
|
||||
payload.indexing_technique && (
|
||||
!!payload.indexing_technique && (
|
||||
<Badge
|
||||
className="shrink-0 group-hover/dataset-item:hidden"
|
||||
text={formatIndexingTechniqueAndMethod(payload.indexing_technique, payload.retrieval_model_dict?.search_method)}
|
||||
|
||||
@ -46,7 +46,7 @@ const ConditionDate = ({
|
||||
}
|
||||
</div>
|
||||
{
|
||||
value && (
|
||||
!!value && (
|
||||
<RiCloseCircleFill
|
||||
className={cn(
|
||||
'hidden h-4 w-4 shrink-0 cursor-pointer hover:text-components-input-text-filled group-hover:block',
|
||||
|
||||
@ -123,7 +123,7 @@ const ConfigPromptItem: FC<Props> = ({
|
||||
|
||||
<Tooltip
|
||||
popupContent={
|
||||
<div className="max-w-[180px]">{payload.role && t(`${i18nPrefix}.roleDescription.${payload.role}`, { ns: 'workflow' })}</div>
|
||||
<div className="max-w-[180px]">{!!payload.role && t(`${i18nPrefix}.roleDescription.${payload.role}`, { ns: 'workflow' })}</div>
|
||||
}
|
||||
triggerClassName="w-4 h-4"
|
||||
/>
|
||||
|
||||
@ -86,7 +86,7 @@ const ConditionList = ({
|
||||
className="absolute right-1 top-1/2 flex h-[21px] -translate-y-1/2 cursor-pointer select-none items-center rounded-md border-[0.5px] border-components-button-secondary-border bg-components-button-secondary-bg px-1 text-[10px] font-semibold text-text-accent-secondary shadow-xs"
|
||||
onClick={() => doToggleConditionLogicalOperator(conditionId)}
|
||||
>
|
||||
{logicalOperator && logicalOperator.toUpperCase()}
|
||||
{!!logicalOperator && logicalOperator.toUpperCase()}
|
||||
<RiLoopLeftLine className="ml-0.5 h-3 w-3" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -115,7 +115,7 @@ const ConversationVariableModal = ({
|
||||
}}
|
||||
>
|
||||
</div>
|
||||
{latestValueTimestampMap[currentVar.id] && (
|
||||
{!!latestValueTimestampMap[currentVar.id] && (
|
||||
<div className="system-xs-regular shrink-0 text-text-tertiary">
|
||||
{t('chatVariable.updatedAt', { ns: 'workflow' })}
|
||||
{formatTime(latestValueTimestampMap[currentVar.id], t('dateTimeFormat', { ns: 'appLog' }) as string)}
|
||||
|
||||
@ -79,7 +79,7 @@ const AgentLogItem = ({
|
||||
{label}
|
||||
</div>
|
||||
{
|
||||
metadata?.elapsed_time && (
|
||||
!!metadata?.elapsed_time && (
|
||||
<div className="system-xs-regular mr-2 shrink-0 text-text-tertiary">
|
||||
{metadata?.elapsed_time?.toFixed(3)}
|
||||
s
|
||||
|
||||
Reference in New Issue
Block a user