2019-06-22 18:52:24 +03:00
|
|
|
import Vue from "vue";
|
|
|
|
import VueRouter, { RouteConfig } from "vue-router";
|
2019-06-23 19:18:41 +03:00
|
|
|
import Splash from "./components/Splash.vue";
|
2019-06-22 18:52:24 +03:00
|
|
|
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";
|
2019-06-22 18:52:24 +03:00
|
|
|
|
|
|
|
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",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/docs/Layout.vue"),
|
2019-07-28 18:24:32 +03:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/docs/Introduction.vue"),
|
2019-07-28 18:24:32 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "configuration-format",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/docs/ConfigurationFormat.vue"),
|
2019-07-28 18:24:32 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "permissions",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/docs/Permissions.vue"),
|
2019-07-28 18:24:32 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "plugin-configuration",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/docs/PluginConfiguration.vue"),
|
2019-07-28 18:24:32 +03:00
|
|
|
},
|
2019-07-28 20:13:01 +03:00
|
|
|
{
|
|
|
|
path: "plugins",
|
|
|
|
component: () => import("./components/docs/plugins/Layout.vue"),
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "mod-actions",
|
|
|
|
component: () => import("./components/docs/plugins/ModActions.vue"),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-07-28 18:24:32 +03:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2019-06-23 19:18:41 +03:00
|
|
|
// Dashboard
|
|
|
|
{
|
|
|
|
path: "/dashboard",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/dashboard/Layout.vue"),
|
2019-06-23 19:18:41 +03:00
|
|
|
beforeEnter: authGuard,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/dashboard/GuildList.vue"),
|
2019-06-23 19:18:41 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "guilds/:guildId/config",
|
2019-07-28 18:26:36 +03:00
|
|
|
component: () => import("./components/dashboard/GuildConfigEditor.vue"),
|
2019-06-23 19:18:41 +03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2019-06-22 18:52:24 +03:00
|
|
|
});
|