diff --git a/api/core/app/app_config/easy_ui_based_app/variables/manager.py b/api/core/app/app_config/easy_ui_based_app/variables/manager.py index 2f2445a336..fbda389500 100644 --- a/api/core/app/app_config/easy_ui_based_app/variables/manager.py +++ b/api/core/app/app_config/easy_ui_based_app/variables/manager.py @@ -47,6 +47,7 @@ class BasicVariablesConfigManager: VariableEntityType.PARAGRAPH, VariableEntityType.NUMBER, VariableEntityType.SELECT, + VariableEntityType.JSON, }: variable = variables[variable_type] variable_entities.append( @@ -96,7 +97,7 @@ class BasicVariablesConfigManager: variables = [] for item in config["user_input_form"]: key = list(item.keys())[0] - if key not in {"text-input", "select", "paragraph", "number", "external_data_tool"}: + if key not in {"text-input", "select", "paragraph", "number", "external_data_tool", "json"}: raise ValueError("Keys in user_input_form list can only be 'text-input', 'paragraph' or 'select'") form_item = item[key] diff --git a/api/core/app/app_config/entities.py b/api/core/app/app_config/entities.py index 75bd2f677a..18e9fb0905 100644 --- a/api/core/app/app_config/entities.py +++ b/api/core/app/app_config/entities.py @@ -97,6 +97,7 @@ class VariableEntityType(StrEnum): EXTERNAL_DATA_TOOL = "external_data_tool" FILE = "file" FILE_LIST = "file-list" + JSON = "json" class VariableEntity(BaseModel): diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx index 8fcc0f4c08..5b17b283cd 100644 --- a/web/app/components/app/configuration/config-var/config-modal/index.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx @@ -204,6 +204,7 @@ const ConfigModal: FC = ({ + {supportFile && <> diff --git a/web/app/components/workflow/nodes/_base/components/input-var-type-icon.tsx b/web/app/components/workflow/nodes/_base/components/input-var-type-icon.tsx index d3cc1dbc78..8f75273a91 100644 --- a/web/app/components/workflow/nodes/_base/components/input-var-type-icon.tsx +++ b/web/app/components/workflow/nodes/_base/components/input-var-type-icon.tsx @@ -1,7 +1,7 @@ 'use client' import type { FC } from 'react' import React from 'react' -import { RiAlignLeft, RiCheckboxMultipleLine, RiFileCopy2Line, RiFileList2Line, RiHashtag, RiTextSnippet } from '@remixicon/react' +import { RiAlignLeft, RiCheckboxMultipleLine, RiCodeBoxLine, RiFileCopy2Line, RiFileList2Line, RiHashtag, RiTextSnippet } from '@remixicon/react' import { InputVarType } from '../../../types' type Props = { @@ -17,6 +17,7 @@ const getIcon = (type: InputVarType) => { [InputVarType.number]: RiHashtag, [InputVarType.singleFile]: RiFileList2Line, [InputVarType.multiFiles]: RiFileCopy2Line, + [InputVarType.json]: RiCodeBoxLine, } as any)[type] || RiTextSnippet } diff --git a/web/i18n/en-US/app-debug.ts b/web/i18n/en-US/app-debug.ts index 938cb27c12..21e602ce12 100644 --- a/web/i18n/en-US/app-debug.ts +++ b/web/i18n/en-US/app-debug.ts @@ -359,6 +359,7 @@ const translation = { 'paragraph': 'Paragraph', 'select': 'Select', 'number': 'Number', + 'json': 'JSON Object', 'single-file': 'Single File', 'multi-files': 'File List', 'notSet': 'Not set, try typing {{input}} in the prefix prompt', diff --git a/web/i18n/zh-Hans/app-debug.ts b/web/i18n/zh-Hans/app-debug.ts index 3728d86e58..5435383cd8 100644 --- a/web/i18n/zh-Hans/app-debug.ts +++ b/web/i18n/zh-Hans/app-debug.ts @@ -349,6 +349,7 @@ const translation = { 'paragraph': '段落', 'select': '下拉选项', 'number': '数字', + 'json': 'JSON 对象', 'single-file': '单文件', 'multi-files': '文件列表', 'notSet': '未设置,在 Prompt 中输入 {{input}} 试试',