datasource type

This commit is contained in:
zxhlyh 2025-05-29 18:20:59 +08:00
parent 2158c03231
commit 558a280fc8
3 changed files with 1 additions and 18 deletions

View File

@ -3,7 +3,6 @@ import type { DataSourceNodeType } from './types'
import { genNodeMetaData } from '@/app/components/workflow/utils' import { genNodeMetaData } from '@/app/components/workflow/utils'
import { BlockEnum } from '@/app/components/workflow/types' import { BlockEnum } from '@/app/components/workflow/types'
import { OUTPUT_VARIABLES_MAP } from './constants' import { OUTPUT_VARIABLES_MAP } from './constants'
import { inputVarTypeToVarType } from './utils'
const metaData = genNodeMetaData({ const metaData = genNodeMetaData({
sort: -1, sort: -1,
@ -12,7 +11,6 @@ const metaData = genNodeMetaData({
const nodeDefault: NodeDefault<DataSourceNodeType> = { const nodeDefault: NodeDefault<DataSourceNodeType> = {
metaData, metaData,
defaultValue: { defaultValue: {
variables: [],
datasource_parameters: {}, datasource_parameters: {},
datasource_configurations: {}, datasource_configurations: {},
}, },
@ -25,10 +23,8 @@ const nodeDefault: NodeDefault<DataSourceNodeType> = {
getOutputVars(payload) { getOutputVars(payload) {
const { const {
provider_type, provider_type,
variables,
} = payload } = payload
const isLocalFile = provider_type === 'local_file' const isLocalFile = provider_type === 'local_file'
const hasUserInputFields = !!variables?.length
return [ return [
{ {
variable: OUTPUT_VARIABLES_MAP.datasource_type.name, 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,
}
})
: []
),
] ]
}, },
} }

View File

@ -1,5 +1,4 @@
import type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types' import type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types'
import type { RAGPipelineVariables } from '@/models/pipeline'
export enum VarType { export enum VarType {
variable = 'variable', variable = 'variable',
@ -13,7 +12,6 @@ export type ToolVarInputs = Record<string, {
}> }>
export type DataSourceNodeType = CommonNodeType & { export type DataSourceNodeType = CommonNodeType & {
variables: RAGPipelineVariables
fileExtensions?: string[] fileExtensions?: string[]
provider_id: string provider_id: string
provider_type: string provider_type: string

View File

@ -90,7 +90,7 @@ const RunPanel: FC<RunProps> = ({
// fetch data // fetch data
if (runDetailUrl && tracingListUrl) if (runDetailUrl && tracingListUrl)
getData() getData()
}, [getData, runDetailUrl, tracingListUrl]) }, [runDetailUrl, tracingListUrl])
const [height, setHeight] = useState(0) const [height, setHeight] = useState(0)
const ref = useRef<HTMLDivElement>(null) const ref = useRef<HTMLDivElement>(null)