Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
621719c6
"src/lib/vscode:/vscode.git/clone" did not exist on "a53796270f3cf7c1291bf901ee18bee03bb19a3b"
Unverified
Commit
621719c6
authored
Mar 18, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Mar 18, 2024
Browse files
Merge pull request #1187 from open-webui/dev
0.1.113
parents
5ce421e7
ec9895a1
Changes
82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
22 deletions
+35
-22
src/routes/auth/+page.svelte
src/routes/auth/+page.svelte
+22
-14
src/routes/error/+page.svelte
src/routes/error/+page.svelte
+13
-8
No files found.
src/routes/auth/+page.svelte
View file @
621719c6
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
import { userSignIn, userSignUp } from '$lib/apis/auths';
import { userSignIn, userSignUp } from '$lib/apis/auths';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import { WEBUI_NAME, config, user } from '$lib/stores';
import { WEBUI_NAME, config, user } from '$lib/stores';
import { onMount } from 'svelte';
import { onMount
, getContext
} from 'svelte';
import { toast } from 'svelte-sonner';
import { toast } from 'svelte-sonner';
const i18n = getContext('i18n');
let loaded = false;
let loaded = false;
let mode = 'signin';
let mode = 'signin';
...
@@ -16,7 +18,7 @@
...
@@ -16,7 +18,7 @@
const setSessionUser = async (sessionUser) => {
const setSessionUser = async (sessionUser) => {
if (sessionUser) {
if (sessionUser) {
console.log(sessionUser);
console.log(sessionUser);
toast.success(`You're now logged in.`);
toast.success(
$i18n.t(
`You're now logged in.`)
)
;
localStorage.token = sessionUser.token;
localStorage.token = sessionUser.token;
await user.set(sessionUser);
await user.set(sessionUser);
goto('/');
goto('/');
...
@@ -96,26 +98,30 @@
...
@@ -96,26 +98,30 @@
}}
}}
>
>
<div class=" text-xl sm:text-2xl font-bold">
<div class=" text-xl sm:text-2xl font-bold">
{mode === 'signin' ? 'Sign in' : 'Sign up'} to {$WEBUI_NAME}
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Sign up')}
{$i18n.t('to')}
{$WEBUI_NAME}
</div>
</div>
{#if mode === 'signup'}
{#if mode === 'signup'}
<div class=" mt-1 text-xs font-medium text-gray-500">
<div class=" mt-1 text-xs font-medium text-gray-500">
ⓘ {$WEBUI_NAME} does not make any external connections, and your data stays securely on
ⓘ {$WEBUI_NAME}
your locally hosted server.
{$i18n.t(
'does not make any external connections, and your data stays securely on your locally hosted server.'
)}
</div>
</div>
{/if}
{/if}
<div class="flex flex-col mt-4">
<div class="flex flex-col mt-4">
{#if mode === 'signup'}
{#if mode === 'signup'}
<div>
<div>
<div class=" text-sm font-semibold text-left mb-1">Name</div>
<div class=" text-sm font-semibold text-left mb-1">
{$i18n.t('
Name
')}
</div>
<input
<input
bind:value={name}
bind:value={name}
type="text"
type="text"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
autocomplete="name"
autocomplete="name"
placeholder=
"
Enter Your Full Name
"
placeholder=
{$i18n.t('
Enter Your Full Name
')}
required
required
/>
/>
</div>
</div>
...
@@ -124,24 +130,24 @@
...
@@ -124,24 +130,24 @@
{/if}
{/if}
<div class="mb-2">
<div class="mb-2">
<div class=" text-sm font-semibold text-left mb-1">Email</div>
<div class=" text-sm font-semibold text-left mb-1">
{$i18n.t('
Email
')}
</div>
<input
<input
bind:value={email}
bind:value={email}
type="email"
type="email"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
autocomplete="email"
autocomplete="email"
placeholder=
"
Enter Your Email
"
placeholder=
{$i18n.t('
Enter Your Email
')}
required
required
/>
/>
</div>
</div>
<div>
<div>
<div class=" text-sm font-semibold text-left mb-1">Password</div>
<div class=" text-sm font-semibold text-left mb-1">
{$i18n.t('
Password
')}
</div>
<input
<input
bind:value={password}
bind:value={password}
type="password"
type="password"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
placeholder=
"
Enter Your Password
"
placeholder=
{$i18n.t('
Enter Your Password
')}
autocomplete="current-password"
autocomplete="current-password"
required
required
/>
/>
...
@@ -153,11 +159,13 @@
...
@@ -153,11 +159,13 @@
class=" bg-gray-900 hover:bg-gray-800 w-full rounded-full text-white font-semibold text-sm py-3 transition"
class=" bg-gray-900 hover:bg-gray-800 w-full rounded-full text-white font-semibold text-sm py-3 transition"
type="submit"
type="submit"
>
>
{mode === 'signin' ? 'Sign
I
n' : 'Create Account'}
{mode === 'signin' ?
$i18n.t(
'Sign
i
n'
)
:
$i18n.t(
'Create Account'
)
}
</button>
</button>
<div class=" mt-4 text-sm text-center">
<div class=" mt-4 text-sm text-center">
{mode === 'signin' ? `Don't have an account?` : `Already have an account?`}
{mode === 'signin'
? $i18n.t("Don't have an account?")
: $i18n.t('Already have an account?')}
<button
<button
class=" font-medium underline"
class=" font-medium underline"
...
@@ -170,7 +178,7 @@
...
@@ -170,7 +178,7 @@
}
}
}}
}}
>
>
{mode === 'signin' ?
`
Sign up
`
:
`
Sign
In`
}
{mode === 'signin' ?
$i18n.t('
Sign up
')
:
$i18n.t('
Sign
in')
}
</button>
</button>
</div>
</div>
</div>
</div>
...
...
src/routes/error/+page.svelte
View file @
621719c6
<script>
<script>
import { goto } from '$app/navigation';
import { goto } from '$app/navigation';
import { WEBUI_NAME, config } from '$lib/stores';
import { WEBUI_NAME, config } from '$lib/stores';
import { onMount } from 'svelte';
import { onMount, getContext } from 'svelte';
const i18n = getContext('i18n');
let loaded = false;
let loaded = false;
...
@@ -19,22 +21,25 @@
...
@@ -19,22 +21,25 @@
<div class="absolute rounded-xl w-full h-full backdrop-blur flex justify-center">
<div class="absolute rounded-xl w-full h-full backdrop-blur flex justify-center">
<div class="m-auto pb-44 flex flex-col justify-center">
<div class="m-auto pb-44 flex flex-col justify-center">
<div class="max-w-md">
<div class="max-w-md">
<div class="text-center text-2xl font-medium z-50">{$WEBUI_NAME} Backend Required</div>
<div class="text-center text-2xl font-medium z-50">
{$i18n.t('{{webUIName}} Backend Required', { webUIName: $WEBUI_NAME })}
</div>
<div class=" mt-4 text-center text-sm w-full">
<div class=" mt-4 text-center text-sm w-full">
Oops! You're using an unsupported method (frontend only). Please serve the WebUI from
{$i18n.t(
the backend.
"Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend."
)}
<br class=" " />
<br class=" " />
<br class=" " />
<br class=" " />
<a
<a
class=" font-semibold underline"
class=" font-semibold underline"
href="https://github.com/open-webui/open-webui#how-to-install-"
href="https://github.com/open-webui/open-webui#how-to-install-"
target="_blank">See readme.md for instructions</a
target="_blank">
{$i18n.t('
See readme.md for instructions
')}
</a
>
>
or
{$i18n.t('or')}
<a class=" font-semibold underline" href="https://discord.gg/5rJgQTnV4s" target="_blank"
<a class=" font-semibold underline" href="https://discord.gg/5rJgQTnV4s" target="_blank"
>join our Discord for help.</a
>
{$i18n.t('
join our Discord for help.
')}
</a
>
>
</div>
</div>
...
@@ -45,7 +50,7 @@
...
@@ -45,7 +50,7 @@
location.href = '/';
location.href = '/';
}}
}}
>
>
Check Again
{$i18n.t('
Check Again
')}
</button>
</button>
</div>
</div>
</div>
</div>
...
...
Prev
1
2
3
4
5
Next
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