Files
mealie/frontend/src/routes/admin.js
Hayden c1370afb16 Refactor/backend routers (#388)
* update router

* update caddy file

* setup depends in docker-fole

* make changes for serving on subpath

* set dev config

* fix router signups

* consolidate links

* backup-functionality to dashboard

* new user card

* consolidate theme into profile

* fix theme tests

* fix pg tests

* fix pg tests

* remove unused import

* mobile margin

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-05-04 20:45:11 -08:00

83 lines
1.7 KiB
JavaScript

import Admin from "@/pages/Admin";
import MealPlanner from "@/pages/Admin/MealPlanner";
import Migration from "@/pages/Admin/Migration";
import Profile from "@/pages/Admin/Profile";
import ManageUsers from "@/pages/Admin/ManageUsers";
import Settings from "@/pages/Admin/Settings";
import About from "@/pages/Admin/About";
import ToolBox from "@/pages/Admin/ToolBox";
import Dashboard from "@/pages/Admin/Dashboard";
import { store } from "../store";
export const adminRoutes = {
path: "/admin",
component: Admin,
beforeEnter: (to, _from, next) => {
if (store.getters.getIsLoggedIn) {
next();
} else next({ path: "/login", query: { redirect: to.fullPath } });
},
children: [
{
path: "",
component: Profile,
},
{
path: "profile",
component: Profile,
meta: {
title: "settings.profile",
},
},
{
path: "meal-planner",
component: MealPlanner,
meta: {
title: "meal-plan.meal-planner",
},
},
{
path: "migrations",
component: Migration,
meta: {
title: "settings.migrations",
},
},
{
path: "manage-users",
component: ManageUsers,
meta: {
title: "settings.manage-users",
},
},
{
path: "settings",
component: Settings,
meta: {
title: "settings.site-settings",
},
},
{
path: "toolbox",
component: ToolBox,
meta: {
title: "settings.toolbox.toolbox",
},
},
{
path: "about",
component: About,
meta: {
title: "general.about",
},
},
{
path: "dashboard",
component: Dashboard,
meta: {
title: "general.dashboard",
},
},
],
};