2021-07-31 14:45:28 -08:00
|
|
|
<template>
|
2021-08-01 19:24:47 -08:00
|
|
|
<v-app dark>
|
|
|
|
<AppSidebar
|
|
|
|
v-model="sidebar"
|
|
|
|
absolute
|
|
|
|
:top-link="topLinks"
|
2021-09-05 22:05:29 -08:00
|
|
|
:bottom-links="bottomLinks"
|
2021-08-01 19:24:47 -08:00
|
|
|
:user="{ data: true }"
|
2022-08-15 23:55:51 +02:00
|
|
|
:secondary-header="$t('sidebar.developer')"
|
2022-04-09 19:08:48 -08:00
|
|
|
:secondary-links="developerLinks"
|
2021-08-01 19:24:47 -08:00
|
|
|
/>
|
|
|
|
|
2021-08-07 15:12:25 -08:00
|
|
|
<TheSnackbar />
|
|
|
|
|
2021-08-01 19:24:47 -08:00
|
|
|
<AppHeader>
|
|
|
|
<v-btn icon @click.stop="sidebar = !sidebar">
|
|
|
|
<v-icon> {{ $globals.icons.menu }}</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
</AppHeader>
|
|
|
|
<v-main>
|
|
|
|
<v-scroll-x-transition>
|
|
|
|
<Nuxt />
|
|
|
|
</v-scroll-x-transition>
|
|
|
|
</v-main>
|
|
|
|
</v-app>
|
2021-07-31 14:45:28 -08:00
|
|
|
</template>
|
2022-01-09 07:15:23 +01:00
|
|
|
|
2021-07-31 14:45:28 -08:00
|
|
|
<script lang="ts">
|
2021-10-07 09:39:47 -08:00
|
|
|
import { defineComponent, ref, useContext, onMounted } from "@nuxtjs/composition-api";
|
2023-09-14 09:01:24 -05:00
|
|
|
import AppHeader from "@/components/Layout/LayoutParts/AppHeader.vue";
|
|
|
|
import AppSidebar from "@/components/Layout/LayoutParts/AppSidebar.vue";
|
|
|
|
import TheSnackbar from "~/components/Layout/LayoutParts/TheSnackbar.vue";
|
2022-01-07 22:09:34 +01:00
|
|
|
import { SidebarLinks } from "~/types/application-types";
|
2021-07-31 14:45:28 -08:00
|
|
|
|
|
|
|
export default defineComponent({
|
2021-08-07 15:12:25 -08:00
|
|
|
components: { AppHeader, AppSidebar, TheSnackbar },
|
2024-01-14 17:03:31 +01:00
|
|
|
middleware: ["auth", "admin-only"],
|
2021-08-01 19:24:47 -08:00
|
|
|
auth: true,
|
2021-07-31 14:45:28 -08:00
|
|
|
setup() {
|
2021-10-07 09:39:47 -08:00
|
|
|
const { $globals, i18n, $vuetify } = useContext();
|
2021-09-05 22:05:29 -08:00
|
|
|
|
2021-10-07 09:39:47 -08:00
|
|
|
const sidebar = ref<boolean | null>(null);
|
|
|
|
onMounted(() => {
|
|
|
|
sidebar.value = !$vuetify.breakpoint.md;
|
|
|
|
});
|
2021-09-05 22:05:29 -08:00
|
|
|
|
2022-01-07 22:09:34 +01:00
|
|
|
const topLinks: SidebarLinks = [
|
2021-09-05 22:05:29 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.cog,
|
|
|
|
to: "/admin/site-settings",
|
2023-09-14 09:01:24 -05:00
|
|
|
title: i18n.tc("sidebar.site-settings"),
|
|
|
|
restricted: true,
|
2021-09-05 22:05:29 -08:00
|
|
|
},
|
2022-04-09 19:08:48 -08:00
|
|
|
|
2022-03-29 08:25:28 -08:00
|
|
|
// {
|
|
|
|
// icon: $globals.icons.chart,
|
|
|
|
// to: "/admin/analytics",
|
|
|
|
// title: "Analytics",
|
2023-09-14 09:01:24 -05:00
|
|
|
// restricted: true,
|
2022-03-29 08:25:28 -08:00
|
|
|
// },
|
2021-09-05 22:05:29 -08:00
|
|
|
{
|
2021-11-23 18:57:24 -09:00
|
|
|
icon: $globals.icons.user,
|
|
|
|
to: "/admin/manage/users",
|
2023-09-14 09:01:24 -05:00
|
|
|
title: i18n.tc("user.users"),
|
|
|
|
restricted: true,
|
2021-09-05 22:05:29 -08:00
|
|
|
},
|
2024-08-22 10:14:32 -05:00
|
|
|
{
|
|
|
|
icon: $globals.icons.household,
|
|
|
|
to: "/admin/manage/households",
|
|
|
|
title: i18n.tc("household.households"),
|
|
|
|
restricted: true,
|
|
|
|
},
|
2021-09-05 22:05:29 -08:00
|
|
|
{
|
2021-11-23 18:57:24 -09:00
|
|
|
icon: $globals.icons.group,
|
|
|
|
to: "/admin/manage/groups",
|
2023-09-14 09:01:24 -05:00
|
|
|
title: i18n.tc("group.groups"),
|
|
|
|
restricted: true,
|
2021-09-05 22:05:29 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: $globals.icons.database,
|
|
|
|
to: "/admin/backups",
|
2023-09-14 09:01:24 -05:00
|
|
|
title: i18n.tc("sidebar.backups"),
|
|
|
|
restricted: true,
|
2021-09-05 22:05:29 -08:00
|
|
|
},
|
2022-04-09 19:08:48 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
const developerLinks: SidebarLinks = [
|
|
|
|
{
|
|
|
|
icon: $globals.icons.wrench,
|
|
|
|
to: "/admin/maintenance",
|
2023-09-14 09:01:24 -05:00
|
|
|
title: i18n.tc("sidebar.maintenance"),
|
|
|
|
restricted: true,
|
2022-04-09 19:08:48 -08:00
|
|
|
},
|
2021-10-09 13:08:23 -08:00
|
|
|
{
|
2024-09-23 04:04:36 -05:00
|
|
|
icon: $globals.icons.robot,
|
|
|
|
title: i18n.tc("recipe.debug"),
|
2023-09-14 09:01:24 -05:00
|
|
|
restricted: true,
|
2024-09-23 04:04:36 -05:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
icon: $globals.icons.robot,
|
|
|
|
to: "/admin/debug/openai",
|
|
|
|
title: i18n.tc("admin.openai"),
|
|
|
|
restricted: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: $globals.icons.slotMachine,
|
|
|
|
to: "/admin/debug/parser",
|
|
|
|
title: i18n.tc("sidebar.parser"),
|
|
|
|
restricted: true,
|
|
|
|
},
|
|
|
|
]
|
2021-10-09 13:08:23 -08:00
|
|
|
},
|
2021-09-05 22:05:29 -08:00
|
|
|
];
|
|
|
|
|
2022-01-07 22:09:34 +01:00
|
|
|
const bottomLinks: SidebarLinks = [
|
2021-09-05 22:05:29 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.heart,
|
2023-09-14 09:01:24 -05:00
|
|
|
title: i18n.tc("about.support"),
|
2021-09-05 22:05:29 -08:00
|
|
|
href: "https://github.com/sponsors/hay-kot",
|
2023-09-14 09:01:24 -05:00
|
|
|
restricted: true,
|
2021-09-05 22:05:29 -08:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2021-08-01 19:24:47 -08:00
|
|
|
return {
|
2021-09-05 22:05:29 -08:00
|
|
|
sidebar,
|
|
|
|
topLinks,
|
|
|
|
bottomLinks,
|
2022-04-09 19:08:48 -08:00
|
|
|
developerLinks,
|
2021-08-01 19:24:47 -08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2021-07-31 14:45:28 -08:00
|
|
|
</script>
|