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
276b7b90
Commit
276b7b90
authored
May 26, 2024
by
Jun Siang Cheah
Browse files
Merge remote-tracking branch 'upstream/dev' into feat/backend-web-search
parents
b1265c9c
7b81271b
Changes
103
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
28 deletions
+35
-28
src/routes/(app)/workspace/models/edit/+page.svelte
src/routes/(app)/workspace/models/edit/+page.svelte
+3
-5
src/routes/+layout.svelte
src/routes/+layout.svelte
+9
-2
src/routes/auth/+page.svelte
src/routes/auth/+page.svelte
+23
-21
No files found.
src/routes/(app)/workspace/models/edit/+page.svelte
View file @
276b7b90
...
...
@@ -63,7 +63,7 @@
info
.
id
=
id
;
info
.
name
=
name
;
info
.
meta
.
capabilities
=
capabilities
;
info
.
params
.
stop
=
params
.
stop
!== null
? params.stop.split(',').filter((s) => s.trim()) : null;
info
.
params
.
stop
=
params
.
stop
?
params
.
stop
.
split
(
','
).
filter
((
s
)
=>
s
.
trim
())
:
null
;
const
res
=
await
updateModelById
(
localStorage
.
token
,
info
.
id
,
info
);
...
...
@@ -291,11 +291,9 @@
bind
:
value
={
info
.
base_model_id
}
required
>
<
option
value
={
null
}
class
=
" placeholder:text-gray-500"
>{$
i18n
.
t
(
'Select a base model'
)}</
option
>
<
option
value
={
null
}
class
=
" text-gray-900"
>{$
i18n
.
t
(
'Select a base model'
)}</
option
>
{#
each
$
models
.
filter
((
m
)
=>
m
.
id
!== model.id && !m?.preset) as model}
<
option
value
={
model
.
id
}>{
model
.
name
}</
option
>
<
option
value
={
model
.
id
}
class
=
" text-gray-900"
>{
model
.
name
}</
option
>
{/
each
}
</
select
>
</
div
>
...
...
src/routes/+layout.svelte
View file @
276b7b90
...
...
@@ -13,7 +13,7 @@
import 'tippy.js/dist/tippy.css';
import { WEBUI_BASE_URL } from '$lib/constants';
import i18n, { initI18n } from '$lib/i18n';
import i18n, { initI18n
, getLanguages
} from '$lib/i18n';
setContext('i18n', i18n);
...
...
@@ -43,7 +43,14 @@
}
// Initialize i18n even if we didn't get a backend config,
// so `/error` can show something that's not `undefined`.
initI18n(backendConfig?.default_locale);
const languages = await getLanguages();
const browserLanguage = navigator.languages
? navigator.languages[0]
: navigator.language || navigator.userLanguage;
initI18n(languages.includes(browserLanguage) ? browserLanguage : backendConfig?.default_locale);
if (backendConfig) {
// Save Backend Status to Store
...
...
src/routes/auth/+page.svelte
View file @
276b7b90
...
...
@@ -60,7 +60,7 @@
await goto('/');
}
loaded = true;
if (($config?.trusted_header
_auth
?? false) || $config?.auth === false) {
if (($config?.
auth_
trusted_header ?? false) || $config?.auth === false) {
await signInHandler();
}
});
...
...
@@ -102,7 +102,7 @@
</div> -->
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
{#if ($config?.trusted_header
_auth
?? false) || $config?.auth === false}
{#if ($config?.
auth_
trusted_header ?? false) || $config?.auth === false}
<div class=" my-auto pb-10 w-full">
<div
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-bold dark:text-gray-200"
...
...
@@ -194,25 +194,27 @@
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
</button>
<div class=" mt-4 text-sm text-center">
{mode === 'signin'
? $i18n.t("Don't have an account?")
: $i18n.t('Already have an account?')}
<button
class=" font-medium underline"
type="button"
on:click={() => {
if (mode === 'signin') {
mode = 'signup';
} else {
mode = 'signin';
}
}}
>
{mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')}
</button>
</div>
{#if $config.enable_signup}
<div class=" mt-4 text-sm text-center">
{mode === 'signin'
? $i18n.t("Don't have an account?")
: $i18n.t('Already have an account?')}
<button
class=" font-medium underline"
type="button"
on:click={() => {
if (mode === 'signin') {
mode = 'signup';
} else {
mode = 'signin';
}
}}
>
{mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')}
</button>
</div>
{/if}
</div>
</form>
</div>
...
...
Prev
1
2
3
4
5
6
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