mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
feat: new input types
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
'use client'
|
||||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import { RiAlignLeft, RiCheckboxMultipleLine, RiFileCopy2Line, RiFileList2Line, RiHashtag, RiTextSnippet } from '@remixicon/react'
|
||||
import { InputVarType } from '../../../types'
|
||||
import { AlignLeft, LetterSpacing01 } from '@/app/components/base/icons/src/vender/line/editor'
|
||||
import { CheckDone01, Hash02 } from '@/app/components/base/icons/src/vender/line/general'
|
||||
|
||||
type Props = {
|
||||
className?: string
|
||||
@ -12,11 +11,13 @@ type Props = {
|
||||
|
||||
const getIcon = (type: InputVarType) => {
|
||||
return ({
|
||||
[InputVarType.textInput]: LetterSpacing01,
|
||||
[InputVarType.paragraph]: AlignLeft,
|
||||
[InputVarType.select]: CheckDone01,
|
||||
[InputVarType.number]: Hash02,
|
||||
} as any)[type] || LetterSpacing01
|
||||
[InputVarType.textInput]: RiTextSnippet,
|
||||
[InputVarType.paragraph]: RiAlignLeft,
|
||||
[InputVarType.select]: RiCheckboxMultipleLine,
|
||||
[InputVarType.number]: RiHashtag,
|
||||
[InputVarType.singleFile]: RiFileList2Line,
|
||||
[InputVarType.multiFiles]: RiFileCopy2Line,
|
||||
} as any)[type] || RiTextSnippet
|
||||
}
|
||||
|
||||
const InputVarTypeIcon: FC<Props> = ({
|
||||
|
||||
@ -79,6 +79,7 @@ const VarItem: FC<Props> = ({
|
||||
isShowEditVarModal && (
|
||||
<ConfigVarModal
|
||||
isShow
|
||||
supportFile
|
||||
payload={payload}
|
||||
onClose={hideEditVarModal}
|
||||
onConfirm={handlePayloadChange}
|
||||
|
||||
@ -117,6 +117,7 @@ const Panel: FC<NodePanelProps<StartNodeType>> = ({
|
||||
{isShowAddVarModal && (
|
||||
<ConfigVarModal
|
||||
isCreate
|
||||
supportFile
|
||||
isShow={isShowAddVarModal}
|
||||
onClose={hideAddVarModal}
|
||||
onConfirm={handleAddVarConfirm}
|
||||
|
||||
@ -126,6 +126,8 @@ export enum InputVarType {
|
||||
json = 'json', // obj, array
|
||||
contexts = 'contexts', // knowledge retrieval
|
||||
iterator = 'iterator', // iteration input
|
||||
singleFile = 'single-file',
|
||||
multiFiles = 'multi-files',
|
||||
}
|
||||
|
||||
export type InputVar = {
|
||||
|
||||
Reference in New Issue
Block a user