ChoiceSetting support added, added captcha settings
This commit is contained in:
parent
819cd41cf0
commit
0b5e536b4c
7 changed files with 121 additions and 13 deletions
|
|
@ -11,7 +11,32 @@ export default {
|
|||
...Setting.props,
|
||||
options: {
|
||||
type: Array,
|
||||
required: true
|
||||
required: false
|
||||
},
|
||||
optionLabelMap: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...Setting.computed,
|
||||
realOptions () {
|
||||
if (this.source === 'admin') {
|
||||
console.log(this.backendDescriptionSuggestions)
|
||||
return this.backendDescriptionSuggestions.map(x => ({
|
||||
key: x,
|
||||
value: x,
|
||||
label: this.optionLabelMap[x] || x
|
||||
}))
|
||||
}
|
||||
return this.options
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...Setting.methods,
|
||||
getValue (e) {
|
||||
return e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,15 +3,20 @@
|
|||
v-if="matchesExpertLevel"
|
||||
class="ChoiceSetting"
|
||||
>
|
||||
<slot />
|
||||
<template v-if="backendDescription">
|
||||
{{ backendDescriptionLabel }}
|
||||
</template>
|
||||
<template v-else>
|
||||
<slot />
|
||||
</template>
|
||||
{{ ' ' }}
|
||||
<Select
|
||||
:model-value="state"
|
||||
:model-value="draftMode ? draft :state"
|
||||
:disabled="disabled"
|
||||
@update:modelValue="update"
|
||||
>
|
||||
<option
|
||||
v-for="option in options"
|
||||
v-for="option in realOptions"
|
||||
:key="option.key"
|
||||
:value="option.value"
|
||||
>
|
||||
|
|
@ -24,6 +29,13 @@
|
|||
:onclick="reset"
|
||||
/>
|
||||
<ProfileSettingIndicator :is-profile="isProfileSetting" />
|
||||
<DraftButtons />
|
||||
<p
|
||||
v-if="backendDescriptionDescription"
|
||||
class="setting-description"
|
||||
>
|
||||
{{ backendDescriptionDescription + ' ' }}
|
||||
</p>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,12 @@
|
|||
class="NumberSetting"
|
||||
>
|
||||
<label :for="path">
|
||||
<slot />
|
||||
<template v-if="backendDescription">
|
||||
{{ backendDescriptionLabel + ' ' }}
|
||||
</template>
|
||||
<template v-else>
|
||||
<slot />
|
||||
</template>
|
||||
</label>
|
||||
<input
|
||||
:id="path"
|
||||
|
|
@ -21,6 +26,14 @@
|
|||
:changed="isChanged"
|
||||
:onclick="reset"
|
||||
/>
|
||||
<ProfileSettingIndicator :is-profile="isProfileSetting" />
|
||||
<DraftButtons />
|
||||
<p
|
||||
v-if="backendDescriptionDescription"
|
||||
class="setting-description"
|
||||
>
|
||||
{{ backendDescriptionDescription + ' ' }}
|
||||
</p>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export default {
|
|||
},
|
||||
props: {
|
||||
path: {
|
||||
type: String,
|
||||
type: [String, Array],
|
||||
required: true
|
||||
},
|
||||
disabled: {
|
||||
|
|
@ -21,7 +21,7 @@ export default {
|
|||
default: false
|
||||
},
|
||||
parentPath: {
|
||||
type: String
|
||||
type: [String, Array]
|
||||
},
|
||||
parentInvert: {
|
||||
type: Boolean,
|
||||
|
|
@ -68,6 +68,9 @@ export default {
|
|||
backendDescriptionDescription () {
|
||||
return this.backendDescription?.description
|
||||
},
|
||||
backendDescriptionSuggestions () {
|
||||
return this.backendDescription?.suggestions
|
||||
},
|
||||
shouldBeDisabled () {
|
||||
const parentValue = this.parentPath !== undefined ? get(this.configSource, this.parentPath) : null
|
||||
return this.disabled || (parentValue !== null ? (this.parentInvert ? parentValue : !parentValue) : false)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ const SharedComputedObject = () => ({
|
|||
},
|
||||
mergedConfig () {
|
||||
return this.$store.getters.mergedConfig
|
||||
},
|
||||
adminConfig () {
|
||||
return this.$store.state.adminSettings.config
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue