mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 00:20:26 +08:00
[HTTPS]可以直接点击按钮申请免费证书
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
Vue.component("ssl-certs-box", {
|
||||
props: ["v-certs", "v-protocol", "v-view-size", "v-single-mode"],
|
||||
props: [
|
||||
"v-certs", // 证书列表
|
||||
"v-protocol", // 协议:https|tls
|
||||
"v-view-size", // 弹窗尺寸
|
||||
"v-single-mode" // 单证书模式
|
||||
],
|
||||
data: function () {
|
||||
let certs = this.vCerts
|
||||
if (certs == null) {
|
||||
certs = []
|
||||
}
|
||||
|
||||
return {
|
||||
certs: certs
|
||||
}
|
||||
@@ -82,7 +88,7 @@ Vue.component("ssl-certs-box", {
|
||||
</div>
|
||||
<div v-if="buttonsVisible()">
|
||||
<button class="ui button tiny" type="button" @click.prevent="selectCert()">选择已有证书</button>
|
||||
<button class="ui button tiny" type="button" @click.prevent="uploadCert()">上传新证书</button>
|
||||
<button class="ui button tiny" type="button" @click.prevent="uploadCert()">上传新证书</button>
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
Vue.component("ssl-config-box", {
|
||||
props: ["v-ssl-policy", "v-protocol"],
|
||||
props: ["v-ssl-policy", "v-protocol", "v-server-id"],
|
||||
created: function () {
|
||||
let that = this
|
||||
setTimeout(function () {
|
||||
@@ -119,6 +119,25 @@ Vue.component("ssl-config-box", {
|
||||
})
|
||||
},
|
||||
|
||||
// 申请证书
|
||||
requestCert: function () {
|
||||
// 已经在证书中的域名
|
||||
let excludeServerNames = []
|
||||
if (this.policy != null && this.policy.certs.length > 0) {
|
||||
this.policy.certs.forEach(function (cert) {
|
||||
excludeServerNames.$pushAll(cert.dnsNames)
|
||||
})
|
||||
}
|
||||
|
||||
let that = this
|
||||
teaweb.popup("/servers/server/settings/https/requestCertPopup?serverId=" + this.vServerId + "&excludeServerNames=" + excludeServerNames.join(","), {
|
||||
callback: function () {
|
||||
that.policy.certRefs.push(resp.data.certRef)
|
||||
that.policy.certs.push(resp.data.cert)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 更多选项
|
||||
changeOptionsVisible: function () {
|
||||
this.moreOptionsVisible = !this.moreOptionsVisible
|
||||
@@ -338,7 +357,8 @@ Vue.component("ssl-config-box", {
|
||||
<div class="ui divider"></div>
|
||||
</div>
|
||||
<button class="ui button tiny" type="button" @click.prevent="selectCert()">选择已有证书</button>
|
||||
<button class="ui button tiny" type="button" @click.prevent="uploadCert()">上传新证书</button>
|
||||
<button class="ui button tiny" type="button" @click.prevent="uploadCert()">上传新证书</button>
|
||||
<button class="ui button tiny" type="button" @click.prevent="requestCert()" v-if="vServerId != null && vServerId > 0">申请免费证书</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user