From 0d231b0e6544d5029475d4f662ae788b4bcc6000 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 22 May 2024 21:43:09 +0200 Subject: [PATCH] stash --- web/src/components/inputs/FormatedText.vue | 1 - web/src/views/admin/Settings.vue | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/web/src/components/inputs/FormatedText.vue b/web/src/components/inputs/FormatedText.vue index 05e8178..6c137d0 100644 --- a/web/src/components/inputs/FormatedText.vue +++ b/web/src/components/inputs/FormatedText.vue @@ -1,6 +1,5 @@ diff --git a/web/src/views/admin/Settings.vue b/web/src/views/admin/Settings.vue index 3511945..9bb7e9a 100644 --- a/web/src/views/admin/Settings.vue +++ b/web/src/views/admin/Settings.vue @@ -2,9 +2,8 @@

Message Templates

Message Template Variables

@@ -24,7 +23,14 @@ export default { name: 'Settings', components: {FormatedText, Table}, computed: mapState(['messageTemplates', 'messageTemplateVariables']), - methods: mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']), + methods: { + ...mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']), + formatText(value) { + return value.replace(/{{(.*?)}}/g, (match, key) => { + return `{{ ${key} }}`; + }).replace(/\n/g, '
').replace(/\t/g, '    '); + } + }, mounted() { this.fetchMessageTemplates(); this.fetchMessageTemplateVariables();