feat: add MinIO support for attachment management (halo-dev/console#261)

pull/3445/head
Wh1te 2020-10-07 10:53:15 +08:00 committed by GitHub
parent 72ad0937b5
commit a0ad14b5fe
2 changed files with 69 additions and 0 deletions

View File

@ -117,6 +117,10 @@ attachmentApi.type = {
HUAWEIOBS: {
type: 'HUAWEIOBS',
text: '华为云'
},
MINIO: {
type: 'MINIO',
text: 'MinIO'
}
}

View File

@ -374,6 +374,41 @@
/>
</a-form-model-item>
</div>
<div
id="minioForm"
v-show="options.attachment_type === 'MINIO'"
>
<a-form-model-item label="EndPoint终端节点">
<a-input
v-model="options.minio_endpoint"
placeholder="Endpoint"
/>
</a-form-model-item>
<a-form-model-item label="Bucket桶名称">
<a-input
v-model="options.minio_bucket_name"
placeholder="桶名称"
/>
</a-form-model-item>
<a-form-model-item label="Access Key">
<a-input-password
v-model="options.minio_access_key"
autocomplete="new-password"
/>
</a-form-model-item>
<a-form-model-item label="Access Secret">
<a-input-password
v-model="options.minio_access_secret"
autocomplete="new-password"
/>
</a-form-model-item>
<a-form-model-item label="文件目录:">
<a-input
v-model="options.minio_source"
placeholder="不填写则上传到根目录"
/>
</a-form-model-item>
</div>
<a-form-model-item>
<ReactiveButton
type="primary"
@ -678,6 +713,36 @@ export default {
return
}
break
case 'MINIO':
if (!this.options.minio_endpoint) {
this.$notification['error']({
message: '提示',
description: 'EndPoint终端节点不能为空'
})
return
}
if (!this.options.minio_bucket_name) {
this.$notification['error']({
message: '提示',
description: 'Bucket 不能为空!'
})
return
}
if (!this.options.minio_access_key) {
this.$notification['error']({
message: '提示',
description: 'Access Key 不能为空!'
})
return
}
if (!this.options.minio_access_secret) {
this.$notification['error']({
message: '提示',
description: 'Access Secret 不能为空!'
})
return
}
break
}
const _this = this
_this.$refs.attachmentOptionsForm.validate(valid => {