mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 10:17:00 +00:00
fix: tool server api key not being sent
This commit is contained in:
parent
959995c715
commit
2277566ce1
@ -25,7 +25,11 @@
|
|||||||
export let connection = null;
|
export let connection = null;
|
||||||
|
|
||||||
let url = '';
|
let url = '';
|
||||||
|
let openApiPath = '/openapi.json';
|
||||||
|
|
||||||
|
let auth_type = 'bearer';
|
||||||
let key = '';
|
let key = '';
|
||||||
|
|
||||||
let enable = true;
|
let enable = true;
|
||||||
|
|
||||||
let loading = false;
|
let loading = false;
|
||||||
@ -57,7 +61,10 @@
|
|||||||
const init = () => {
|
const init = () => {
|
||||||
if (connection) {
|
if (connection) {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
key = connection.key;
|
openApiPath = connection.openApiPath ?? '/openapi.json';
|
||||||
|
|
||||||
|
auth_type = connection.auth_type ?? 'bearer';
|
||||||
|
key = connection?.key ?? '';
|
||||||
|
|
||||||
enable = connection.config?.enable ?? true;
|
enable = connection.config?.enable ?? true;
|
||||||
}
|
}
|
||||||
@ -125,9 +132,20 @@
|
|||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex-1">
|
||||||
|
<input
|
||||||
|
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
||||||
|
type="text"
|
||||||
|
bind:value={openApiPath}
|
||||||
|
placeholder={$i18n.t('openapi.json Path')}
|
||||||
|
autocomplete="off"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col shrink-0 self-end">
|
<div class="flex flex-col shrink-0 self-start">
|
||||||
<Tooltip content={enable ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
|
<Tooltip content={enable ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
|
||||||
<Switch bind:state={enable} />
|
<Switch bind:state={enable} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -135,22 +153,41 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-xs text-gray-500 mt-1">
|
<div class="text-xs text-gray-500 mt-1">
|
||||||
{$i18n.t(`WebUI will make requests to "{{url}}/openapi.json"`, {
|
{$i18n.t(`WebUI will make requests to "{{url}}{{path}}"`, {
|
||||||
url: url
|
url: url,
|
||||||
|
path: openApiPath
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2 mt-2">
|
<div class="flex gap-2 mt-2">
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<div class=" mb-0.5 text-xs text-gray-500">{$i18n.t('Key')}</div>
|
<div class=" text-xs text-gray-500">{$i18n.t('Auth')}</div>
|
||||||
|
|
||||||
<div class="flex-1">
|
<div class="flex gap-2">
|
||||||
|
<div class="flex-shrink-0 self-start">
|
||||||
|
<select
|
||||||
|
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden pr-5"
|
||||||
|
bind:value={auth_type}
|
||||||
|
>
|
||||||
|
<option value="bearer">Bearer</option>
|
||||||
|
<option value="session">Session</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-1 items-center">
|
||||||
|
{#if auth_type === 'bearer'}
|
||||||
<SensitiveInput
|
<SensitiveInput
|
||||||
className="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
className="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
||||||
bind:value={key}
|
bind:value={key}
|
||||||
placeholder={$i18n.t('API Key')}
|
placeholder={$i18n.t('API Key')}
|
||||||
required={false}
|
required={false}
|
||||||
/>
|
/>
|
||||||
|
{:else if auth_type === 'session'}
|
||||||
|
<div class="text-xs text-gray-500 self-center translate-y-[1px]">
|
||||||
|
{$i18n.t('Forwards system user session credentials to authenticate')}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -205,7 +205,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const executeTool = async (data, cb) => {
|
const executeTool = async (data, cb) => {
|
||||||
const toolServer = $toolServers?.find((server) => server.url === data.server?.url);
|
const toolServer = $settings?.toolServers?.find((server) => server.url === data.server?.url);
|
||||||
|
const toolServerData = $toolServers?.find((server) => server.url === data.server?.url);
|
||||||
|
|
||||||
console.log('executeTool', data, toolServer);
|
console.log('executeTool', data, toolServer);
|
||||||
|
|
||||||
@ -215,7 +216,7 @@
|
|||||||
toolServer.url,
|
toolServer.url,
|
||||||
data?.name,
|
data?.name,
|
||||||
data?.params,
|
data?.params,
|
||||||
toolServer
|
toolServerData
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('executeToolServer', res);
|
console.log('executeToolServer', res);
|
||||||
|
Loading…
Reference in New Issue
Block a user