mirror of
https://github.com/langgenius/dify.git
synced 2025-12-28 02:22:15 +00:00
datasource
This commit is contained in:
parent
4c9bf78363
commit
dfe091789c
@ -86,7 +86,7 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
||||
return (
|
||||
<div >
|
||||
{
|
||||
!isAuthorized && !showAuthModal && (
|
||||
!isAuthorized && !showAuthModal && !isLocalFile && (
|
||||
<Group>
|
||||
<Button
|
||||
variant='primary'
|
||||
@ -100,7 +100,7 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
||||
)
|
||||
}
|
||||
{
|
||||
isAuthorized && (
|
||||
isAuthorized && !isLocalFile && (
|
||||
<GroupField
|
||||
groupProps={{
|
||||
withBorderBottom: true,
|
||||
@ -166,7 +166,7 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
||||
}
|
||||
</OutputVars>
|
||||
{
|
||||
showAuthModal && (
|
||||
showAuthModal && !isLocalFile && (
|
||||
<ConfigCredential
|
||||
dataSourceItem={currentDataSource!}
|
||||
onCancel={hideAuthModal}
|
||||
|
||||
@ -214,7 +214,7 @@ export const useDataSourceCredentials = (provider: string, pluginId: string, onS
|
||||
return useQuery<ToolCredential[]>({
|
||||
queryKey: [NAME_SPACE, 'datasource-credentials', provider, pluginId],
|
||||
queryFn: async () => {
|
||||
const result = await get<ToolCredential[]>(`/auth/datasource/provider/${provider}/plugin/${pluginId}`)
|
||||
const result = await get<ToolCredential[]>(`/auth/plugin/datasource?provider=${provider}&plugin_id=${pluginId}`)
|
||||
onSuccess(result)
|
||||
return result
|
||||
},
|
||||
@ -233,8 +233,10 @@ export const useUpdateDataSourceCredentials = (
|
||||
pluginId,
|
||||
credentials,
|
||||
}: { provider: string; pluginId: string; credentials: Record<string, any>; }) => {
|
||||
return post(`/auth/datasource/provider/${provider}/plugin/${pluginId}`, {
|
||||
return post('/auth/plugin/datasource', {
|
||||
body: {
|
||||
provider,
|
||||
plugin_id: pluginId,
|
||||
credentials,
|
||||
},
|
||||
}).then(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user