datasource panel

This commit is contained in:
zxhlyh
2025-05-23 11:50:36 +08:00
parent 5aaa06c8b0
commit 7d92574e02
7 changed files with 174 additions and 92 deletions

View File

@ -3,6 +3,8 @@ import {
useState,
} from 'react'
import { useTranslation } from 'react-i18next'
import { useDataSourceList } from '@/service/use-pipeline'
import { useStore } from '../store'
import {
TabsEnum,
ToolTypeEnum,
@ -75,3 +77,10 @@ export const useToolTabs = () => {
},
]
}
export const useDataSources = () => {
const pipelineId = useStore(s => s.pipelineId)
const { data: dataSourceList } = useDataSourceList(!!pipelineId)
return dataSourceList || []
}

View File

@ -5,8 +5,7 @@ import type { NodeSelectorProps } from './main'
import NodeSelector from './main'
import { useHooksStore } from '@/app/components/workflow/hooks-store/store'
import { BlockEnum } from '@/app/components/workflow/types'
import { useStore } from '@/app/components/workflow/store'
import { useDataSourceList } from '@/service/use-pipeline'
import { useDataSources } from './hooks'
const NodeSelectorWrapper = (props: NodeSelectorProps) => {
const availableNodesMetaData = useHooksStore(s => s.availableNodesMetaData)
@ -34,8 +33,7 @@ const NodeSelectorWrapper = (props: NodeSelectorProps) => {
})
}, [availableNodesMetaData?.nodes])
const pipelineId = useStore(s => s.pipelineId)
const { data: dataSourceList } = useDataSourceList(!!pipelineId)
const dataSourceList = useDataSources()
return (
<NodeSelector