mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 07:10:27 +08:00
创建服务和修改服务HTTPS设置时也支持批量上传证书
This commit is contained in:
@@ -97,16 +97,46 @@ Vue.component("ssl-certs-box", {
|
||||
// 上传证书
|
||||
uploadCert: function () {
|
||||
let that = this
|
||||
teaweb.popup("/servers/certs/uploadPopup", {
|
||||
let userId = this.vUserId
|
||||
if (typeof userId != "number" && typeof userId != "string") {
|
||||
userId = 0
|
||||
}
|
||||
teaweb.popup("/servers/certs/uploadPopup?userId=" + userId, {
|
||||
height: "28em",
|
||||
callback: function (resp) {
|
||||
teaweb.success("上传成功", function () {
|
||||
that.certs.push(resp.data.cert)
|
||||
if (resp.data.cert != null) {
|
||||
that.certs.push(resp.data.cert)
|
||||
}
|
||||
if (resp.data.certs != null) {
|
||||
that.certs.$pushAll(resp.data.certs)
|
||||
}
|
||||
that.$forceUpdate()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 批量上传
|
||||
uploadBatch: function () {
|
||||
let that = this
|
||||
let userId = this.vUserId
|
||||
if (typeof userId != "number" && typeof userId != "string") {
|
||||
userId = 0
|
||||
}
|
||||
teaweb.popup("/servers/certs/uploadBatchPopup?userId=" + userId, {
|
||||
callback: function (resp) {
|
||||
if (resp.data.cert != null) {
|
||||
that.certs.push(resp.data.cert)
|
||||
}
|
||||
if (resp.data.certs != null) {
|
||||
that.certs.$pushAll(resp.data.certs)
|
||||
}
|
||||
that.$forceUpdate()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatTime: function (timestamp) {
|
||||
return new Date(timestamp * 1000).format("Y-m-d")
|
||||
@@ -132,7 +162,9 @@ Vue.component("ssl-certs-box", {
|
||||
</div>
|
||||
<div v-if="buttonsVisible()">
|
||||
<button class="ui button tiny" type="button" @click.prevent="selectCert()">选择已有证书</button>
|
||||
<span class="disabled">|</span>
|
||||
<button class="ui button tiny" type="button" @click.prevent="uploadCert()">上传新证书</button>
|
||||
<button class="ui button tiny" type="button" @click.prevent="uploadBatch()">批量上传证书</button>
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user