mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
feat: support picker vars files ui in editor
This commit is contained in:
@ -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}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user