From fa9f8d3a8344942015fbd10cc72d18de74d7d519 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 19 Mar 2023 18:08:57 +0100 Subject: [PATCH] ENHANCEMENT: using global vars for server-capabilities --- src/routes/+page.svelte | 2 +- src/routes/{ => account}/login/+page.svelte | 17 ++++-- src/routes/account/login/Login.svelte | 41 +++++++++++++ src/routes/{ => account}/login/Server.svelte | 22 +++---- src/routes/account/register/+page.svelte | 1 + src/routes/login/Login.svelte | 60 -------------------- src/stores.js | 11 +++- 7 files changed, 75 insertions(+), 79 deletions(-) rename src/routes/{ => account}/login/+page.svelte (73%) create mode 100644 src/routes/account/login/Login.svelte rename src/routes/{ => account}/login/Server.svelte (76%) create mode 100644 src/routes/account/register/+page.svelte delete mode 100644 src/routes/login/Login.svelte diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 526c000..deedc03 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -3,7 +3,7 @@ import { onMount } from 'svelte'; onMount(async () => { - goto("/login"); + goto("/account/login"); }); \ No newline at end of file diff --git a/src/routes/login/+page.svelte b/src/routes/account/login/+page.svelte similarity index 73% rename from src/routes/login/+page.svelte rename to src/routes/account/login/+page.svelte index af3b21c..22a508d 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/account/login/+page.svelte @@ -14,7 +14,11 @@ {/if} - + {#if globalvars.server.url == ''} + + {:else} + + {/if} \ No newline at end of file diff --git a/src/routes/login/Server.svelte b/src/routes/account/login/Server.svelte similarity index 76% rename from src/routes/login/Server.svelte rename to src/routes/account/login/Server.svelte index 50a0724..b9116d1 100644 --- a/src/routes/login/Server.svelte +++ b/src/routes/account/login/Server.svelte @@ -6,7 +6,7 @@ name="server" id="login-server-url" class="input" - bind:value={server}> + bind:value={loginserver}> @@ -16,30 +16,30 @@ \ No newline at end of file diff --git a/src/stores.js b/src/stores.js index 53affe2..2fec3e5 100644 --- a/src/stores.js +++ b/src/stores.js @@ -5,4 +5,13 @@ export const urls = { login: "/login" } -export const serverurl = writable(null); \ No newline at end of file +export const globals = writable({ + server: { + url: '', + caps: { + register: false, + login: false, + reset: false + }, + } +}); \ No newline at end of file