|
|
|
@ -1,5 +1,5 @@
|
|
|
|
import { InputVarType } from '@/app/components/workflow/types'
|
|
|
|
|
|
|
|
import { InputType } from './types'
|
|
|
|
import { InputType } from './types'
|
|
|
|
|
|
|
|
import { PipelineInputVarType } from '@/models/pipeline'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
RiAlignLeft,
|
|
|
|
RiAlignLeft,
|
|
|
|
@ -12,28 +12,29 @@ import {
|
|
|
|
} from '@remixicon/react'
|
|
|
|
} from '@remixicon/react'
|
|
|
|
|
|
|
|
|
|
|
|
const i18nFileTypeMap: Record<string, string> = {
|
|
|
|
const i18nFileTypeMap: Record<string, string> = {
|
|
|
|
|
|
|
|
'number-input': 'number',
|
|
|
|
'file': 'single-file',
|
|
|
|
'file': 'single-file',
|
|
|
|
'file-list': 'multi-files',
|
|
|
|
'file-list': 'multi-files',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const INPUT_TYPE_ICON = {
|
|
|
|
const INPUT_TYPE_ICON = {
|
|
|
|
[InputVarType.textInput]: RiTextSnippet,
|
|
|
|
[PipelineInputVarType.textInput]: RiTextSnippet,
|
|
|
|
[InputVarType.paragraph]: RiAlignLeft,
|
|
|
|
[PipelineInputVarType.paragraph]: RiAlignLeft,
|
|
|
|
[InputVarType.number]: RiHashtag,
|
|
|
|
[PipelineInputVarType.number]: RiHashtag,
|
|
|
|
[InputVarType.select]: RiListCheck3,
|
|
|
|
[PipelineInputVarType.select]: RiListCheck3,
|
|
|
|
[InputVarType.checkbox]: RiCheckboxLine,
|
|
|
|
[PipelineInputVarType.checkbox]: RiCheckboxLine,
|
|
|
|
[InputVarType.singleFile]: RiFileTextLine,
|
|
|
|
[PipelineInputVarType.singleFile]: RiFileTextLine,
|
|
|
|
[InputVarType.multiFiles]: RiFileCopy2Line,
|
|
|
|
[PipelineInputVarType.multiFiles]: RiFileCopy2Line,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const DATA_TYPE = {
|
|
|
|
const DATA_TYPE = {
|
|
|
|
[InputVarType.textInput]: 'string',
|
|
|
|
[PipelineInputVarType.textInput]: 'string',
|
|
|
|
[InputVarType.paragraph]: 'string',
|
|
|
|
[PipelineInputVarType.paragraph]: 'string',
|
|
|
|
[InputVarType.number]: 'number',
|
|
|
|
[PipelineInputVarType.number]: 'number',
|
|
|
|
[InputVarType.select]: 'string',
|
|
|
|
[PipelineInputVarType.select]: 'string',
|
|
|
|
[InputVarType.checkbox]: 'boolean',
|
|
|
|
[PipelineInputVarType.checkbox]: 'boolean',
|
|
|
|
[InputVarType.singleFile]: 'file',
|
|
|
|
[PipelineInputVarType.singleFile]: 'file',
|
|
|
|
[InputVarType.multiFiles]: 'array[file]',
|
|
|
|
[PipelineInputVarType.multiFiles]: 'array[file]',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const useInputTypeOptions = (supportFile: boolean) => {
|
|
|
|
export const useInputTypeOptions = (supportFile: boolean) => {
|
|
|
|
|