mirror of https://github.com/halo-dev/halo-admin
feat: add MinIO support for attachment management (#261)
parent
c5336fb78f
commit
9a2d9bb8ea
|
@ -117,6 +117,10 @@ attachmentApi.type = {
|
||||||
HUAWEIOBS: {
|
HUAWEIOBS: {
|
||||||
type: 'HUAWEIOBS',
|
type: 'HUAWEIOBS',
|
||||||
text: '华为云'
|
text: '华为云'
|
||||||
|
},
|
||||||
|
MINIO: {
|
||||||
|
type: 'MINIO',
|
||||||
|
text: 'MinIO'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -374,6 +374,41 @@
|
||||||
/>
|
/>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</div>
|
</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>
|
<a-form-model-item>
|
||||||
<ReactiveButton
|
<ReactiveButton
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -678,6 +713,36 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
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
|
const _this = this
|
||||||
_this.$refs.attachmentOptionsForm.validate(valid => {
|
_this.$refs.attachmentOptionsForm.validate(valid => {
|
||||||
|
|
Loading…
Reference in New Issue