mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 06:15:23 +00:00
refac
This commit is contained in:
parent
12c4a7a3f7
commit
d99698f7eb
2 changed files with 303 additions and 266 deletions
|
|
@ -1634,7 +1634,19 @@ async def get_app_config(request: Request):
|
|||
),
|
||||
}
|
||||
if user is not None
|
||||
else {
|
||||
**(
|
||||
{
|
||||
"metadata": {
|
||||
"login_footer": app.state.LICENSE_METADATA.get(
|
||||
"login_footer", ""
|
||||
)
|
||||
}
|
||||
}
|
||||
if app.state.LICENSE_METADATA
|
||||
else {}
|
||||
)
|
||||
}
|
||||
),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<script>
|
||||
import DOMPurify from 'dompurify';
|
||||
import { marked } from 'marked';
|
||||
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
import { onMount, getContext, tick } from 'svelte';
|
||||
|
|
@ -192,9 +195,9 @@
|
|||
<div
|
||||
class="fixed bg-transparent min-h-screen w-full flex justify-center font-primary z-50 text-black dark:text-white"
|
||||
>
|
||||
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
|
||||
<div class="w-full px-10 min-h-screen flex flex-col text-center">
|
||||
{#if ($config?.features.auth_trusted_header ?? false) || $config?.features.auth === false}
|
||||
<div class=" my-auto pb-10 w-full">
|
||||
<div class=" my-auto pb-10 w-full sm:max-w-md">
|
||||
<div
|
||||
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-semibold dark:text-gray-200"
|
||||
>
|
||||
|
|
@ -208,7 +211,8 @@
|
|||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class=" my-auto pb-10 w-full dark:text-gray-100">
|
||||
<div class="my-auto flex flex-col justify-center items-center">
|
||||
<div class=" sm:max-w-md my-auto pb-10 w-full dark:text-gray-100">
|
||||
<form
|
||||
class=" flex flex-col justify-center"
|
||||
on:submit={(e) => {
|
||||
|
|
@ -376,7 +380,11 @@
|
|||
window.location.href = `${WEBUI_BASE_URL}/oauth/google/login`;
|
||||
}}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" class="size-6 mr-3">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 48 48"
|
||||
class="size-6 mr-3"
|
||||
>
|
||||
<path
|
||||
fill="#EA4335"
|
||||
d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
|
||||
|
|
@ -401,7 +409,11 @@
|
|||
window.location.href = `${WEBUI_BASE_URL}/oauth/microsoft/login`;
|
||||
}}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 21" class="size-6 mr-3">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 21 21"
|
||||
class="size-6 mr-3"
|
||||
>
|
||||
<rect x="1" y="1" width="9" height="9" fill="#f25022" /><rect
|
||||
x="1"
|
||||
y="11"
|
||||
|
|
@ -416,7 +428,8 @@
|
|||
fill="#ffb900"
|
||||
/>
|
||||
</svg>
|
||||
<span>{$i18n.t('Continue with {{provider}}', { provider: 'Microsoft' })}</span>
|
||||
<span>{$i18n.t('Continue with {{provider}}', { provider: 'Microsoft' })}</span
|
||||
>
|
||||
</button>
|
||||
{/if}
|
||||
{#if $config?.oauth?.providers?.github}
|
||||
|
|
@ -426,7 +439,11 @@
|
|||
window.location.href = `${WEBUI_BASE_URL}/oauth/github/login`;
|
||||
}}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="size-6 mr-3">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="size-6 mr-3"
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.92 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57C20.565 21.795 24 17.31 24 12c0-6.63-5.37-12-12-12z"
|
||||
|
|
@ -487,6 +504,14 @@
|
|||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if $config?.metadata?.login_footer}
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="mt-2 text-[0.7rem] text-gray-500 dark:text-gray-400 marked">
|
||||
{@html DOMPurify.sanitize(marked($config?.metadata?.login_footer))}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue