实现HTTPS配置

This commit is contained in:
刘祥超
2020-10-01 16:01:04 +08:00
parent 10666cf56b
commit 7e83c656a9
13 changed files with 1129 additions and 3 deletions

View File

@@ -28,7 +28,11 @@
</tr>
</thead>
<tr v-for="(cert, index) in certs">
<td>{{cert.name}}</td>
<td>{{cert.name}}
<div v-if="cert.isCA" style="margin-top:0.5em">
<span class="ui label olive tiny">CA</span>
</div>
</td>
<td>
<span v-if="cert.commonNames != null && cert.commonNames.length > 0">{{cert.commonNames[cert.commonNames.length-1]}}</span>
</td>

View File

@@ -0,0 +1,43 @@
{$layout "layout_popup"}
<h3>选择证书</h3>
<p class="comment" v-if="certs.length == 0">暂时还没有相关的证书。</p>
<table class="ui table selectable" v-if="certs.length > 0">
<thead>
<tr>
<th>证书说明</th>
<th>顶级发行组织</th>
<th>域名</th>
<th>过期日期</th>
<th>引用服务</th>
<th>状态</th>
<th class="one op">操作</th>
</tr>
</thead>
<tr v-for="(cert, index) in certs">
<td>{{cert.name}}
<div v-if="cert.isCA" style="margin-top:0.5em">
<span class="ui label olive tiny">CA</span>
</div>
</td>
<td>
<span v-if="cert.commonNames != null && cert.commonNames.length > 0">{{cert.commonNames[cert.commonNames.length-1]}}</span>
</td>
<td>
<div v-for="dnsName in cert.dnsNames" style="margin-bottom:0.4em">
<span class="ui label tiny">{{dnsName}}</span>
</div>
</td>
<td>{{certInfos[index].endDay}}</td>
<td>{{certInfos[index].countServers}}</td>
<td nowrap="">
<span class="ui label red tiny basic" v-if="certInfos[index].isExpired">已过期</span>
<span class="ui label green tiny basic" v-else>有效中</span>
</td>
<td>
<a href="" @click.prevent="selectCert(cert)">选择</a>
</td>
</tr>
</table>
<div class="page" v-html="page"></div>

View File

@@ -0,0 +1,14 @@
Tea.context(function () {
this.selectCert = function (cert) {
NotifyPopup({
code: 200,
data: {
cert: cert,
certRef: {
isOn: true,
certId: cert.id
}
}
})
}
})

View File

@@ -1,7 +1,11 @@
{$layout}
{$template "/left_menu"}
{$var "header"}
<script src="/servers/components/ssl/datajs" type="text/javascript"></script>
<script src="/js/sortable.min.js" type="text/javascript"></script>
{$end}
<div class="right-box">
<p class="comment">提醒HTTP2、证书等信息修改后可能需要清空浏览器缓存后才能浏览效果。</p>
<form class="ui form" data-tea-action="$" data-tea-success="success">
@@ -26,6 +30,10 @@
</tr>
</tbody>
</table>
<!-- SSL配置 -->
<ssl-config-box :v-ssl-policy="httpsConfig.sslPolicy" :v-protocol="'https'" v-show="httpsConfig.isOn"></ssl-config-box>
<submit-btn></submit-btn>
</form>
</div>