Add ability to configure S3 settings

This commit is contained in:
Angelina Filippova 2020-07-10 18:03:10 +03:00
parent 91ccbfeda5
commit 1e6e006f14

View file

@ -8,6 +8,10 @@
<setting :setting-group="uploadersLocal" :data="uploadersLocalData"/> <setting :setting-group="uploadersLocal" :data="uploadersLocalData"/>
<el-divider v-if="uploadersLocal" class="divider thick-line"/> <el-divider v-if="uploadersLocal" class="divider thick-line"/>
</el-form> </el-form>
<el-form v-if="showUploadersS3" :model="s3Data" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="s3" :data="s3Data"/>
<el-divider v-if="s3" class="divider thick-line"/>
</el-form>
<el-form v-if="showUploadersS3" :model="uploadersS3Data" :label-position="labelPosition" :label-width="labelWidth"> <el-form v-if="showUploadersS3" :model="uploadersS3Data" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="uploadersS3" :data="uploadersS3Data"/> <setting :setting-group="uploadersS3" :data="uploadersS3Data"/>
<el-divider v-if="uploadersS3" class="divider thick-line"/> <el-divider v-if="uploadersS3" class="divider thick-line"/>
@ -62,6 +66,12 @@ export default {
loading() { loading() {
return this.settings.loading return this.settings.loading
}, },
s3() {
return this.settings.description.find(setting => setting.key === ':s3')
},
s3Data() {
return _.get(this.settings.settings, [':ex_aws', ':s3']) || {}
},
showUploadersS3() { showUploadersS3() {
const uploader = _.get(this.settings.settings, [':pleroma', 'Pleroma.Upload', ':uploader']) const uploader = _.get(this.settings.settings, [':pleroma', 'Pleroma.Upload', ':uploader'])
return uploader === 'Pleroma.Uploaders.S3' return uploader === 'Pleroma.Uploaders.S3'