From 71ce505631cd5dfa17202b739c09e94ebb99adde Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Thu, 29 May 2025 11:03:22 +0800 Subject: [PATCH] data source panel --- .../workflow/nodes/data-source/panel.tsx | 60 +------------------ 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/web/app/components/workflow/nodes/data-source/panel.tsx b/web/app/components/workflow/nodes/data-source/panel.tsx index 64b9ee2b3c..bf9b316a85 100644 --- a/web/app/components/workflow/nodes/data-source/panel.tsx +++ b/web/app/components/workflow/nodes/data-source/panel.tsx @@ -1,79 +1,29 @@ import type { FC } from 'react' import { useTranslation } from 'react-i18next' import { memo } from 'react' -import { RiAddLine } from '@remixicon/react' import type { DataSourceNodeType } from './types' import type { NodePanelProps } from '@/app/components/workflow/types' import { BoxGroupField } from '@/app/components/workflow/nodes/_base/components/layout' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import TagInput from '@/app/components/base/tag-input' -import FieldList from '@/app/components/rag-pipeline/components/input-field/field-list/field-list-container' -import { useFieldList } from '@/app/components/rag-pipeline/components/input-field/field-list/hooks' -import InputFieldEditor from '@/app/components/rag-pipeline/components/input-field/editor' import { useNodesReadOnly } from '@/app/components/workflow/hooks' import { useConfig } from './hooks/use-config' import { OUTPUT_VARIABLES_MAP } from './constants' -import ActionButton from '@/app/components/base/action-button' const Panel: FC> = ({ id, data }) => { const { t } = useTranslation() const { nodesReadOnly } = useNodesReadOnly() const { - variables, provider_type, fileExtensions = [], } = data const { - handleInputFieldVariablesChange, handleFileExtensionsChange, } = useConfig(id) const isLocalFile = provider_type === 'local_file' - const { - inputFields, - handleListSortChange, - handleRemoveField, - handleOpenInputFieldEditor, - showInputFieldEditor, - editingField, - handleSubmitField, - handleCancelInputFieldEditor, - } = useFieldList(variables, handleInputFieldVariablesChange, id) return (
- { - !isLocalFile && ( - { - e.stopPropagation() - handleOpenInputFieldEditor() - }} - > - - - ), - }, - supportCollapse: true, - }} - > - - - ) - } { isLocalFile && ( > = ({ id, data }) => { onChange={handleFileExtensionsChange} placeholder={t('workflow.nodes.dataSource.supportedFileFormatsPlaceholder')} inputClassName='bg-transparent' + disableAdd={nodesReadOnly} + disableRemove={nodesReadOnly} />
@@ -118,14 +70,6 @@ const Panel: FC> = ({ id, data }) => { ) } - {showInputFieldEditor && ( - - )} ) }