diff --git a/web/app/components/base/file-uploader/file-image-render.tsx b/web/app/components/base/file-uploader/file-image-render.tsx index 864135af0f..358c93b82b 100644 --- a/web/app/components/base/file-uploader/file-image-render.tsx +++ b/web/app/components/base/file-uploader/file-image-render.tsx @@ -6,6 +6,7 @@ type FileImageRenderProps = { alt?: string onLoad?: () => void onError?: () => void + showDownloadAction?: boolean } const FileImageRender = ({ imageUrl, @@ -13,15 +14,17 @@ const FileImageRender = ({ alt, onLoad, onError, + showDownloadAction, }: FileImageRenderProps) => { return (
{alt} showDownloadAction && window.open(imageUrl, '_blank')} />
) diff --git a/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-image-item.tsx b/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-image-item.tsx index cde868f618..c1277be050 100644 --- a/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-image-item.tsx +++ b/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-image-item.tsx @@ -8,12 +8,14 @@ import { ReplayLine } from '@/app/components/base/icons/src/vender/other' type FileImageItemProps = { file: FileEntity showDeleteAction?: boolean + showDownloadAction?: boolean onRemove?: (fileId: string) => void onReUpload?: (fileId: string) => void } const FileImageItem = ({ file, showDeleteAction, + showDownloadAction, onRemove, onReUpload, }: FileImageItemProps) => { @@ -34,6 +36,7 @@ const FileImageItem = ({ { progress > 0 && progress < 100 && ( diff --git a/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-list.tsx b/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-list.tsx index 5d35430a90..e1327ae138 100644 --- a/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-list.tsx +++ b/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-list.tsx @@ -33,6 +33,7 @@ export const FileList = ({ key={file.id} file={file} showDeleteAction={showDeleteAction} + showDownloadAction={showDownloadAction} onRemove={onRemove} onReUpload={onReUpload} /> diff --git a/web/app/components/workflow/panel/debug-and-preview/hooks.ts b/web/app/components/workflow/panel/debug-and-preview/hooks.ts index 92d5d18657..0418d19fd7 100644 --- a/web/app/components/workflow/panel/debug-and-preview/hooks.ts +++ b/web/app/components/workflow/panel/debug-and-preview/hooks.ts @@ -14,7 +14,10 @@ import type { Inputs, } from '@/app/components/base/chat/types' import type { InputForm } from '@/app/components/base/chat/chat/type' -import { processOpeningStatement } from '@/app/components/base/chat/chat/utils' +import { + getProcessedInputs, + processOpeningStatement, +} from '@/app/components/base/chat/chat/utils' import { useToastContext } from '@/app/components/base/toast' import { TransferMethod } from '@/types/app' import { @@ -191,9 +194,10 @@ export const useChat = ( handleResponding(true) - const { files, ...restParams } = params + const { files, inputs, ...restParams } = params const bodyParams = { files: getProcessedFiles(files || []), + inputs: getProcessedInputs(inputs || {}, formSettings?.inputsForm || []), ...restParams, } if (bodyParams?.files?.length) {