dashboard: add ctrl+f support to config editor

This commit is contained in:
Dragory 2021-04-10 13:11:37 +03:00
parent 186ac65924
commit 530536a77b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -41,22 +41,22 @@
AceEditor, AceEditor,
}, },
async mounted() { async mounted() {
try { try {
await this.$store.dispatch("guilds/loadGuild", this.$route.params.guildId); await this.$store.dispatch("guilds/loadGuild", this.$route.params.guildId);
} catch (err) { } catch (err) {
if (err instanceof ApiError) { if (err instanceof ApiError) {
this.$router.push('/dashboard');
return;
}
throw err;
}
if (this.guild == null) {
this.$router.push('/dashboard'); this.$router.push('/dashboard');
return; return;
} }
throw err;
}
if (this.guild == null) {
this.$router.push('/dashboard');
return;
}
await this.$store.dispatch("guilds/loadConfig", this.$route.params.guildId); await this.$store.dispatch("guilds/loadConfig", this.$route.params.guildId);
this.editableConfig = this.config || ""; this.editableConfig = this.config || "";
this.loading = false; this.loading = false;
@ -86,6 +86,7 @@
methods: { methods: {
editorInit() { editorInit() {
require("brace/ext/language_tools"); require("brace/ext/language_tools");
require('brace/ext/searchbox');
require("brace/mode/yaml"); require("brace/mode/yaml");
require("brace/theme/tomorrow_night"); require("brace/theme/tomorrow_night");