Add User Backup settings, fix key for Pleroma.Web.Plugs.RemoteIp

This commit is contained in:
Angelina Filippova 2020-11-12 21:39:31 +03:00
parent 6698a99613
commit 050134bfbf
2 changed files with 11 additions and 1 deletions

View file

@ -2,6 +2,10 @@
<div v-if="!loading" :class="isSidebarOpen" class="form-container"> <div v-if="!loading" :class="isSidebarOpen" class="form-container">
<editor-input v-model="termsOfServicesContent" :name="'terms-of-service'" @input="handleEditorUpdate"/> <editor-input v-model="termsOfServicesContent" :name="'terms-of-service'" @input="handleEditorUpdate"/>
<el-divider class="divider thick-line"/> <el-divider class="divider thick-line"/>
<el-form :model="backupData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="backup" :data="backupData"/>
</el-form>
<el-divider v-if="backup" class="divider thick-line"/>
<el-form :model="mimeTypesData" :label-position="labelPosition" :label-width="labelWidth"> <el-form :model="mimeTypesData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="mimeTypes" :data="mimeTypesData"/> <setting :setting-group="mimeTypes" :data="mimeTypesData"/>
</el-form> </el-form>
@ -42,6 +46,12 @@ export default {
...mapGetters([ ...mapGetters([
'settings' 'settings'
]), ]),
backup() {
return this.settings.description.find(setting => setting.key === 'Pleroma.User.Backup')
},
backupData() {
return _.get(this.settings.settings, [':pleroma', 'Pleroma.User.Backup']) || {}
},
castAndValidate() { castAndValidate() {
return this.settings.description.find(setting => setting.key === 'Pleroma.Web.ApiSpec.CastAndValidate') return this.settings.description.find(setting => setting.key === 'Pleroma.Web.ApiSpec.CastAndValidate')
}, },

View file

@ -78,7 +78,7 @@ export const tabs = description => {
}, },
'other': { 'other': {
label: 'settings.other', label: 'settings.other',
settings: [':mime', 'Pleroma.Web.Plugs.RemoteIp', ':modules', 'Pleroma.Web.ApiSpec.CastAndValidate', ':terms_of_services'] settings: [':mime', 'Pleroma.User.Backup', 'Pleroma.Web.Plugs.RemoteIp', ':modules', 'Pleroma.Web.ApiSpec.CastAndValidate', ':terms_of_services']
} }
} }
} }