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
b5ed81b3
Unverified
Commit
b5ed81b3
authored
Jan 31, 2024
by
Joel
Committed by
GitHub
Jan 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: invalid server tool url caused crash (#2311)
parent
625b0afa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
index.tsx
...p/components/tools/edit-custom-collection-modal/index.tsx
+14
-1
No files found.
web/app/components/tools/edit-custom-collection-modal/index.tsx
View file @
b5ed81b3
...
...
@@ -126,6 +126,19 @@ const EditCustomCollectionModal: FC<Props> = ({
})
}
const
getPath
=
(
url
:
string
)
=>
{
if
(
!
url
)
return
''
try
{
const
path
=
new
URL
(
url
).
pathname
return
path
||
''
}
catch
(
e
)
{
return
url
}
}
return
(
<>
<
Drawer
...
...
@@ -202,7 +215,7 @@ const EditCustomCollectionModal: FC<Props> = ({
<
td
className=
"p-2 pl-3"
>
{
item
.
operation_id
}
</
td
>
<
td
className=
"p-2 pl-3 text-gray-500 w-[236px]"
>
{
item
.
summary
}
</
td
>
<
td
className=
"p-2 pl-3"
>
{
item
.
method
}
</
td
>
<
td
className=
"p-2 pl-3"
>
{
item
.
server_url
?
new
URL
(
item
.
server_url
).
pathname
:
''
}
</
td
>
<
td
className=
"p-2 pl-3"
>
{
getPath
(
item
.
server_url
)
}
</
td
>
<
td
className=
"p-2 pl-3 w-[62px]"
>
<
Button
className=
'!h-6 !px-2 text-xs font-medium text-gray-700 whitespace-nowrap'
...
...
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