diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 9181fa9e..11233f5d 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -4253,6 +4253,11 @@ "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", "dev": true }, + "highlight.js": { + "version": "9.15.8", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.8.tgz", + "integrity": "sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA==" + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -7578,6 +7583,14 @@ "diff-match-patch": "^1.0.0" } }, + "vue-highlightjs": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/vue-highlightjs/-/vue-highlightjs-1.3.3.tgz", + "integrity": "sha1-KaDVcTL8HOFc+mHolpGPW3GMXVI=", + "requires": { + "highlight.js": "*" + } + }, "vue-hot-reload-api": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz", diff --git a/dashboard/package.json b/dashboard/package.json index 01fa35cf..33f47026 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -22,6 +22,7 @@ "js-cookie": "^2.2.0", "vue": "^2.6.10", "vue-codemirror": "^4.0.6", + "vue-highlightjs": "^1.3.3", "vue-hot-reload-api": "^2.3.3", "vue-router": "^3.0.6" }, diff --git a/dashboard/src/components/DashboardGuildConfigEditor.vue b/dashboard/src/components/Dashboard/GuildConfigEditor.vue similarity index 98% rename from dashboard/src/components/DashboardGuildConfigEditor.vue rename to dashboard/src/components/Dashboard/GuildConfigEditor.vue index e3953268..61016cec 100644 --- a/dashboard/src/components/DashboardGuildConfigEditor.vue +++ b/dashboard/src/components/Dashboard/GuildConfigEditor.vue @@ -35,7 +35,7 @@ import "codemirror/lib/codemirror.css"; import "codemirror/theme/oceanic-next.css"; import "codemirror/mode/yaml/yaml.js"; - import {ApiError} from "../api"; + import {ApiError} from "../../api"; export default { components: { diff --git a/dashboard/src/components/DashboardGuildList.vue b/dashboard/src/components/Dashboard/GuildList.vue similarity index 100% rename from dashboard/src/components/DashboardGuildList.vue rename to dashboard/src/components/Dashboard/GuildList.vue diff --git a/dashboard/src/components/Dashboard.vue b/dashboard/src/components/Dashboard/Layout.vue similarity index 79% rename from dashboard/src/components/Dashboard.vue rename to dashboard/src/components/Dashboard/Layout.vue index 084c135b..9380ca65 100644 --- a/dashboard/src/components/Dashboard.vue +++ b/dashboard/src/components/Dashboard/Layout.vue @@ -1,10 +1,10 @@ + + diff --git a/dashboard/src/components/Docs/ConfigurationFormat.vue b/dashboard/src/components/Docs/ConfigurationFormat.vue new file mode 100644 index 00000000..5311d288 --- /dev/null +++ b/dashboard/src/components/Docs/ConfigurationFormat.vue @@ -0,0 +1,42 @@ + + + diff --git a/dashboard/src/components/Docs/Introduction.vue b/dashboard/src/components/Docs/Introduction.vue new file mode 100644 index 00000000..cd59805e --- /dev/null +++ b/dashboard/src/components/Docs/Introduction.vue @@ -0,0 +1,20 @@ + diff --git a/dashboard/src/components/Docs/Layout.vue b/dashboard/src/components/Docs/Layout.vue new file mode 100644 index 00000000..6e6ec93d --- /dev/null +++ b/dashboard/src/components/Docs/Layout.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/dashboard/src/components/Docs/Permissions.vue b/dashboard/src/components/Docs/Permissions.vue new file mode 100644 index 00000000..45058964 --- /dev/null +++ b/dashboard/src/components/Docs/Permissions.vue @@ -0,0 +1,88 @@ + + + diff --git a/dashboard/src/components/Docs/PluginConfiguration.vue b/dashboard/src/components/Docs/PluginConfiguration.vue new file mode 100644 index 00000000..2b2555a8 --- /dev/null +++ b/dashboard/src/components/Docs/PluginConfiguration.vue @@ -0,0 +1,83 @@ + + + diff --git a/dashboard/src/components/Splash.vue b/dashboard/src/components/Splash.vue index 165e2e27..15e1cc0c 100644 --- a/dashboard/src/components/Splash.vue +++ b/dashboard/src/components/Splash.vue @@ -10,8 +10,8 @@ Zeppelin is a private moderation bot for Discord, designed with large servers and reliability in mind.
- Dashboard - Docs + Dashboard + Docs
Error diff --git a/dashboard/src/directives/trim-code.ts b/dashboard/src/directives/trim-code.ts new file mode 100644 index 00000000..c3ba5259 --- /dev/null +++ b/dashboard/src/directives/trim-code.ts @@ -0,0 +1,11 @@ +import Vue from "vue"; + +Vue.directive("trim-code", { + bind(el, binding) { + el.innerHTML = el.innerHTML + .replace(/(^\n+|\n+$)/g, "") + .split("\n") + .map(line => line.slice(binding.value)) + .join("\n"); + }, +}); diff --git a/dashboard/src/main.ts b/dashboard/src/main.ts index 493413a6..1c73d9a0 100644 --- a/dashboard/src/main.ts +++ b/dashboard/src/main.ts @@ -18,7 +18,6 @@ Vue.mixin({ }); import App from "./components/App.vue"; -import Login from "./components/Login.vue"; const app = new Vue({ router, diff --git a/dashboard/src/routes.ts b/dashboard/src/routes.ts index 79d58983..b1b2dacc 100644 --- a/dashboard/src/routes.ts +++ b/dashboard/src/routes.ts @@ -14,19 +14,43 @@ export const router = new VueRouter({ { path: "/login", beforeEnter: authRedirectGuard }, { path: "/login-callback", beforeEnter: loginCallbackGuard }, + // 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"), + }, + ], + }, + // Dashboard { path: "/dashboard", - component: () => import("./components/Dashboard.vue"), + component: () => import("./components/Dashboard/Layout.vue"), beforeEnter: authGuard, children: [ { path: "", - component: () => import("./components/DashboardGuildList.vue"), + component: () => import("./components/Dashboard/GuildList.vue"), }, { path: "guilds/:guildId/config", - component: () => import("./components/DashboardGuildConfigEditor.vue"), + component: () => import("./components/Dashboard/GuildConfigEditor.vue"), }, ], }, diff --git a/dashboard/src/style/dashboard.scss b/dashboard/src/style/dashboard.scss index 30219c94..d992efc1 100644 --- a/dashboard/src/style/dashboard.scss +++ b/dashboard/src/style/dashboard.scss @@ -3,3 +3,7 @@ $family-primary: 'Open Sans', sans-serif; @import "~bulmaswatch/superhero/_variables"; @import "~bulma/bulma"; @import "~bulmaswatch/superhero/_overrides"; + +.dashboard-cloak { + visibility: visible !important; +} diff --git a/dashboard/src/style/docs.scss b/dashboard/src/style/docs.scss new file mode 100644 index 00000000..8fa5aeb9 --- /dev/null +++ b/dashboard/src/style/docs.scss @@ -0,0 +1,9 @@ +$family-primary: 'Open Sans', sans-serif; + +@import "~bulmaswatch/superhero/_variables"; +@import "~bulma/bulma"; +@import "~bulmaswatch/superhero/_overrides"; + +.docs-cloak { + visibility: visible !important; +}