add report admin panel
All checks were successful
delpoy / build-and-deploy (push) Successful in 53s

This commit is contained in:
2023-09-29 02:08:34 +02:00
parent 37c230575d
commit 722026c938
19 changed files with 423 additions and 26 deletions

View File

@@ -5,7 +5,7 @@
import { buttonTriggeredRequest } from '$lib/components/utils';
import { goto } from '$app/navigation';
import type { LayoutData } from './$types';
import { adminCount } from '$lib/stores';
import { adminCount, reportCount } from '$lib/stores';
async function logout() {
const response = await fetch(`${env.PUBLIC_BASE_PATH}/admin/logout`, {
@@ -19,11 +19,12 @@
}
export let data: LayoutData;
if (data.reportCount) $reportCount = data.reportCount;
if (data.adminCount) $adminCount = data.adminCount;
</script>
{#if $page.url.pathname !== `${env.PUBLIC_BASE_PATH}/admin/login`}
<div class="flex h-screen">
<div class="flex h-screen w-screen">
<div class="h-full">
<ul class="menu p-4 w-max h-full bg-base-200 text-base-content">
{#if data.userCount != null}
@@ -35,6 +36,15 @@
</a>
</li>
{/if}
{#if data.reportCount != null}
<li>
<a href="{env.PUBLIC_BASE_PATH}/admin/reports">
<IconOutline name="flag-outline" />
<span class="ml-1">Reports</span>
<div class="badge">{$reportCount}</div>
</a>
</li>
{/if}
{#if data.adminCount != null}
<li>
<a href="{env.PUBLIC_BASE_PATH}/admin/admin">
@@ -52,7 +62,7 @@
</li>
</ul>
</div>
<div class="h-full w-full overflow-scroll">
<div class="h-full w-full overflow-y-scroll overflow-x-hidden">
<slot />
</div>
</div>