limits tab, backend descriptions

This commit is contained in:
Henry Jameson 2023-03-19 21:27:07 +02:00
commit 332ad77e35
13 changed files with 370 additions and 25 deletions

View file

@ -12,7 +12,12 @@
v-if="!!$slots.default"
class="label"
>
<slot />
<template v-if="backendDescription">
{{ backendDescriptionLabel + ' ' }}
</template>
<template v-else>
<slot />
</template>
</span>
{{ ' ' }}
<ModifiedIndicator
@ -21,6 +26,12 @@
/>
<ProfileSettingIndicator :is-profile="isProfileSetting" />
<DraftButtons />
<p
v-if="backendDescriptionDescription"
class="setting-description"
>
{{ backendDescriptionDescription + ' ' }}
</p>
</Checkbox>
</label>
</template>

View file

@ -4,7 +4,12 @@
class="IntegerSetting"
>
<label :for="path">
<slot />
<template v-if="backendDescription">
{{ backendDescriptionLabel + ' ' }}
</template>
<template v-else>
<slot />
</template>
</label>
<input
:id="path"
@ -23,6 +28,12 @@
/>
<ProfileSettingIndicator :is-profile="isProfileSetting" />
<DraftButtons />
<p
v-if="backendDescriptionDescription"
class="setting-description"
>
{{ backendDescriptionDescription + ' ' }}
</p>
</span>
</template>

View file

@ -59,6 +59,16 @@ export default {
return value
}
},
backendDescription () {
console.log(get(this.$store.state.adminSettings.descriptions, this.path))
return get(this.$store.state.adminSettings.descriptions, this.path)
},
backendDescriptionLabel () {
return this.backendDescription.label
},
backendDescriptionDescription () {
return this.backendDescription.description
},
shouldBeDisabled () {
const parentValue = this.parentPath !== undefined ? get(this.configSource, this.parentPath) : null
return this.disabled || (parentValue !== null ? (this.parentInvert ? parentValue : !parentValue) : false)

View file

@ -4,7 +4,12 @@
class="StringSetting"
>
<label :for="path">
<slot />
<template v-if="backendDescription">
{{ backendDescriptionLabel + ' ' }}
</template>
<template v-else>
<slot />
</template>
</label>
<input
:id="path"
@ -21,6 +26,12 @@
/>
<ProfileSettingIndicator :is-profile="isProfileSetting" />
<DraftButtons />
<p
v-if="backendDescriptionDescription"
class="setting-description"
>
{{ backendDescriptionDescription + ' ' }}
</p>
</label>
</template>