mirror of
				https://github.com/langgenius/dify.git
				synced 2025-11-04 04:43:09 +00:00 
			
		
		
		
	datasource type
This commit is contained in:
		
							parent
							
								
									2158c03231
								
							
						
					
					
						commit
						558a280fc8
					
				@ -3,7 +3,6 @@ import type { DataSourceNodeType } from './types'
 | 
			
		||||
import { genNodeMetaData } from '@/app/components/workflow/utils'
 | 
			
		||||
import { BlockEnum } from '@/app/components/workflow/types'
 | 
			
		||||
import { OUTPUT_VARIABLES_MAP } from './constants'
 | 
			
		||||
import { inputVarTypeToVarType } from './utils'
 | 
			
		||||
 | 
			
		||||
const metaData = genNodeMetaData({
 | 
			
		||||
  sort: -1,
 | 
			
		||||
@ -12,7 +11,6 @@ const metaData = genNodeMetaData({
 | 
			
		||||
const nodeDefault: NodeDefault<DataSourceNodeType> = {
 | 
			
		||||
  metaData,
 | 
			
		||||
  defaultValue: {
 | 
			
		||||
    variables: [],
 | 
			
		||||
    datasource_parameters: {},
 | 
			
		||||
    datasource_configurations: {},
 | 
			
		||||
  },
 | 
			
		||||
@ -25,10 +23,8 @@ const nodeDefault: NodeDefault<DataSourceNodeType> = {
 | 
			
		||||
  getOutputVars(payload) {
 | 
			
		||||
    const {
 | 
			
		||||
      provider_type,
 | 
			
		||||
      variables,
 | 
			
		||||
    } = payload
 | 
			
		||||
    const isLocalFile = provider_type === 'local_file'
 | 
			
		||||
    const hasUserInputFields = !!variables?.length
 | 
			
		||||
    return [
 | 
			
		||||
      {
 | 
			
		||||
        variable: OUTPUT_VARIABLES_MAP.datasource_type.name,
 | 
			
		||||
@ -44,17 +40,6 @@ const nodeDefault: NodeDefault<DataSourceNodeType> = {
 | 
			
		||||
          ]
 | 
			
		||||
          : []
 | 
			
		||||
      ),
 | 
			
		||||
      ...(
 | 
			
		||||
        hasUserInputFields
 | 
			
		||||
          ? variables.map((field) => {
 | 
			
		||||
            return {
 | 
			
		||||
              variable: field.variable,
 | 
			
		||||
              type: inputVarTypeToVarType(field.type),
 | 
			
		||||
              isUserInputField: true,
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          : []
 | 
			
		||||
      ),
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,4 @@
 | 
			
		||||
import type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types'
 | 
			
		||||
import type { RAGPipelineVariables } from '@/models/pipeline'
 | 
			
		||||
 | 
			
		||||
export enum VarType {
 | 
			
		||||
  variable = 'variable',
 | 
			
		||||
@ -13,7 +12,6 @@ export type ToolVarInputs = Record<string, {
 | 
			
		||||
}>
 | 
			
		||||
 | 
			
		||||
export type DataSourceNodeType = CommonNodeType & {
 | 
			
		||||
  variables: RAGPipelineVariables
 | 
			
		||||
  fileExtensions?: string[]
 | 
			
		||||
  provider_id: string
 | 
			
		||||
  provider_type: string
 | 
			
		||||
 | 
			
		||||
@ -90,7 +90,7 @@ const RunPanel: FC<RunProps> = ({
 | 
			
		||||
    // fetch data
 | 
			
		||||
    if (runDetailUrl && tracingListUrl)
 | 
			
		||||
      getData()
 | 
			
		||||
  }, [getData, runDetailUrl, tracingListUrl])
 | 
			
		||||
  }, [runDetailUrl, tracingListUrl])
 | 
			
		||||
 | 
			
		||||
  const [height, setHeight] = useState(0)
 | 
			
		||||
  const ref = useRef<HTMLDivElement>(null)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user