Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
57ffecd0
Unverified
Commit
57ffecd0
authored
Feb 29, 2024
by
Yeuoly
Committed by
GitHub
Feb 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove unnecessary credentials of custom tool (#2621)
parent
801d1353
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
index.tsx
...p/components/tools/edit-custom-collection-modal/index.tsx
+7
-0
test-api.tsx
...omponents/tools/edit-custom-collection-modal/test-api.tsx
+8
-1
No files found.
web/app/components/tools/edit-custom-collection-modal/index.tsx
View file @
57ffecd0
...
@@ -118,6 +118,13 @@ const EditCustomCollectionModal: FC<Props> = ({
...
@@ -118,6 +118,13 @@ const EditCustomCollectionModal: FC<Props> = ({
const
handleSave
=
()
=>
{
const
handleSave
=
()
=>
{
const
postData
=
clone
(
customCollection
)
const
postData
=
clone
(
customCollection
)
delete
postData
.
tools
delete
postData
.
tools
if
(
postData
.
credentials
.
auth_type
===
AuthType
.
none
)
{
delete
postData
.
credentials
.
api_key_header
delete
postData
.
credentials
.
api_key_header_prefix
delete
postData
.
credentials
.
api_key_value
}
if
(
isAdd
)
{
if
(
isAdd
)
{
onAdd
?.(
postData
)
onAdd
?.(
postData
)
return
return
...
...
web/app/components/tools/edit-custom-collection-modal/test-api.tsx
View file @
57ffecd0
...
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
...
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
import
{
useContext
}
from
'use-context-selector'
import
{
useContext
}
from
'use-context-selector'
import
{
Settings01
}
from
'../../base/icons/src/vender/line/general'
import
{
Settings01
}
from
'../../base/icons/src/vender/line/general'
import
ConfigCredentials
from
'./config-credentials'
import
ConfigCredentials
from
'./config-credentials'
import
type
{
Credential
,
CustomCollectionBackend
,
CustomParamSchema
}
from
'@/app/components/tools/types'
import
{
AuthType
,
type
Credential
,
type
CustomCollectionBackend
,
type
CustomParamSchema
}
from
'@/app/components/tools/types'
import
Button
from
'@/app/components/base/button'
import
Button
from
'@/app/components/base/button'
import
Drawer
from
'@/app/components/base/drawer-plus'
import
Drawer
from
'@/app/components/base/drawer-plus'
import
I18n
from
'@/context/i18n'
import
I18n
from
'@/context/i18n'
...
@@ -34,6 +34,13 @@ const TestApi: FC<Props> = ({
...
@@ -34,6 +34,13 @@ const TestApi: FC<Props> = ({
const
{
operation_id
:
toolName
,
parameters
}
=
tool
const
{
operation_id
:
toolName
,
parameters
}
=
tool
const
[
parametersValue
,
setParametersValue
]
=
useState
<
Record
<
string
,
string
>>
({})
const
[
parametersValue
,
setParametersValue
]
=
useState
<
Record
<
string
,
string
>>
({})
const
handleTest
=
async
()
=>
{
const
handleTest
=
async
()
=>
{
// clone test schema
const
credentials
=
JSON
.
parse
(
JSON
.
stringify
(
tempCredential
))
as
Credential
if
(
credentials
.
auth_type
===
AuthType
.
none
)
{
delete
credentials
.
api_key_header_prefix
delete
credentials
.
api_key_header
delete
credentials
.
api_key_value
}
const
data
=
{
const
data
=
{
tool_name
:
toolName
,
tool_name
:
toolName
,
credentials
:
tempCredential
,
credentials
:
tempCredential
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment