This commit is contained in:
@ -3,7 +3,6 @@ import '@assets/admin_layout.css';
|
||||
import BaseLayout from '../BaseLayout.astro';
|
||||
import { ClientRouter } from 'astro:transitions';
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import { BASE_PATH } from 'astro:env/client';
|
||||
import Popup from '@components/popup/Popup.svelte';
|
||||
import ConfirmPopup from '@components/popup/ConfirmPopup.svelte';
|
||||
import { Session } from '@util/session.ts';
|
||||
@ -18,44 +17,44 @@ const session = Session.sessionFromCookies(Astro.cookies);
|
||||
|
||||
const preTabs = [
|
||||
{
|
||||
href: `${BASE_PATH}`,
|
||||
href: ``,
|
||||
name: 'Varo Startseite',
|
||||
icon: 'heroicons:computer-desktop-20-solid'
|
||||
}
|
||||
];
|
||||
const adminTabs = [
|
||||
{
|
||||
href: `${BASE_PATH}/admin/users`,
|
||||
href: 'admin/users',
|
||||
name: 'Registrierte Nutzer',
|
||||
icon: 'heroicons:user',
|
||||
enabled: session?.permissions.users
|
||||
},
|
||||
{
|
||||
href: `${BASE_PATH}/admin/teams`,
|
||||
href: 'admin/teams',
|
||||
name: 'Teams',
|
||||
icon: 'heroicons:users',
|
||||
enabled: session?.permissions.users
|
||||
},
|
||||
{
|
||||
href: `${BASE_PATH}/admin/reports`,
|
||||
href: 'admin/reports',
|
||||
name: 'Reports',
|
||||
icon: 'heroicons:flag',
|
||||
enabled: session?.permissions.reports
|
||||
},
|
||||
{
|
||||
href: `${BASE_PATH}/admin/feedback`,
|
||||
href: 'admin/feedback',
|
||||
name: 'Feedback',
|
||||
icon: 'heroicons:book-open',
|
||||
enabled: session?.permissions.feedback
|
||||
},
|
||||
{
|
||||
href: `${BASE_PATH}/admin/admins`,
|
||||
href: 'admin/admins',
|
||||
name: 'Website Admins',
|
||||
icon: 'heroicons:code-bracket-16-solid',
|
||||
enabled: session?.permissions.admin
|
||||
},
|
||||
{
|
||||
href: `${BASE_PATH}/admin/settings`,
|
||||
href: 'admin/settings',
|
||||
name: 'Einstellungen',
|
||||
icon: 'heroicons:adjustments-horizontal',
|
||||
enabled: session?.permissions.settings
|
||||
@ -113,13 +112,12 @@ const adminTabs = [
|
||||
|
||||
<script>
|
||||
import { actions } from 'astro:actions';
|
||||
import { BASE_PATH } from 'astro:env/client';
|
||||
|
||||
document.addEventListener('astro:page-load', () => {
|
||||
const logout = document.getElementById('logout') as HTMLButtonElement;
|
||||
logout.addEventListener('click', async () => {
|
||||
await actions.session.logout();
|
||||
window.location.href = `${BASE_PATH}/admin/login`;
|
||||
window.location.href = `${document.baseURI}admin/login`;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user