1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-19 21:29:40 +02:00
mealie/frontend/layouts/admin.vue

133 lines
3.3 KiB
Vue
Raw Normal View History

<template>
2021-08-01 19:24:47 -08:00
<v-app dark>
<AppSidebar
v-model="sidebar"
absolute
:top-link="topLinks"
:bottom-links="bottomLinks"
2021-08-01 19:24:47 -08:00
:user="{ data: true }"
:secondary-header="$t('sidebar.developer')"
:secondary-links="developerLinks"
2021-08-01 19:24:47 -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>
</template>
Use composition API for more components, enable more type checking (#914) * Activate more linting rules from eslint and typescript * Properly add VForm as type information * Fix usage of native types * Fix more linting issues * Rename vuetify types file, add VTooltip * Fix some more typing problems * Use composition API for more components * Convert RecipeRating * Convert RecipeNutrition * Convert more components to composition API * Fix globals plugin for type checking * Add missing icon types * Fix vuetify types in Nuxt context * Use composition API for RecipeActionMenu * Convert error.vue to composition API * Convert RecipeContextMenu to composition API * Use more composition API and type checking in recipe/create * Convert AppButtonUpload to composition API * Fix some type checking in RecipeContextMenu * Remove unused components BaseAutoForm and BaseColorPicker * Convert RecipeCategoryTagDialog to composition API * Convert RecipeCardSection to composition API * Convert RecipeCategoryTagSelector to composition API * Properly import vuetify type definitions * Convert BaseButton to composition API * Convert AutoForm to composition API * Remove unused requests API file * Remove static routes from recipe API * Fix more type errors * Convert AppHeader to composition API, fixing some search bar focus problems * Convert RecipeDialogSearch to composition API * Update API types from pydantic models, handle undefined values * Improve more typing problems * Add types to other plugins * Properly type the CRUD API access * Fix typing of static image routes * Fix more typing stuff * Fix some more typing problems * Turn off more rules
2022-01-09 07:15:23 +01:00
<script lang="ts">
import { defineComponent, ref, useContext, onMounted } from "@nuxtjs/composition-api";
import AppHeader from "@/components/Layout/LayoutParts/AppHeader.vue";
import AppSidebar from "@/components/Layout/LayoutParts/AppSidebar.vue";
import TheSnackbar from "~/components/Layout/LayoutParts/TheSnackbar.vue";
import { SidebarLinks } from "~/types/application-types";
export default defineComponent({
components: { AppHeader, AppSidebar, TheSnackbar },
middleware: ["auth", "admin-only"],
2021-08-01 19:24:47 -08:00
auth: true,
setup() {
const { $globals, i18n, $vuetify } = useContext();
const sidebar = ref<boolean | null>(null);
onMounted(() => {
sidebar.value = !$vuetify.breakpoint.md;
});
const topLinks: SidebarLinks = [
{
icon: $globals.icons.cog,
to: "/admin/site-settings",
title: i18n.tc("sidebar.site-settings"),
restricted: true,
},
// {
// icon: $globals.icons.chart,
// to: "/admin/analytics",
// title: "Analytics",
// restricted: true,
// },
{
icon: $globals.icons.user,
to: "/admin/manage/users",
title: i18n.tc("user.users"),
restricted: true,
},
2024-08-22 10:14:32 -05:00
{
icon: $globals.icons.household,
to: "/admin/manage/households",
title: i18n.tc("household.households"),
restricted: true,
},
{
icon: $globals.icons.group,
to: "/admin/manage/groups",
title: i18n.tc("group.groups"),
restricted: true,
},
{
icon: $globals.icons.database,
to: "/admin/backups",
title: i18n.tc("sidebar.backups"),
restricted: true,
},
];
const developerLinks: SidebarLinks = [
{
icon: $globals.icons.wrench,
to: "/admin/maintenance",
title: i18n.tc("sidebar.maintenance"),
restricted: true,
},
{
icon: $globals.icons.robot,
title: i18n.tc("recipe.debug"),
restricted: true,
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,
},
]
},
];
const bottomLinks: SidebarLinks = [
{
icon: $globals.icons.heart,
title: i18n.tc("about.support"),
href: "https://github.com/sponsors/hay-kot",
restricted: true,
},
];
2021-08-01 19:24:47 -08:00
return {
sidebar,
topLinks,
bottomLinks,
developerLinks,
2021-08-01 19:24:47 -08:00
};
},
});
</script>