Skip to content

Commit

Permalink
feat(ui): add streamer mode setting to hide sensitive informations (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Aug 28, 2024
1 parent 6acc4ec commit f8387b4
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stores/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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
Expand Down
78 changes: 78 additions & 0 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
v-model="internalNavTabs"
></v-switch>
</v-col>
<v-col cols="12" sm="6">
<v-switch
hint="Enable this to hide sensitive informations from the UI"
persistent-hint
label="Streamer mode"
v-model="internalStreamerMode"
></v-switch>
</v-col>
</v-row>
</v-expansion-panel-content>
<v-divider />
Expand Down Expand Up @@ -569,6 +577,11 @@
]"
persistent-hint
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_Unauthenticated',
Expand Down Expand Up @@ -601,6 +614,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_Authenticated',
Expand Down Expand Up @@ -632,6 +650,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_AccessControl',
Expand Down Expand Up @@ -659,6 +682,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S0_Legacy',
Expand Down Expand Up @@ -704,6 +732,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_Authenticated',
Expand Down Expand Up @@ -736,6 +769,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_AccessControl',
Expand Down Expand Up @@ -1094,6 +1132,11 @@
]"
persistent-hint
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_Unauthenticated',
Expand Down Expand Up @@ -1126,6 +1169,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_Authenticated',
Expand Down Expand Up @@ -1157,6 +1205,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_AccessControl',
Expand Down Expand Up @@ -1184,6 +1237,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S0_Legacy',
Expand Down Expand Up @@ -1229,6 +1287,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_Authenticated',
Expand Down Expand Up @@ -1261,6 +1324,11 @@
),
]"
append-outer-icon="wifi_protected_setup"
:type="
streamerMode
? 'password'
: 'text'
"
@click:append-outer="
randomKey(
'S2_AccessControl',
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -2018,6 +2094,7 @@ export default {
...mapState(useBaseStore, {
darkMode: (store) => store.ui.darkMode,
navTabs: (store) => store.ui.navTabs,
streamerMode: (store) => store.ui.streamerMode,
}),
},
watch: {
Expand Down Expand Up @@ -2171,6 +2248,7 @@ export default {
...mapActions(useBaseStore, [
'setDarkMode',
'setNavTabs',
'setStreamerMode',
'initSettings',
'init',
'showSnackbar',
Expand Down

0 comments on commit f8387b4

Please sign in to comment.