From f8387b4caeecc269aaf3d713f6043201de552ba8 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Wed, 28 Aug 2024 17:34:01 +0200 Subject: [PATCH] feat(ui): add streamer mode setting to hide sensitive informations (#3867) --- src/stores/base.js | 5 +++ src/views/Settings.vue | 78 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/src/stores/base.js b/src/stores/base.js index 5a61394eea1..d217eae8767 100644 --- a/src/stores/base.js +++ b/src/stores/base.js @@ -137,6 +137,7 @@ const useBaseStore = defineStore('base', { darkMode: settings.load('dark', false), navTabs: settings.load('navTabs', false), compactMode: settings.load('compact', false), + streamerMode: settings.load('streamerMode', false), }, }), getters: { @@ -592,6 +593,10 @@ const useBaseStore = defineStore('base', { settings.store('navTabs', value) this.ui.navTabs = value }, + setStreamerMode(value) { + settings.store('streamerMode', value) + this.ui.streamerMode = value + }, setCompactMode(value) { settings.store('compact', value) this.ui.compactMode = value diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 86b754a1b18..79e8751dc35 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -47,6 +47,14 @@ v-model="internalNavTabs" > + + + @@ -569,6 +577,11 @@ ]" persistent-hint append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_Unauthenticated', @@ -601,6 +614,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_Authenticated', @@ -632,6 +650,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_AccessControl', @@ -659,6 +682,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S0_Legacy', @@ -704,6 +732,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_Authenticated', @@ -736,6 +769,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_AccessControl', @@ -1094,6 +1132,11 @@ ]" persistent-hint append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_Unauthenticated', @@ -1126,6 +1169,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_Authenticated', @@ -1157,6 +1205,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_AccessControl', @@ -1184,6 +1237,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S0_Legacy', @@ -1229,6 +1287,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_Authenticated', @@ -1261,6 +1324,11 @@ ), ]" append-outer-icon="wifi_protected_setup" + :type=" + streamerMode + ? 'password' + : 'text' + " @click:append-outer=" randomKey( 'S2_AccessControl', @@ -1935,6 +2003,14 @@ export default { this.setNavTabs(value) }, }, + internalStreamerMode: { + get() { + return this.streamerMode + }, + set(value) { + this.setStreamerMode(value) + }, + }, filteredScales() { if (this.newZwave.scales && this.newZwave.scales.length > 0) { return this.scales.filter( @@ -2018,6 +2094,7 @@ export default { ...mapState(useBaseStore, { darkMode: (store) => store.ui.darkMode, navTabs: (store) => store.ui.navTabs, + streamerMode: (store) => store.ui.streamerMode, }), }, watch: { @@ -2171,6 +2248,7 @@ export default { ...mapActions(useBaseStore, [ 'setDarkMode', 'setNavTabs', + 'setStreamerMode', 'initSettings', 'init', 'showSnackbar',