feat: support picker vars files ui in editor

This commit is contained in:
Joel
2026-01-20 13:56:26 +08:00
parent 27de07e93d
commit 2650ceb0a6
6 changed files with 217 additions and 81 deletions

View File

@ -40,6 +40,7 @@ type Props = {
varList: Variable[]
handleAddVariable: (payload: any) => void
modelConfig?: ModelConfig
isSupportSandbox?: boolean
}
const roleOptions = [
@ -82,6 +83,7 @@ const ConfigPromptItem: FC<Props> = ({
varList,
handleAddVariable,
modelConfig,
isSupportSandbox,
}) => {
const { t } = useTranslation()
const workflowStore = useWorkflowStore()
@ -149,6 +151,7 @@ const ConfigPromptItem: FC<Props> = ({
varList={varList}
handleAddVariable={handleAddVariable}
isSupportFileVar
isSupportSandbox={isSupportSandbox}
/>
)
}

View File

@ -7,6 +7,7 @@ import { useCallback, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { ReactSortable } from 'react-sortablejs'
import { v4 as uuid4 } from 'uuid'
import { useFeatures } from '@/app/components/base/features/hooks'
import { DragHandle } from '@/app/components/base/icons/src/vender/line/others'
import {
PortalToFollowElem,
@ -59,6 +60,8 @@ const ConfigPrompt: FC<Props> = ({
}) => {
const { t } = useTranslation()
const workflowStore = useWorkflowStore()
const features = useFeatures(s => s.features)
const isSupportSandbox = !!features.sandbox?.enabled
const {
setControlPromptEditorRerenderKey,
} = workflowStore.getState()
@ -337,6 +340,7 @@ const ConfigPrompt: FC<Props> = ({
varList={varList}
handleAddVariable={handleAddVariable}
modelConfig={modelConfig}
isSupportSandbox={isSupportSandbox}
/>
</div>
)
@ -410,6 +414,7 @@ const ConfigPrompt: FC<Props> = ({
handleAddVariable={handleAddVariable}
onGenerated={handleGenerated}
modelConfig={modelConfig}
isSupportSandbox={isSupportSandbox}
/>
</div>
)}