From 58be3b0c4a0db9427f494983c387f13b08b86d8d Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Tue, 28 Feb 2023 14:13:18 -0500 Subject: [PATCH] UI/org work --- tfweb/src/components/FullPageError.svelte | 14 ++ tfweb/src/components/Header.svelte | 12 +- tfweb/src/lib/auth.ts | 3 + tfweb/src/lib/i18n/en.json | 24 ++++ tfweb/src/lib/orgs.ts | 77 +++++++++++ tfweb/src/routes/+error.svelte | 14 ++ tfweb/src/routes/admin/+page.svelte | 150 +++++++++++++++++++++- tfweb/src/routes/auth/login/+page.svelte | 4 +- tfweb/src/routes/org/new/+page.svelte | 150 ++++++++++++++++++++++ tfweb/src/routes/signup/+page.svelte | 4 +- trifid-api/src/main.rs | 4 +- trifid-api/src/routes/v1/mod.rs | 3 +- trifid-api/src/routes/v1/user.rs | 47 +++++++ trifid-api/src/routes/v2/whoami.rs | 10 +- 14 files changed, 503 insertions(+), 13 deletions(-) create mode 100644 tfweb/src/components/FullPageError.svelte create mode 100644 tfweb/src/lib/orgs.ts create mode 100644 tfweb/src/routes/+error.svelte create mode 100644 tfweb/src/routes/org/new/+page.svelte create mode 100644 trifid-api/src/routes/v1/user.rs diff --git a/tfweb/src/components/FullPageError.svelte b/tfweb/src/components/FullPageError.svelte new file mode 100644 index 0000000..595c84c --- /dev/null +++ b/tfweb/src/components/FullPageError.svelte @@ -0,0 +1,14 @@ + + +
+
+ +
+

{title}

+

{subtitle}

+
+
+
\ No newline at end of file diff --git a/tfweb/src/components/Header.svelte b/tfweb/src/components/Header.svelte index b98af39..d8b5e2f 100644 --- a/tfweb/src/components/Header.svelte +++ b/tfweb/src/components/Header.svelte @@ -7,6 +7,10 @@ import {getCookie} from "$lib/cookie"; import {setCookie} from "$lib/cookie"; import {get_user_info, renderDevMenu} from "$lib/auth"; + import {browser} from "$app/environment"; + + let loggedin; + if (browser) { loggedin = getCookie("authToken") !== "" } else { loggedin = false }; function toggleTheme() { if ($theme === "dark") { @@ -50,7 +54,13 @@