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

91 lines
2.5 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"),
2019-07-28 18:24:32 +03:00
children: [
{
path: "",
component: () => import("./components/docs/Introduction.vue"),
2019-07-28 18:24:32 +03:00
},
{
path: "configuration-format",
component: () => import("./components/docs/ConfigurationFormat.vue"),
2019-07-28 18:24:32 +03:00
},
{
path: "permissions",
component: () => import("./components/docs/Permissions.vue"),
2019-07-28 18:24:32 +03:00
},
{
path: "plugin-configuration",
component: () => import("./components/docs/PluginConfiguration.vue"),
2019-07-28 18:24:32 +03:00
},
{
path: "descriptions",
component: () => import("./components/docs/descriptions/Layout.vue"),
children: [
{
path: "argument-types",
component: () => import("./components/docs/descriptions/ArgumentTypes.vue"),
},
],
},
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"),
},
{
path: "locate-user",
component: () => import("./components/docs/plugins/LocateUser.vue"),
},
2019-07-28 20:13:01 +03:00
],
},
2019-07-28 18:24:32 +03:00
],
},
2019-06-23 19:18:41 +03:00
// Dashboard
{
path: "/dashboard",
component: () => import("./components/dashboard/Layout.vue"),
2019-06-23 19:18:41 +03:00
beforeEnter: authGuard,
children: [
{
path: "",
component: () => import("./components/dashboard/GuildList.vue"),
2019-06-23 19:18:41 +03:00
},
{
path: "guilds/:guildId/config",
component: () => import("./components/dashboard/GuildConfigEditor.vue"),
2019-06-23 19:18:41 +03:00
},
],
},
],
scrollBehavior: function(to) {
if (to.hash) {
return {
selector: to.hash,
};
}
},
});