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 { 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,
}
})
: []
),
]
},
}

View File

@ -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

View File

@ -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)