diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 3eed6f154..2ba545ad3 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -2216,11 +2216,16 @@ async def get_app_config(request: Request): if data is not None and "id" in data: user = Users.get_user_by_id(data["id"]) + user_count = 0 + if user is None: + user_count = Users.get_num_users() + return { "status": True, "name": WEBUI_NAME, "version": VERSION, "default_locale": str(DEFAULT_LOCALE), + **({"onboarding": True} if user_count is 0 else {}), "oauth": { "providers": { name: config.get("name", name) diff --git a/src/lib/components/OnBoarding.svelte b/src/lib/components/OnBoarding.svelte new file mode 100644 index 000000000..cb85ab9b2 --- /dev/null +++ b/src/lib/components/OnBoarding.svelte @@ -0,0 +1,63 @@ + + +{#if show} +
+ + +
+ +
+ +
+
+
+ + +
{$i18n.t(`wherever you are`)}
+ + + +
+
+
+ +
{$i18n.t(`Get started`)}
+
+
+
+ + +{/if} diff --git a/src/lib/components/common/Marquee.svelte b/src/lib/components/common/Marquee.svelte new file mode 100644 index 000000000..2ab0198cb --- /dev/null +++ b/src/lib/components/common/Marquee.svelte @@ -0,0 +1,30 @@ + + +
+
+ {#key idx} +
+ {words.at(idx)} +
+ {/key} +
+
diff --git a/src/lib/components/common/SlideShow.svelte b/src/lib/components/common/SlideShow.svelte index cf48b62b5..8d224343c 100644 --- a/src/lib/components/common/SlideShow.svelte +++ b/src/lib/components/common/SlideShow.svelte @@ -12,7 +12,7 @@ onMount(() => { setInterval(() => { - selectedImageIdx = (selectedImageIdx + 1) % 5; + selectedImageIdx = (selectedImageIdx + 1) % (imageUrls.length - 1); }, duration); }); diff --git a/src/lib/components/icons/ArrowRightCircle.svelte b/src/lib/components/icons/ArrowRightCircle.svelte new file mode 100644 index 000000000..f899453f1 --- /dev/null +++ b/src/lib/components/icons/ArrowRightCircle.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/routes/auth/+page.svelte b/src/routes/auth/+page.svelte index 5c2f3d179..93e6ea797 100644 --- a/src/routes/auth/+page.svelte +++ b/src/routes/auth/+page.svelte @@ -10,6 +10,7 @@ import { page } from '$app/stores'; import { getBackendConfig } from '$lib/apis'; import SlideShow from '$lib/components/common/SlideShow.svelte'; + import OnBoarding from '$lib/components/OnBoarding.svelte'; const i18n = getContext('i18n'); @@ -87,6 +88,8 @@ await setSessionUser(sessionUser); }; + let onboarding = false; + onMount(async () => { if ($user !== undefined) { await goto('/'); @@ -96,6 +99,7 @@ if (($config?.features.auth_trusted_header ?? false) || $config?.features.auth === false) { await signInHandler(); } + onboarding = $config?.onboarding ?? false; }); @@ -105,15 +109,17 @@ + { + onboarding = false; + mode = 'signup'; + }} +/> +
- - - - {#if loaded}