Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marius-wieschollek/passwords-webextension.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius David Wieschollek <passwords.public@mdns.eu>2020-12-20 18:09:56 +0300
committerMarius David Wieschollek <passwords.public@mdns.eu>2020-12-20 18:09:56 +0300
commit1cfd4b6614a4a05c511fdc96ec91296647c73c75 (patch)
tree2d46dfff14750c9181dbcf73df3cbc35adcc5e77 /src/vue/Components
parent345f7f0d2528cff8a706b6cec6e7ea841a650570 (diff)
Add option to disable localisation
Signed-off-by: Marius David Wieschollek <passwords.public@mdns.eu>
Diffstat (limited to 'src/vue/Components')
-rw-r--r--src/vue/Components/Options/Debug.vue83
1 files changed, 67 insertions, 16 deletions
diff --git a/src/vue/Components/Options/Debug.vue b/src/vue/Components/Options/Debug.vue
index 3dccd6a..a4be99b 100644
--- a/src/vue/Components/Options/Debug.vue
+++ b/src/vue/Components/Options/Debug.vue
@@ -18,6 +18,12 @@
<span class="value">{{ hidden.id }}</span>
</div>
+ <translate tag="h3" say="DebugSettings"/>
+ <div class="debug-info">
+ <translate tag="label" class="label" say="DebugLanguageTagsEnabled"/>
+ <slider-field v-model="settings.localize"/>
+ </div>
+
<translate tag="h3" say="DebugErrorLog"/>
<div class="debug-error-item" v-for="error in errors">
<div class="error-message" v-if="error.details && error.details.message" @click="showData">
@@ -37,38 +43,75 @@
import ToastService from "@js/Services/ToastService";
import ErrorManager from "@js/Manager/ErrorManager";
import LocalisationService from "@js/Services/LocalisationService";
+ import SliderField from "@vue/Components/Form/SliderField";
+ import SettingsService from "@js/Services/SettingsService";
export default {
- components: {Icon, Translate},
+ components: {SliderField, Icon, Translate},
data() {
return {
- hidden: {
+ hidden : {
id: ''
},
- errors: [],
- app: {
- version: process.env.APP_VERSION,
- platform: process.env.APP_PLATFORM,
+ errors : [],
+ app : {
+ version : process.env.APP_VERSION,
+ platform : process.env.APP_PLATFORM,
environment: process.env.NODE_ENV
- }
+ },
+ settings: {
+ localize: false
+ },
+ interval: null
};
},
mounted() {
- MessageService.send('options.debug.data').then((reply) => {
- let data = reply.getPayload();
+ this.loadData();
+ if(!this.interval) {
+ this.interval = setInterval(() => {
+ this.loadData();
+ }, 5000);
+ }
+ },
- if(data.hasOwnProperty('hidden')) {
- this.hidden = data.hidden;
- }
+ beforeDestroy() {
+ clearInterval(this.interval);
+ this.interval = null;
+ },
- if(data.hasOwnProperty('errors')) {
- this.errors = data.errors;
- }
- });
+ activated() {
+ this.loadData();
+ if(!this.interval) {
+ this.interval = setInterval(() => {
+ this.loadData();
+ }, 5000);
+ }
+ },
+
+ deactivated() {
+ clearInterval(this.interval);
+ this.interval = null;
},
methods: {
+ loadData() {
+ MessageService.send('options.debug.data').then((reply) => {
+ let data = reply.getPayload();
+
+ if(data.hasOwnProperty('hidden')) {
+ this.hidden = data.hidden;
+ }
+
+ if(data.hasOwnProperty('errors')) {
+ this.errors = data.errors;
+ }
+
+ if(data.hasOwnProperty('settings')) {
+ this.settings = data.settings;
+ }
+ });
+ },
getTitle(error) {
if(error.details) {
let label = '';
@@ -103,6 +146,14 @@
.success('DebugErrorDataCopied')
.catch(ErrorManager.catchEvt);
}
+ },
+
+ watch: {
+ 'settings.localize': (value) => {
+ SettingsService
+ .set('debug.localisation.enabled', !value)
+ .catch(ErrorManager.catchEvt);
+ }
}
};
</script>