From 40afecb91df35ea2f82d4e1287387d5b71af458c Mon Sep 17 00:00:00 2001
From: Rotzbua
Date: Tue, 11 Jul 2023 20:43:44 +0200
Subject: [PATCH 1/3] feat(webapp): add eslint rule for mustache style
Effect: grant uniform style
Reference: https://eslint.vuejs.org/rules/mustache-interpolation-spacing.html
---
www/webapp/.eslintrc.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/www/webapp/.eslintrc.js b/www/webapp/.eslintrc.js
index 6d807148f..e9bedc3b7 100644
--- a/www/webapp/.eslintrc.js
+++ b/www/webapp/.eslintrc.js
@@ -17,6 +17,8 @@ module.exports = {
'vue/v-bind-style': 'warn',
'vue/v-on-style': 'warn',
'vue/v-slot-style': 'warn',
+ 'vue/mustache-interpolation-spacing': ['warn', 'always'],
+ 'vue/no-multi-spaces': 'warn',
},
ignorePatterns: ['**/src/modules/**/*'],
parserOptions: {
From 0ad7a6e5057b2f1e26ac5ae0a6da6d4a64df1feb Mon Sep 17 00:00:00 2001
From: Rotzbua
Date: Tue, 11 Jul 2023 20:45:35 +0200
Subject: [PATCH 2/3] fix(webapp): autoformatting for mustache eslint style
---
www/webapp/src/App.vue | 16 ++++++++--------
www/webapp/src/components/Field/RecordList.vue | 2 +-
www/webapp/src/views/AboutPage.vue | 4 ++--
.../src/views/Console/TOTPVerifyDialog.vue | 8 ++++----
www/webapp/src/views/CrudList.vue | 2 +-
www/webapp/src/views/DonatePage.vue | 12 ++++++------
www/webapp/src/views/DynSetup.vue | 12 ++++++------
www/webapp/src/views/HomePage.vue | 8 ++++----
www/webapp/src/views/ImpressumPage.vue | 2 +-
www/webapp/src/views/PrivacyPolicy.vue | 6 +++---
www/webapp/src/views/TermsPage.vue | 2 +-
11 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/www/webapp/src/App.vue b/www/webapp/src/App.vue
index 482c44e8f..40b823a1d 100644
--- a/www/webapp/src/App.vue
+++ b/www/webapp/src/App.vue
@@ -14,12 +14,12 @@
:to="{name: item.name}"
:exact="true">
- {{item.icon}}
+ {{ item.icon }}
- {{item.text}}
- {{item.post_icon}}
+ {{ item.text }}
+ {{ item.post_icon }}
@@ -41,8 +41,8 @@
{{item.text}}
- {{item.post_icon}}
+ >{{ item.text }}
+ {{ item.post_icon }}
Create Account
@@ -70,7 +70,7 @@
v-on="on"
>
more
- {{mdiMenuDown}}
+ {{ mdiMenuDown }}
@@ -143,7 +143,7 @@
-
{{email}}
+
{{ email }}
Kyffhäuserstraße 5
10781 Berlin
@@ -153,7 +153,7 @@
Please donate!
- {{mdiHeart}}
+ {{ mdiHeart }}
European Bank Account:
diff --git a/www/webapp/src/components/Field/RecordList.vue b/www/webapp/src/components/Field/RecordList.vue
index 8f7ab05fc..64a7eb12f 100644
--- a/www/webapp/src/components/Field/RecordList.vue
+++ b/www/webapp/src/components/Field/RecordList.vue
@@ -24,7 +24,7 @@
small
text
v-if="!readonly && !disabled"
- >{{mdiPlus}} add another value
+ >{{ mdiPlus }} add another value
diff --git a/www/webapp/src/views/AboutPage.vue b/www/webapp/src/views/AboutPage.vue
index ccd53ddfd..49067bf8b 100644
--- a/www/webapp/src/views/AboutPage.vue
+++ b/www/webapp/src/views/AboutPage.vue
@@ -36,8 +36,8 @@
- {{p.title}}
- {{p.text}}
+ {{ p.title }}
+ {{ p.text }}
diff --git a/www/webapp/src/views/Console/TOTPVerifyDialog.vue b/www/webapp/src/views/Console/TOTPVerifyDialog.vue
index 744020f6e..b30a18ad4 100644
--- a/www/webapp/src/views/Console/TOTPVerifyDialog.vue
+++ b/www/webapp/src/views/Console/TOTPVerifyDialog.vue
@@ -14,7 +14,7 @@
- {{mdiClose}}
+ {{ mdiClose }}
@@ -29,14 +29,14 @@
- {{mdiCheck}}
+ {{ mdiCheck }}
Great! Continue to log in.
- {{mdiNumeric1Circle}}
+ {{ mdiNumeric1Circle }}
Please scan the following QR code with an authenticator app (e.g. Google Authenticator).
This code is only displayed once.
@@ -44,7 +44,7 @@
- {{mdiNumeric2Circle}}
+ {{ mdiNumeric2Circle }}
Enter the code displayed in the authenticator app to confirm and activate the token:
diff --git a/www/webapp/src/views/CrudList.vue b/www/webapp/src/views/CrudList.vue
index 388cbac96..c4baab16e 100644
--- a/www/webapp/src/views/CrudList.vue
+++ b/www/webapp/src/views/CrudList.vue
@@ -62,7 +62,7 @@
depressed
:disabled="user.working"
>
- {{mdiPlus}}
+ {{ mdiPlus }}
- {{mdiBankTransferIn}} Direct Debit – Let us Take your Money (Europe)
+ {{ mdiBankTransferIn }} Direct Debit – Let us Take your Money (Europe)
@@ -32,7 +32,7 @@
- {{mdiBankTransferOut}} Bank Transfer – Send us Money (Europe)
+ {{ mdiBankTransferOut }} Bank Transfer – Send us Money (Europe)
@@ -63,7 +63,7 @@
- {{mdiCreditCardOutline}} Credit Card
+ {{ mdiCreditCardOutline }} Credit Card
@@ -81,7 +81,7 @@
- {{mdiGithub}} GitHub Sponsors
+ {{ mdiGithub }} GitHub Sponsors
@@ -94,7 +94,7 @@
- {{mdiGiftOutline}} PayPal
+ {{ mdiGiftOutline }} PayPal
@@ -112,7 +112,7 @@
- {{mdiHeartMultipleOutline}} Double-up with Your Employer
+ {{ mdiHeartMultipleOutline }} Double-up with Your Employer
diff --git a/www/webapp/src/views/DynSetup.vue b/www/webapp/src/views/DynSetup.vue
index ab0adaf0c..7ce9cfa6c 100644
--- a/www/webapp/src/views/DynSetup.vue
+++ b/www/webapp/src/views/DynSetup.vue
@@ -30,7 +30,7 @@
All operations on your domain require the following authorization token secret shown below:
- {{token}}
+ {{ token }}
Please keep this token secret in a safe place.
@@ -53,15 +53,15 @@
| URL |
- https://update.{{LOCAL_PUBLIC_SUFFIXES[0]}}/ |
+ https://update.{{ LOCAL_PUBLIC_SUFFIXES[0] }}/ |
| Username |
- {{domain}} |
+ {{ domain }} |
| Password |
- {{token}} |
+ {{ token }} |
@@ -119,10 +119,10 @@
are:is:
- The last time your DNS information changed was at {{lastChanged}}.
+ The last time your DNS information changed was at {{ lastChanged }}.
Your deSEC account setup looks good and is ready to use.
diff --git a/www/webapp/src/views/HomePage.vue b/www/webapp/src/views/HomePage.vue
index a6f694a98..db102667b 100644
--- a/www/webapp/src/views/HomePage.vue
+++ b/www/webapp/src/views/HomePage.vue
@@ -63,8 +63,8 @@
- {{f.icon}}
- {{f.title}}
+ {{ f.icon }}
+ {{ f.title }}
@@ -171,8 +171,8 @@
- {{f.name}}
- sponsored by {{f.adopted_by}}
+ {{ f.name }}
+ sponsored by {{ f.adopted_by }}
has no sponsor, support it now!
diff --git a/www/webapp/src/views/ImpressumPage.vue b/www/webapp/src/views/ImpressumPage.vue
index bcfc9de5a..b537c9f09 100644
--- a/www/webapp/src/views/ImpressumPage.vue
+++ b/www/webapp/src/views/ImpressumPage.vue
@@ -7,7 +7,7 @@
Postanschrift / Address
Kyffhäuserstr. 5
10781 Berlin
E-Mail
- {{email}}
+ {{ email }}
Vertreten durch / Represented by
Dr. Nils Wisiol
diff --git a/www/webapp/src/views/PrivacyPolicy.vue b/www/webapp/src/views/PrivacyPolicy.vue
index aca1f31f7..953ff5224 100644
--- a/www/webapp/src/views/PrivacyPolicy.vue
+++ b/www/webapp/src/views/PrivacyPolicy.vue
@@ -10,8 +10,8 @@
- {{p.title}}
- {{p.text}}
+ {{ p.title }}
+ {{ p.text }}
@@ -86,7 +86,7 @@
Änderung unserer Datenschutzbestimmungen
Wir behalten uns vor, diese Datenschutzerklärung anzupassen, damit sie stets den aktuellen rechtlichen Anforderungen entspricht oder um Änderungen unserer Leistungen in der Datenschutzerklärung umzusetzen, z.B. bei der Einführung neuer Services. Für Ihren erneuten Besuch gilt dann die neue Datenschutzerklärung.
Fragen an den Datenschutzbeauftragten
- Wenn Sie Fragen zum Datenschutz haben, schreiben Sie uns bitte eine E-Mail oder wenden Sie sich direkt an die für den Datenschutz verantwortliche Person in unserer Organisation: {{email}}
+ Wenn Sie Fragen zum Datenschutz haben, schreiben Sie uns bitte eine E-Mail oder wenden Sie sich direkt an die für den Datenschutz verantwortliche Person in unserer Organisation: {{ email }}
Die Datenschutzerklärung wurde mithilfe der activeMind AG erstellt.
diff --git a/www/webapp/src/views/TermsPage.vue b/www/webapp/src/views/TermsPage.vue
index 78d2ab32c..fae872b53 100644
--- a/www/webapp/src/views/TermsPage.vue
+++ b/www/webapp/src/views/TermsPage.vue
@@ -31,7 +31,7 @@
- §{{idx+1}} {{t.title}}
+ §{{ idx+1 }} {{ t.title }}
From 9762509d3d3c7b4bc6e2f06590f5b4718e39275b Mon Sep 17 00:00:00 2001
From: Lukas Lihotzki
Date: Wed, 12 Jul 2023 11:26:13 +0200
Subject: [PATCH 3/3] refactor(webapp): replace vue-clipboard2
---
www/webapp/package.json | 1 -
www/webapp/src/main.js | 3 ---
www/webapp/src/views/DomainSetup.vue | 26 +++++++++++++++-----------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/www/webapp/package.json b/www/webapp/package.json
index ea5007562..e4f816015 100644
--- a/www/webapp/package.json
+++ b/www/webapp/package.json
@@ -17,7 +17,6 @@
"date-fns": "^2.30.0",
"pinia": "^2.0.30",
"vue": "~2.7.14",
- "vue-clipboard2": "^0.3.3",
"vue-router": "~3.6.5",
"vuelidate": "^0.7.7",
"vuetify": "^2.6.13"
diff --git a/www/webapp/src/main.js b/www/webapp/src/main.js
index dd10330a2..66982588e 100644
--- a/www/webapp/src/main.js
+++ b/www/webapp/src/main.js
@@ -2,7 +2,6 @@ import Vue from 'vue'
import App from '@/App.vue'
import router from '@/router'
import vuetify from '@/plugins/vuetify'
-import VueClipboard from 'vue-clipboard2'
import VueRouter from 'vue-router'
import Vuelidate from 'vuelidate'
import "@fontsource/roboto/300.css" /* light */
@@ -15,8 +14,6 @@ import {createPinia, PiniaVuePlugin} from "pinia";
Vue.config.productionTip = false
-VueClipboard.config.autoSetContainer = true
-Vue.use(VueClipboard)
Vue.use(Vuelidate)
// `Pinia` replaces `vuex` as store.
Vue.use(PiniaVuePlugin)
diff --git a/www/webapp/src/views/DomainSetup.vue b/www/webapp/src/views/DomainSetup.vue
index ac01e02a2..fdccea707 100644
--- a/www/webapp/src/views/DomainSetup.vue
+++ b/www/webapp/src/views/DomainSetup.vue
@@ -39,9 +39,7 @@
{{ ns.join('\n') }}
@@ -88,9 +86,7 @@
{{ t.data }}
@@ -193,11 +189,19 @@ export default {
},
},
methods: {
- copySuccess: function () {
- this.showSnackbar("Copied to clipboard.");
- },
- copyError: function () {
- this.showSnackbar("Copy to clipboard failed. Please try again manually.");
+ copyToClipboard: async function (text) {
+ try {
+ await navigator.clipboard.writeText(text).then(
+ () => {
+ this.showSnackbar("Copied to clipboard.");
+ },
+ () => {
+ this.showSnackbar("Copy to clipboard not allowed. Please try again manually.");
+ },
+ );
+ } catch (e) {
+ this.showSnackbar("Copy to clipboard failed. Please try again manually.");
+ }
},
showSnackbar: function (text) {
this.snackbar_text = text;