3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00
zeppelin/dashboard/src/routes.ts

59 lines
1.6 KiB
TypeScript
Raw Normal View History

import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
2019-06-23 19:18:41 +03:00
import Splash from "./components/Splash.vue";
import Login from "./components/Login.vue";
import LoginCallback from "./components/LoginCallback.vue";
2019-06-23 19:18:41 +03:00
import { authGuard, authRedirectGuard, loginCallbackGuard } from "./auth";
Vue.use(VueRouter);
export const router = new VueRouter({
mode: "history",
2019-06-23 19:18:41 +03:00
routes: [
{ path: "/", component: Splash },
{ path: "/login", beforeEnter: authRedirectGuard },
{ path: "/login-callback", beforeEnter: loginCallbackGuard },
2019-07-28 18:24:32 +03:00
// Docs
{
path: "/docs",
component: () => import("./components/Docs/Layout.vue"),
children: [
{
path: "",
component: () => import("./components/Docs/Introduction.vue"),
},
{
path: "configuration-format",
component: () => import("./components/Docs/ConfigurationFormat.vue"),
},
{
path: "permissions",
component: () => import("./components/Docs/Permissions.vue"),
},
{
path: "plugin-configuration",
component: () => import("./components/Docs/PluginConfiguration.vue"),
},
],
},
2019-06-23 19:18:41 +03:00
// Dashboard
{
path: "/dashboard",
2019-07-28 18:24:32 +03:00
component: () => import("./components/Dashboard/Layout.vue"),
2019-06-23 19:18:41 +03:00
beforeEnter: authGuard,
children: [
{
path: "",
2019-07-28 18:24:32 +03:00
component: () => import("./components/Dashboard/GuildList.vue"),
2019-06-23 19:18:41 +03:00
},
{
path: "guilds/:guildId/config",
2019-07-28 18:24:32 +03:00
component: () => import("./components/Dashboard/GuildConfigEditor.vue"),
2019-06-23 19:18:41 +03:00
},
],
},
],
});