diff --git a/dashboard/package.json b/dashboard/package.json index 0d3a328e..7e02da82 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -27,7 +27,7 @@ "source-map-loader": "^4.0.1", "tailwindcss": "^1.9.6", "ts-loader": "^9.4.3", - "vue-loader": "^15.10.1", + "vue-loader": "^17.4.2", "vue-style-loader": "^4.1.3", "vue-template-compiler": "^2.7.14", "webpack": "^5.88.0", @@ -37,7 +37,6 @@ }, "dependencies": { "@fastify/static": "^7.0.1", - "@highlightjs/vue-plugin": "^1.0.2", "fastify": "^4.26.2", "highlight.js": "^11.8.0", "humanize-duration": "^3.27.0", @@ -45,11 +44,12 @@ "marked": "^5.1.0", "modern-css-reset": "^1.4.0", "moment": "^2.29.4", - "vue": "^2.7.14", - "vue-material-design-icons": "^4.1.0", - "vue-router": "^3.6.5", - "vue2-ace-editor": "^0.0.15", - "vuex": "^3.6.2" + "vue": "^3.5.13", + "vue-material-design-icons": "^5.3.1", + "vue-router": "^4.5.0", + "vue3-ace-editor": "^2.2.4", + "vue3-highlightjs": "^1.0.5", + "vuex": "^4.1.0" }, "browserslist": [ "last 2 Chrome versions" diff --git a/dashboard/src/auth.ts b/dashboard/src/auth.ts index bb5c1b9e..92fcd936 100644 --- a/dashboard/src/auth.ts +++ b/dashboard/src/auth.ts @@ -21,9 +21,11 @@ export const loginCallbackGuard: NavigationGuard = async (to, from, next) => { } else { window.location.href = `/?error=noAccess`; } + return next(); }; export const authRedirectGuard: NavigationGuard = async (to, form, next) => { if (await isAuthenticated()) return next("/dashboard"); window.location.href = `${process.env.API_URL}/auth/login`; + return next(); }; diff --git a/dashboard/src/components/Expandable.vue b/dashboard/src/components/Expandable.vue index 4f0a39f4..87833448 100644 --- a/dashboard/src/components/Expandable.vue +++ b/dashboard/src/components/Expandable.vue @@ -72,7 +72,7 @@ .inline-code, code:not([class]), - >>> code:not([class]) { + :deep(code:not([class])) { @apply bg-gray-900; } diff --git a/dashboard/src/components/dashboard/GuildAccess.vue b/dashboard/src/components/dashboard/GuildAccess.vue index 28292efc..860666df 100644 --- a/dashboard/src/components/dashboard/GuildAccess.vue +++ b/dashboard/src/components/dashboard/GuildAccess.vue @@ -175,7 +175,7 @@ export default { expiresAt: null, }); - this.$set(perm, "permissions", new Set(perm.permissions)); + perm.permissions = new Set(perm.permissions); }, onTreeUpdate(targetPermissions) { diff --git a/dashboard/src/components/dashboard/GuildConfigEditor.vue b/dashboard/src/components/dashboard/GuildConfigEditor.vue index 191892ad..1140105f 100644 --- a/dashboard/src/components/dashboard/GuildConfigEditor.vue +++ b/dashboard/src/components/dashboard/GuildConfigEditor.vue @@ -19,13 +19,20 @@ - + ref="aceEditor" + v-options="{ + useSoftTabs: true, + tabSize: 2 + }" + :style="{ + width: editorWidth + 'px', + height: editorHeight + 'px', + }" /> @@ -34,14 +41,19 @@ import {ApiError} from "../../api"; import { GuildState } from "../../store/types"; - import AceEditor from "vue2-ace-editor"; + import { VAceEditor } from "vue3-ace-editor"; + + import "ace-builds/src-noconflict/ext-language_tools"; + import 'ace-builds/src-noconflict/ext-searchbox'; + import "ace-builds/src-noconflict/mode-yaml"; + import "ace-builds/src-noconflict/theme-tomorrow_night"; let editorKeybindListener; let windowResizeListener; export default { components: { - AceEditor, + VAceEditor, }, async mounted() { try { @@ -101,16 +113,6 @@ }, methods: { editorInit() { - require("brace/ext/language_tools"); - require('brace/ext/searchbox'); - require("brace/mode/yaml"); - require("brace/theme/tomorrow_night"); - - this.$refs.aceEditor.editor.setOptions({ - useSoftTabs: true, - tabSize: 2 - }); - // Add Ctrl+S/Cmd+S save shortcut const isMac = /mac/i.test(navigator.platform); const modKeyPressed = (ev: KeyboardEvent) => (isMac ? ev.metaKey : ev.ctrlKey); @@ -131,7 +133,7 @@ if (shortcutModifierPressed(ev) && ev.key === "f") { ev.preventDefault(); - this.$refs.aceEditor.editor.execCommand("find"); + this.$refs.aceEditor.getAceInstance().execCommand("find"); return; } }; @@ -171,7 +173,7 @@ this.editorHeight = newHeight; this.$nextTick(() => { - this.$refs.aceEditor.editor.resize(); + this.$refs.aceEditor.getAceInstance().resize(); }); }, async save() { diff --git a/dashboard/src/components/docs/Plugin.vue b/dashboard/src/components/docs/Plugin.vue index 2bfdcfb2..743c8a30 100644 --- a/dashboard/src/components/docs/Plugin.vue +++ b/dashboard/src/components/docs/Plugin.vue @@ -174,7 +174,6 @@