Update computed values for Endpoint, Database and fix values passed to Esshd tab

This commit is contained in:
Angelina Filippova 2019-11-19 19:49:36 +09:00
parent 4a17d2275a
commit ec65a99ce4
4 changed files with 28 additions and 20 deletions

View file

@ -25,7 +25,7 @@ export default {
return this.settings.description.find(setting => setting.key === ':database')
},
databaseData() {
return this.settings.settings[':database']
return this.settings.settings.pleroma[':database']
},
isMobile() {
return this.$store.state.app.device === 'mobile'

View file

@ -1,19 +1,16 @@
<template>
<el-form v-if="!loading" ref="endpointData" :model="endpointData" :label-width="labelWidth">
<setting :setting-group="endpoint" :data="endpointData"/>
<div v-if="!loading">
<el-form ref="endpointData" :model="endpointData" :label-width="labelWidth">
<setting :setting-group="endpoint" :data="endpointData"/>
</el-form>
<div class="line"/>
<el-form-item class="options-paragraph-container">
<p class="options-paragraph">Only common options are listed here. You can add more (all configuration options can be viewed
<a
href="https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-dynamic-configuration"
rel="nofollow noreferrer noopener"
target="_blank">here</a>)
</p>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">Submit</el-button>
</el-form-item>
</el-form>
<el-form v-if="!loading" ref="endpointMetricsExporter" :model="endpointMetricsExporterData" :label-width="labelWidth">
<setting :setting-group="endpointMetricsExporter" :data="endpointMetricsExporterData"/>
<el-form-item>
<el-button type="primary" @click="onSubmit">Submit</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
@ -34,7 +31,13 @@ export default {
return this.settings.description.find(setting => setting.key === 'Pleroma.Web.Endpoint')
},
endpointData() {
return this.settings.settings['Pleroma.Web.Endpoint']
return this.settings.settings.pleroma['Pleroma.Web.Endpoint']
},
endpointMetricsExporter() {
return this.settings.description.find(setting => setting.key === 'Pleroma.Web.Endpoint.MetricsExporter')
},
endpointMetricsExporterData() {
return this.settings.settings.prometheus['Pleroma.Web.Endpoint.MetricsExporter']
},
isMobile() {
return this.$store.state.app.device === 'mobile'

View file

@ -32,7 +32,7 @@ export default {
return this.settings.description.find(setting => setting.group === ':esshd')
},
esshdData() {
return this.settings.settings[':esshd']
return this.settings.settings.esshd
},
isMobile() {
return this.$store.state.app.device === 'mobile'

View file

@ -2,16 +2,16 @@
<el-form-item :label="setting.label" :label-width="customLabelWidth">
<el-input
v-if="setting.type === 'string'"
:value="data[setting.key]"
:value="inputValue"
:placeholder="setting.suggestions ? setting.suggestions[0] : null"
@input="updateSetting($event, settingGroup.key, setting.key)"/>
<el-switch
v-if="setting.type === 'boolean'"
:value="data[setting.key]"
:value="inputValue"
@change="updateSetting($event, settingGroup.key, setting.key)"/>
<el-input-number
v-if="setting.type === 'integer'"
:value="data[setting.key]"
:value="inputValue"
:placeholder="setting.suggestions ? setting.suggestions[0].toString() : null"
:min="0"
size="large"
@ -213,6 +213,11 @@ export default {
this.processNestedData([value], this.settingGroup.key, this.setting.key, this.data[this.setting.key])
}
},
inputValue() {
return ([':esshd'].includes(this.settingGroup.group) && this.data[this.setting.key])
? this.data[this.setting.key].value
: this.data[this.setting.key]
},
labelWidth() {
return this.isMobile ? '100px' : '240px'
},