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