mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
enh: openapi tool server custom path
This commit is contained in:
parent
a32bb850fa
commit
77fa11098a
@ -262,7 +262,7 @@ export const stopTask = async (token: string, id: string) => {
|
|||||||
export const getToolServerData = async (token: string, url: string) => {
|
export const getToolServerData = async (token: string, url: string) => {
|
||||||
let error = null;
|
let error = null;
|
||||||
|
|
||||||
const res = await fetch(`${url}/openapi.json`, {
|
const res = await fetch(`${url}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
@ -304,10 +304,13 @@ export const getToolServersData = async (i18n, servers: object[]) => {
|
|||||||
servers
|
servers
|
||||||
.filter((server) => server?.config?.enable)
|
.filter((server) => server?.config?.enable)
|
||||||
.map(async (server) => {
|
.map(async (server) => {
|
||||||
const data = await getToolServerData(server?.key, server?.url).catch((err) => {
|
const data = await getToolServerData(
|
||||||
|
server?.key,
|
||||||
|
server?.url + (server?.path ?? '/openapi.json')
|
||||||
|
).catch((err) => {
|
||||||
toast.error(
|
toast.error(
|
||||||
i18n.t(`Failed to connect to {{URL}} OpenAPI tool server`, {
|
i18n.t(`Failed to connect to {{URL}} OpenAPI tool server`, {
|
||||||
URL: server?.url
|
URL: server?.url + (server?.path ?? '/openapi.json')
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
return null;
|
return null;
|
||||||
|
@ -56,8 +56,8 @@
|
|||||||
show = false;
|
show = false;
|
||||||
|
|
||||||
url = '';
|
url = '';
|
||||||
key = '';
|
|
||||||
path = '/openapi.json';
|
path = '/openapi.json';
|
||||||
|
key = '';
|
||||||
auth_type = 'bearer';
|
auth_type = 'bearer';
|
||||||
|
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user