Commit 276b7b90 authored by Jun Siang Cheah's avatar Jun Siang Cheah
Browse files

Merge remote-tracking branch 'upstream/dev' into feat/backend-web-search

parents b1265c9c 7b81271b
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
info.id = id; info.id = id;
info.name = name; info.name = name;
info.meta.capabilities = capabilities; 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); const res = await updateModelById(localStorage.token, info.id, info);
...@@ -291,11 +291,9 @@ ...@@ -291,11 +291,9 @@
bind:value={info.base_model_id} bind:value={info.base_model_id}
required required
> >
<option value={null} class=" placeholder:text-gray-500" <option value={null} class=" text-gray-900">{$i18n.t('Select a base model')}</option>
>{$i18n.t('Select a base model')}</option
>
{#each $models.filter((m) => m.id !== model.id && !m?.preset) as model} {#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} {/each}
</select> </select>
</div> </div>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
import 'tippy.js/dist/tippy.css'; import 'tippy.js/dist/tippy.css';
import { WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants';
import i18n, { initI18n } from '$lib/i18n'; import i18n, { initI18n, getLanguages } from '$lib/i18n';
setContext('i18n', i18n); setContext('i18n', i18n);
...@@ -43,7 +43,14 @@ ...@@ -43,7 +43,14 @@
} }
// Initialize i18n even if we didn't get a backend config, // Initialize i18n even if we didn't get a backend config,
// so `/error` can show something that's not `undefined`. // 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) { if (backendConfig) {
// Save Backend Status to Store // Save Backend Status to Store
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
await goto('/'); await goto('/');
} }
loaded = true; loaded = true;
if (($config?.trusted_header_auth ?? false) || $config?.auth === false) { if (($config?.auth_trusted_header ?? false) || $config?.auth === false) {
await signInHandler(); await signInHandler();
} }
}); });
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</div> --> </div> -->
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center"> <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=" my-auto pb-10 w-full">
<div <div
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-bold dark:text-gray-200" 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 @@ ...@@ -194,25 +194,27 @@
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')} {mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
</button> </button>
<div class=" mt-4 text-sm text-center"> {#if $config.enable_signup}
{mode === 'signin' <div class=" mt-4 text-sm text-center">
? $i18n.t("Don't have an account?") {mode === 'signin'
: $i18n.t('Already have an account?')} ? $i18n.t("Don't have an account?")
: $i18n.t('Already have an account?')}
<button
class=" font-medium underline" <button
type="button" class=" font-medium underline"
on:click={() => { type="button"
if (mode === 'signin') { on:click={() => {
mode = 'signup'; if (mode === 'signin') {
} else { mode = 'signup';
mode = 'signin'; } else {
} mode = 'signin';
}} }
> }}
{mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')} >
</button> {mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')}
</div> </button>
</div>
{/if}
</div> </div>
</form> </form>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment