mirror of
https://github.com/langgenius/dify.git
synced 2025-11-08 15:31:02 +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 { 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,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
: []
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user