From 232a63c47c60077112f9861dd152b0040c77c8e4 Mon Sep 17 00:00:00 2001 From: Mateo Morris Date: Thu, 31 Aug 2023 21:03:51 -0400 Subject: [PATCH] V2.0.0 beta.34 --- src/lib/components/DashboardToolbar.svelte | 134 ++++----- src/routes/+layout.svelte | 307 +++++++++++---------- src/routes/auth/+page.server.js | 8 + src/routes/auth/+page.svelte | 263 +++++++++++------- src/routes/auth/SignIn.svelte | 102 ------- src/routes/auth/SignUp.svelte | 131 --------- 6 files changed, 394 insertions(+), 551 deletions(-) delete mode 100644 src/routes/auth/SignIn.svelte delete mode 100644 src/routes/auth/SignUp.svelte diff --git a/src/lib/components/DashboardToolbar.svelte b/src/lib/components/DashboardToolbar.svelte index 3052ce8a9..df04211fa 100644 --- a/src/lib/components/DashboardToolbar.svelte +++ b/src/lib/components/DashboardToolbar.svelte @@ -1,89 +1,75 @@
- - + +
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e4bb3c42a..b32d6642e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,123 +1,132 @@ diff --git a/src/routes/auth/+page.server.js b/src/routes/auth/+page.server.js index 1dd4f7f0b..bd687a0fa 100644 --- a/src/routes/auth/+page.server.js +++ b/src/routes/auth/+page.server.js @@ -55,6 +55,14 @@ export const actions = { } } + const {data:n_users} = await supabase_admin.from('users').select('count') + if (n_users?.length > 0) { + return { + success: false, + error: 'Server already initialized. Sign in as the server owner to invite users.' + } + } + const data = await request.formData(); const email = data.get('email'); const password = data.get('password'); diff --git a/src/routes/auth/+page.svelte b/src/routes/auth/+page.svelte index a89d3157f..fae07c5a8 100644 --- a/src/routes/auth/+page.svelte +++ b/src/routes/auth/+page.svelte @@ -1,110 +1,183 @@ {#key signing_in} -
-
- -
-
- -

{signing_in ? 'Sign in' : 'Create your account'}

- {#if !signing_in} -

- Welcome to your new Primo server! Enter an email address and - password you'll use to administrate this server. -

- {/if} -
- {#if error} -
{error}
- {/if} - {#if signing_in} - (signing_in = false)} - /> - {:else} - (signing_in = true)} - /> - {/if} -
-
-
+
+
+ +
+
+ +

{signing_in ? 'Sign in' : 'Create your account'}

+ {#if !signing_in} +

+ Welcome to your new Primo server! Enter an email address and password you'll use to + administrate this server. +

+ {/if} +
+ {#if error} +
{error}
+ {/if} +
+
+ + +
+ +
+
+
+
{/key} diff --git a/src/routes/auth/SignIn.svelte b/src/routes/auth/SignIn.svelte deleted file mode 100644 index 951949adf..000000000 --- a/src/routes/auth/SignIn.svelte +++ /dev/null @@ -1,102 +0,0 @@ - - -
-
- - -
- -
- - - diff --git a/src/routes/auth/SignUp.svelte b/src/routes/auth/SignUp.svelte deleted file mode 100644 index 7052e901f..000000000 --- a/src/routes/auth/SignUp.svelte +++ /dev/null @@ -1,131 +0,0 @@ - - -
-
- - - -
- -
- - -