mirror of https://github.com/halo-dev/halo
feat: add MinIO support for attachment management (halo-dev/console#261)
parent
72ad0937b5
commit
a0ad14b5fe
|
@ -117,6 +117,10 @@ attachmentApi.type = {
|
|||
HUAWEIOBS: {
|
||||
type: 'HUAWEIOBS',
|
||||
text: '华为云'
|
||||
},
|
||||
MINIO: {
|
||||
type: 'MINIO',
|
||||
text: 'MinIO'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue