Updates and more
This commit is contained in:
24
src/pages/dashboard.astro
Normal file
24
src/pages/dashboard.astro
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
import NavbarLayout from "../layouts/NavbarLayout.astro";
|
||||
import localBau from "../images/2023-10-08_20.43.43.png";
|
||||
import { Image } from "astro:assets";
|
||||
import Dashboard from "../components/Dashboard.svelte";
|
||||
---
|
||||
|
||||
<NavbarLayout title="Dashboard">
|
||||
<div>
|
||||
<Image src={localBau} alt="Bau" width="1920" height="1080" class="w-screen h-screen dark:brightness-75 fixed -z-10 object-cover" draggable="false" />
|
||||
<div class="mx-auto bg-gray-100 p-8 rounded-b-md shadow-md pt-40 sm:pt-28 md:pt-14
|
||||
dark:text-white dark:bg-neutral-900" style="width: min(100vw, 75em)">
|
||||
<script>
|
||||
import {AES} from "crypto-js";
|
||||
import {l} from "../util/util";
|
||||
if (AES.decrypt(localStorage.getItem("sw-session") ?? "", import.meta.env.PUBLIC_SECRET)?.toString() === "") {
|
||||
window.location.href = l("/login");
|
||||
}
|
||||
</script>
|
||||
<Dashboard client:only="svelte" />
|
||||
</div>
|
||||
</div>
|
||||
</NavbarLayout>
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
|
||||
---
|
||||
@@ -4,7 +4,7 @@ import NavbarLayout from "../layouts/NavbarLayout.astro";
|
||||
import { Image } from "astro:assets";
|
||||
import localBau from "../images/2023-10-08_20.43.43.png";
|
||||
import {CaretRight, Archive, Rocket, Bell} from "@astropub/icons"
|
||||
import {astroI18n, t} from "astro-i18n";
|
||||
import {t} from "astro-i18n";
|
||||
import {l} from "../util/util"
|
||||
import PlayerCount from "../components/PlayerCount.svelte";
|
||||
|
||||
|
||||
@@ -2,41 +2,22 @@
|
||||
import NavbarLayout from "../layouts/NavbarLayout.astro";
|
||||
import localBau from "../images/2023-10-08_20.43.43.png";
|
||||
import {Image} from "astro:assets";
|
||||
|
||||
import {l} from "../util/util";
|
||||
import Login from "../components/Login.svelte";
|
||||
---
|
||||
|
||||
<NavbarLayout title="Login">
|
||||
<script>
|
||||
import {l} from "../util/util";
|
||||
import {AES} from "crypto-js";
|
||||
|
||||
if (AES.decrypt(localStorage.getItem("sw-session") ?? "", import.meta.env.PUBLIC_SECRET)?.toString() !== "") {
|
||||
window.location.href = l("/dashboard");
|
||||
}
|
||||
</script>
|
||||
<Image src={localBau} alt="Bau" width="1920" height="1080" class="w-screen h-screen dark:brightness-75 fixed -z-10 object-cover" draggable="false" />
|
||||
<div class="h-screen mx-auto p-8 rounded-b-md shadow-md pt-40 sm:pt-28 md:pt-14 flex flex-col justify-center items-center
|
||||
dark:text-white " style="width: min(100vw, 75em);">
|
||||
<div class="bg-gray-100 dark:bg-neutral-900 p-12 rounded-2xl shadow-2xl border-2 border-gray-600 flex flex-col">
|
||||
<h1 class="text-4xl text-white text-center">Login</h1>
|
||||
<div class="ml-2 flex flex-col">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" id="username" name="username" placeholder="Username..." />
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" name="password" placeholder="****************" />
|
||||
</div>
|
||||
<button class="btn mt-4 !mx-0 justify-center">Login</button>
|
||||
</div>
|
||||
<Login client:load />
|
||||
</div>
|
||||
<script>
|
||||
import {l} from "../util/util";
|
||||
|
||||
if (localStorage.getItem("sw-api-token") !== null) {
|
||||
window.location.href = l("/account")
|
||||
}
|
||||
</script>
|
||||
</NavbarLayout>
|
||||
|
||||
<style>
|
||||
input {
|
||||
@apply border-2 rounded-md p-2 shadow-2xl w-80
|
||||
dark:bg-neutral-800
|
||||
focus:outline-none focus:ring-2 focus:ring-neutral-500 focus:border-transparent;
|
||||
}
|
||||
|
||||
label {
|
||||
@apply text-neutral-300;
|
||||
}
|
||||
</style>
|
||||
</NavbarLayout>
|
||||
Reference in New Issue
Block a user