mirror of https://github.com/langgenius/dify.git
Merge branch 'feat/rag-pipeline' of https://github.com/langgenius/dify into feat/rag-pipeline
This commit is contained in:
commit
4c2cc98ebc
|
|
@ -52,6 +52,7 @@ export type Collection = {
|
|||
plugin_id?: string
|
||||
letter?: string
|
||||
is_authorized?: boolean
|
||||
provider?: string
|
||||
}
|
||||
|
||||
export type ToolParameter = {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
|||
const { mutateAsync } = useUpdateDataSourceCredentials()
|
||||
const handleAuth = useCallback(async (value: any) => {
|
||||
await mutateAsync({
|
||||
provider: currentDataSourceItem?.provider,
|
||||
pluginId: currentDataSourceItem?.plugin_id,
|
||||
provider: currentDataSource?.provider || '',
|
||||
pluginId: currentDataSource?.plugin_id || '',
|
||||
credentials: value,
|
||||
})
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
|||
message: t('common.api.actionSuccess'),
|
||||
})
|
||||
hideAuthModal()
|
||||
}, [currentDataSourceItem, mutateAsync, notify, t, hideAuthModal])
|
||||
}, [currentDataSource, mutateAsync, notify, t, hideAuthModal])
|
||||
|
||||
return (
|
||||
<div >
|
||||
|
|
|
|||
|
|
@ -214,12 +214,12 @@ export const useRunPublishedPipeline = (
|
|||
}
|
||||
|
||||
export const useDataSourceCredentials = (provider: string, pluginId: string, onSuccess: (value: ToolCredential[]) => void) => {
|
||||
return useQuery<ToolCredential[]>({
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'datasource-credentials', provider, pluginId],
|
||||
queryFn: async () => {
|
||||
const result = await get<ToolCredential[]>(`/auth/plugin/datasource?provider=${provider}&plugin_id=${pluginId}`)
|
||||
onSuccess(result)
|
||||
return result
|
||||
const result = await get<{ result: ToolCredential[] }>(`/auth/plugin/datasource?provider=${provider}&plugin_id=${pluginId}`)
|
||||
onSuccess(result.result)
|
||||
return result.result
|
||||
},
|
||||
enabled: !!provider && !!pluginId,
|
||||
retry: 2,
|
||||
|
|
|
|||
Loading…
Reference in New Issue