From 60fafc524c8a048baa3cd11c0a4b73b91693d7b3 Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 21 Aug 2025 14:17:25 +0800 Subject: [PATCH] feat(data-source): add LOCAL_FILE_OUTPUT to constants and integrate into panel for local file handling --- .../workflow/nodes/data-source/constants.ts | 91 ------------------- .../workflow/nodes/data-source/panel.tsx | 16 ++++ 2 files changed, 16 insertions(+), 91 deletions(-) diff --git a/web/app/components/workflow/nodes/data-source/constants.ts b/web/app/components/workflow/nodes/data-source/constants.ts index f0f40e1af0..6c576df25d 100644 --- a/web/app/components/workflow/nodes/data-source/constants.ts +++ b/web/app/components/workflow/nodes/data-source/constants.ts @@ -79,94 +79,3 @@ export const LOCAL_FILE_OUTPUT = [ ], }, ] - -export const WEBSITE_CRAWL_OUTPUT = [ - { - name: 'source_url', - type: VarType.string, - description: 'The URL of the crawled website', - }, - { - name: 'content', - type: VarType.string, - description: 'The content of the crawled website', - }, - { - name: 'title', - type: VarType.string, - description: 'The title of the crawled website', - }, - { - name: 'description', - type: VarType.string, - description: 'The description of the crawled website', - }, -] - -export const ONLINE_DOCUMENT_OUTPUT = [ - { - name: 'workspace_id', - type: VarType.string, - description: 'The ID of the workspace where the document is stored', - }, - { - name: 'page_id', - type: VarType.string, - description: 'The ID of the page in the document', - }, - { - name: 'content', - type: VarType.string, - description: 'The content of the online document', - }, -] - -export const ONLINE_DRIVE_OUTPUT = [ - { - name: 'file', - type: VarType.file, - description: 'file', - subItems: [ - { - name: 'name', - type: VarType.string, - description: '', - }, - { - name: 'size', - type: VarType.number, - description: '', - }, - { - name: 'type', - type: VarType.string, - description: '', - }, - { - name: 'extension', - type: VarType.string, - description: '', - }, - { - name: 'mime_type', - type: VarType.string, - description: '', - }, - { - name: 'transfer_method', - type: VarType.string, - description: '', - }, - { - name: 'url', - type: VarType.string, - description: '', - }, - { - name: 'related_id', - type: VarType.string, - description: '', - }, - ], - }, -] diff --git a/web/app/components/workflow/nodes/data-source/panel.tsx b/web/app/components/workflow/nodes/data-source/panel.tsx index 96241bad89..c2b389aaf5 100644 --- a/web/app/components/workflow/nodes/data-source/panel.tsx +++ b/web/app/components/workflow/nodes/data-source/panel.tsx @@ -17,6 +17,7 @@ import { useNodesReadOnly } from '@/app/components/workflow/hooks' import { useConfig } from './hooks/use-config' import { COMMON_OUTPUT, + LOCAL_FILE_OUTPUT, } from './constants' import { useStore } from '@/app/components/workflow/store' import { toolParametersToFormSchemas } from '@/app/components/tools/utils/to-form-schema' @@ -117,6 +118,21 @@ const Panel: FC> = ({ id, data }) => { /> )) } + { + isLocalFile && LOCAL_FILE_OUTPUT.map((item, index) => ( + ({ + name: item.name, + type: item.type, + description: item.description, + }))} + /> + )) + } { outputSchema.map(outputItem => (