3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 15:45:03 +00:00
zeppelin/dashboard/src/routes.ts
2019-07-22 00:28:02 +03:00

34 lines
996 B
TypeScript

import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import Splash from "./components/Splash.vue";
import Login from "./components/Login.vue";
import LoginCallback from "./components/LoginCallback.vue";
import { authGuard, authRedirectGuard, loginCallbackGuard } from "./auth";
Vue.use(VueRouter);
export const router = new VueRouter({
mode: "history",
routes: [
{ path: "/", component: Splash },
{ path: "/login", beforeEnter: authRedirectGuard },
{ path: "/login-callback", beforeEnter: loginCallbackGuard },
// Dashboard
{
path: "/dashboard",
component: () => import("./components/Dashboard.vue"),
beforeEnter: authGuard,
children: [
{
path: "",
component: () => import("./components/DashboardGuildList.vue"),
},
{
path: "guilds/:guildId/config",
component: () => import("./components/DashboardGuildConfigEditor.vue"),
},
],
},
],
});