mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
refac
This commit is contained in:
parent
8a9f862701
commit
4cea3a57be
2 changed files with 11 additions and 0 deletions
|
|
@ -127,6 +127,9 @@ async def get_tools(
|
||||||
headers["Authorization"] = (
|
headers["Authorization"] = (
|
||||||
f"Bearer {tool_server_connection.get('key', '')}"
|
f"Bearer {tool_server_connection.get('key', '')}"
|
||||||
)
|
)
|
||||||
|
elif auth_type == "none":
|
||||||
|
# No authentication
|
||||||
|
pass
|
||||||
elif auth_type == "session":
|
elif auth_type == "session":
|
||||||
cookies = request.cookies
|
cookies = request.cookies
|
||||||
headers["Authorization"] = (
|
headers["Authorization"] = (
|
||||||
|
|
|
||||||
|
|
@ -283,6 +283,8 @@
|
||||||
class={`w-full text-sm bg-transparent pr-5 ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
class={`w-full text-sm bg-transparent pr-5 ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
|
||||||
bind:value={auth_type}
|
bind:value={auth_type}
|
||||||
>
|
>
|
||||||
|
<option value="none">{$i18n.t('None')}</option>
|
||||||
|
|
||||||
<option value="bearer">{$i18n.t('Bearer')}</option>
|
<option value="bearer">{$i18n.t('Bearer')}</option>
|
||||||
<option value="session">{$i18n.t('Session')}</option>
|
<option value="session">{$i18n.t('Session')}</option>
|
||||||
|
|
||||||
|
|
@ -299,6 +301,12 @@
|
||||||
placeholder={$i18n.t('API Key')}
|
placeholder={$i18n.t('API Key')}
|
||||||
required={false}
|
required={false}
|
||||||
/>
|
/>
|
||||||
|
{:else if auth_type === 'none'}
|
||||||
|
<div
|
||||||
|
class={`text-xs self-center translate-y-[1px] ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
|
>
|
||||||
|
{$i18n.t('No authentication')}
|
||||||
|
</div>
|
||||||
{:else if auth_type === 'session'}
|
{:else if auth_type === 'session'}
|
||||||
<div
|
<div
|
||||||
class={`text-xs self-center translate-y-[1px] ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
class={`text-xs self-center translate-y-[1px] ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue