33 lines
1021 B
Vue
33 lines
1021 B
Vue
<script setup>
|
|
import { RouterView } from 'vue-router';
|
|
|
|
import { useAuth } from '@/composables/useAuth.js';
|
|
|
|
defineProps({ routed: { type: Boolean, default: true } });
|
|
const { principal, signOut } = useAuth();
|
|
|
|
async function logout() {
|
|
await signOut();
|
|
window.location.href = '/login';
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<main class="admin-shell">
|
|
<aside class="admin-sidebar">
|
|
<p class="catalog-kicker">Collector workspace</p>
|
|
<h1>Inventory</h1>
|
|
<nav aria-label="Admin navigation">
|
|
<a href="/admin">Overview</a>
|
|
<RouterLink :to="{ name: 'admin-settings' }">Settings</RouterLink>
|
|
<RouterLink :to="{ name: 'admin-saved-views' }">Saved views</RouterLink>
|
|
</nav>
|
|
<div class="admin-sidebar__footer">
|
|
<span>{{ principal?.email }}</span>
|
|
<button class="button button--secondary" type="button" @click="logout">Sign out</button>
|
|
</div>
|
|
</aside>
|
|
<section class="admin-shell__content"><RouterView v-if="routed" /></section>
|
|
</main>
|
|
</template>
|