initial admin settings prototype (WIP)
This commit is contained in:
parent
9632b77786
commit
4d23d31fec
25 changed files with 760 additions and 31 deletions
|
|
@ -42,6 +42,8 @@ export default {
|
|||
switch (this.source) {
|
||||
case 'profile':
|
||||
return this.$store.state.profileConfig
|
||||
case 'admin':
|
||||
return this.$store.state.adminSettings.config
|
||||
default:
|
||||
return this.$store.getters.mergedConfig
|
||||
}
|
||||
|
|
@ -50,6 +52,8 @@ export default {
|
|||
switch (this.source) {
|
||||
case 'profile':
|
||||
return (k, v) => this.$store.dispatch('setProfileOption', { name: k, value: v })
|
||||
case 'admin':
|
||||
return (k, v) => console.log(this.path, k, v)
|
||||
default:
|
||||
return (k, v) => this.$store.dispatch('setOption', { name: k, value: v })
|
||||
}
|
||||
|
|
@ -66,7 +70,15 @@ export default {
|
|||
return this.source === 'profile'
|
||||
},
|
||||
isChanged () {
|
||||
return !this.source === 'default' && this.state !== this.defaultState
|
||||
switch (this.source) {
|
||||
case 'profile':
|
||||
return false
|
||||
case 'admin':
|
||||
console.log(this.$store.state.adminSettings.modifiedPaths)
|
||||
return this.$store.state.adminSettings.modifiedPaths.has(this.path)
|
||||
default:
|
||||
return this.state !== this.defaultState
|
||||
}
|
||||
},
|
||||
matchesExpertLevel () {
|
||||
return (this.expert || 0) <= this.$store.state.config.expertLevel > 0
|
||||
|
|
|
|||
9
src/components/settings_modal/helpers/string_setting.js
Normal file
9
src/components/settings_modal/helpers/string_setting.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import ModifiedIndicator from './modified_indicator.vue'
|
||||
import Setting from './setting.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ModifiedIndicator
|
||||
},
|
||||
...Setting
|
||||
}
|
||||
25
src/components/settings_modal/helpers/string_setting.vue
Normal file
25
src/components/settings_modal/helpers/string_setting.vue
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<template>
|
||||
<label
|
||||
v-if="matchesExpertLevel"
|
||||
class="StringSetting"
|
||||
>
|
||||
<label :for="path">
|
||||
<slot />
|
||||
</label>
|
||||
<input
|
||||
:id="path"
|
||||
class="string-input"
|
||||
step="1"
|
||||
:disabled="disabled"
|
||||
:value="state"
|
||||
@change="update"
|
||||
>
|
||||
{{ ' ' }}
|
||||
<ModifiedIndicator
|
||||
:changed="isChanged"
|
||||
:onclick="reset"
|
||||
/>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<script src="./boolean_setting.js"></script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue