add simple dashboard on root admin route
All checks were successful
delpoy / build-and-deploy (push) Successful in 2m9s
All checks were successful
delpoy / build-and-deploy (push) Successful in 2m9s
This commit is contained in:
parent
981e1c3f9b
commit
9562cdeb95
@ -52,6 +52,7 @@
|
|||||||
<div class="h-12 relative bg-base-200 flex justify-center items-center">
|
<div class="h-12 relative bg-base-200 flex justify-center items-center">
|
||||||
<ul class="menu menu-horizontal h-10 p-0 flex items-center bg-base-300 rounded-lg">
|
<ul class="menu menu-horizontal h-10 p-0 flex items-center bg-base-300 rounded-lg">
|
||||||
{#each tabs as tab}
|
{#each tabs as tab}
|
||||||
|
{#if tab.enabled}
|
||||||
<li>
|
<li>
|
||||||
<a href={tab.path}>
|
<a href={tab.path}>
|
||||||
<IconOutline name={tab.icon} />
|
<IconOutline name={tab.icon} />
|
||||||
@ -59,6 +60,7 @@
|
|||||||
<div class="badge">{tab.badge}</div>
|
<div class="badge">{tab.badge}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="absolute top-0 right-0 flex items-center h-full">
|
<div class="absolute top-0 right-0 flex items-center h-full">
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { PageData } from './$types';
|
||||||
|
import { env } from '$env/dynamic/public';
|
||||||
|
import { IconOutline } from 'svelte-heros-v2';
|
||||||
|
|
||||||
|
export let data: PageData;
|
||||||
|
|
||||||
|
let tabs = [
|
||||||
|
{
|
||||||
|
path: `${env.PUBLIC_BASE_PATH}/admin/users`,
|
||||||
|
icon: 'user-group-outline',
|
||||||
|
name: 'Registrierte Nutzer',
|
||||||
|
enabled: data.userCount != null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: `${env.PUBLIC_BASE_PATH}/admin/reports`,
|
||||||
|
icon: 'flag-outline',
|
||||||
|
name: 'Reports',
|
||||||
|
enabled: data.reportCount != null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: `${env.PUBLIC_BASE_PATH}/admin/admin`,
|
||||||
|
icon: 'users-outline',
|
||||||
|
name: 'Website Admins',
|
||||||
|
enabled: data.adminCount != null
|
||||||
|
}
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="flex justify-around items-center h-full">
|
||||||
|
{#each tabs as tab}
|
||||||
|
{#if tab.enabled}
|
||||||
|
<div class="flex flex-col gap-4 justify-center items-center">
|
||||||
|
<a
|
||||||
|
class="h-64 w-64 border flex justify-center items-center rounded-xl duration-100 hover:bg-base-200"
|
||||||
|
href={tab.path}
|
||||||
|
title={tab.name}
|
||||||
|
>
|
||||||
|
<IconOutline width="5rem" height="5rem" name={tab.icon} />
|
||||||
|
</a>
|
||||||
|
<span>{tab.name}</span>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user