mirror of
https://github.com/langgenius/dify.git
synced 2026-01-05 14:31:05 +00:00
datasource
This commit is contained in:
parent
e6c6fa8ed8
commit
e2f3f0ae4c
@ -2,7 +2,6 @@ import type { NodeDefault } from '../../types'
|
||||
import type { DataSourceNodeType } from './types'
|
||||
import { genNodeMetaData } from '@/app/components/workflow/utils'
|
||||
import { BlockEnum } from '@/app/components/workflow/types'
|
||||
import { CollectionType } from '@/app/components/tools/types'
|
||||
import { OUTPUT_VARIABLES_MAP } from './constants'
|
||||
|
||||
const metaData = genNodeMetaData({
|
||||
@ -22,8 +21,8 @@ const nodeDefault: NodeDefault<DataSourceNodeType> = {
|
||||
}
|
||||
},
|
||||
getOutputVars(payload) {
|
||||
const { datasource_name, provider_type } = payload
|
||||
const isLocalFile = datasource_name === 'local_file' && provider_type === CollectionType.datasource
|
||||
const { provider_type } = payload
|
||||
const isLocalFile = provider_type === 'local_file'
|
||||
return [
|
||||
{
|
||||
variable: OUTPUT_VARIABLES_MAP.datasource_type.name,
|
||||
|
||||
@ -2,7 +2,6 @@ import type { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { memo } from 'react'
|
||||
import type { DataSourceNodeType } from './types'
|
||||
import { CollectionType } from '@/app/components/tools/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'
|
||||
@ -15,10 +14,9 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
||||
const {
|
||||
provider_type,
|
||||
fileExtensions = [],
|
||||
datasource_name,
|
||||
} = data
|
||||
const { handleFileExtensionsChange } = useConfig(id)
|
||||
const isLocalFile = datasource_name === 'local_file' && provider_type === CollectionType.datasource
|
||||
const isLocalFile = provider_type === 'local_file'
|
||||
|
||||
return (
|
||||
<div >
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types'
|
||||
import type { RAGPipelineVariables } from '@/models/pipeline'
|
||||
import type { CollectionType } from '@/app/components/tools/types'
|
||||
|
||||
export enum VarType {
|
||||
variable = 'variable',
|
||||
@ -17,7 +16,7 @@ export type DataSourceNodeType = CommonNodeType & {
|
||||
variables: RAGPipelineVariables
|
||||
fileExtensions?: string[]
|
||||
provider_id: string
|
||||
provider_type: CollectionType
|
||||
provider_type: string
|
||||
provider_name: string
|
||||
datasource_name: string
|
||||
datasource_label: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user