mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-17 22:30:25 +08:00
实现对ACME用户的增删改
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,15 +0,0 @@
|
||||
.pre-box {
|
||||
padding: 1em;
|
||||
margin: 0;
|
||||
line-height: 1.7;
|
||||
-ms-word-break: break-all;
|
||||
word-break: break-all;
|
||||
font-size: 0.9em;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
overflow-y: auto;
|
||||
max-height: 20em;
|
||||
}
|
||||
.pre-box::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
/*# sourceMappingURL=certPopup.css.map */
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"sources":["certPopup.less"],"names":[],"mappings":"AAAA;EACC,YAAA;EACA,SAAA;EACA,gBAAA;EACA,yBAAA;EACA,qBAAA;EACA,gBAAA;EACA,+BAAA;EACA,gBAAA;EACA,gBAAA;;AAGD,QAAQ;EACP,UAAA","file":"certPopup.css"}
|
||||
@@ -1,74 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>证书详情</h3>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">证书说明</td>
|
||||
<td>{{info.name}}</td>
|
||||
</tr>
|
||||
<tr v-if="info.description.length > 0">
|
||||
<td>详细说明</td>
|
||||
<td>{{info.description}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>证书状态</td>
|
||||
<td>
|
||||
<span class="ui label small green basic" v-if="info.isAvailable">有效中</span>
|
||||
<span class="ui label small red basic" v-else>已过期</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发行信息</td>
|
||||
<td>
|
||||
<div v-if="info.commonNames != null">
|
||||
<div v-for="(commonName, index) in info.commonNames">
|
||||
<span v-html="indent(index)"></span>{{commonName}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>域名</td>
|
||||
<td>
|
||||
<span class="ui label small" v-for="dnsName in info.dnsNames">{{dnsName}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>有效期</td>
|
||||
<td>{{info.beginTime}} - {{info.endTime}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>引用服务</td>
|
||||
<td>
|
||||
<span class="disabled" v-if="servers.length == 0">暂时没有引用此证书的服务。</span>
|
||||
<div v-if="servers.length > 0">
|
||||
<a v-for="server in servers" :href="'/servers/server?serverId=' + server.id" target="_blank" class="ui label small">{{server.name}}</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>证书文件下载</td>
|
||||
<td>
|
||||
<a :href="'/servers/components/ssl/downloadZip?certId=' + info.id" target="_blank">[ZIP下载]</a>
|
||||
<a :href="'/servers/components/ssl/downloadCert?certId=' + info.id" target="_blank">[证书下载]</a>
|
||||
<a :href="'/servers/components/ssl/downloadKey?certId=' + info.id" v-if="!info.isCA" target="_blank">[私钥下载]</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>证书预览</td>
|
||||
<td>
|
||||
<pre class="pre-box" style="font-family: Menlo, Monaco, 'Courier New', monospace !important">{{info.certString}}</pre>
|
||||
<div style="margin-top:1em">
|
||||
<a :href="'/servers/components/ssl/viewCert?certId=' + info.id" target="_blank">[浏览器新窗口打开]</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!info.isCA">
|
||||
<td>私钥预览</td>
|
||||
<td><pre class="pre-box" style="font-family: Menlo, Monaco, 'Courier New', monospace !important">{{info.keyString}}</pre>
|
||||
<div style="margin-top: 1em">
|
||||
<a :href="'/servers/components/ssl/viewKey?certId=' + info.id" target="_blank">[浏览器新窗口打开]</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1,10 +0,0 @@
|
||||
Tea.context(function () {
|
||||
// 打印缩进
|
||||
this.indent = function (index) {
|
||||
let indent = ""
|
||||
for (let i = 0; i < index; i++) {
|
||||
indent += " "
|
||||
}
|
||||
return indent
|
||||
}
|
||||
})
|
||||
@@ -1,15 +0,0 @@
|
||||
.pre-box {
|
||||
padding: 1em;
|
||||
margin: 0;
|
||||
line-height: 1.7;
|
||||
-ms-word-break: break-all;
|
||||
word-break: break-all;
|
||||
font-size: 0.9em;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
overflow-y: auto;
|
||||
max-height: 20em;
|
||||
}
|
||||
|
||||
.pre-box::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
{$layout}
|
||||
{$template "/left_menu_top"}
|
||||
|
||||
<div class="right-box without-tabbar">
|
||||
<second-menu>
|
||||
<menu-item href="/servers/components/ssl" :active="type == ''">所有证书({{countAll}})</menu-item>
|
||||
<menu-item href="/servers/components/ssl?type=ca" :active="type == 'ca'">CA证书({{countCA}})</menu-item>
|
||||
<menu-item href="/servers/components/ssl?type=available" :active="type == 'available'">有效证书({{countAvailable}})</menu-item>
|
||||
<menu-item href="/servers/components/ssl?type=expired" :active="type == 'expired'">过期证书<span :class="{red: countExpired > 0}">({{countExpired}})</span></menu-item>
|
||||
<menu-item href="/servers/components/ssl?type=7days" :active="type == '7days'">7天内过期<span :class="{red: count7Days > 0}">({{count7Days}})</span></menu-item>
|
||||
<menu-item href="/servers/components/ssl?type=30days" :active="type == '30days'">30天过期({{count30Days}})</menu-item>
|
||||
<span class="item">|</span>
|
||||
<a href="" class="item" @click.prevent="uploadCert">[上传证书]</a>
|
||||
</second-menu>
|
||||
|
||||
<p class="comment" v-if="certs.length == 0">暂时还没有相关的证书。</p>
|
||||
<table class="ui table selectable celled" v-if="certs.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>证书说明</th>
|
||||
<th>顶级发行组织</th>
|
||||
<th>域名</th>
|
||||
<th>生效日期</th>
|
||||
<th>过期日期</th>
|
||||
<th class="center">引用服务</th>
|
||||
<th class="center">状态</th>
|
||||
<th class="three 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 basic">{{dnsName}}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{certInfos[index].beginDay}}</td>
|
||||
<td>{{certInfos[index].endDay}}</td>
|
||||
<td class="center">{{certInfos[index].countServers}}</td>
|
||||
<td nowrap="" class="center">
|
||||
<span class="ui label red tiny basic" v-if="!certInfos[index].isOn">未启用</span>
|
||||
<span class="ui label red tiny basic" v-else-if="certInfos[index].isExpired">已过期</span>
|
||||
<span class="ui label green tiny basic" v-else>有效中</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="viewCert(cert.id)">详情</a>
|
||||
<a href="" @click.prevent="updateCert(cert.id)">修改</a>
|
||||
<a href="" @click.prevent="deleteCert(cert.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page" v-html="page"></div>
|
||||
</div>
|
||||
@@ -1,45 +0,0 @@
|
||||
Tea.context(function () {
|
||||
// 上传证书
|
||||
this.uploadCert = function () {
|
||||
teaweb.popup("/servers/components/ssl/uploadPopup", {
|
||||
height: "28em",
|
||||
callback: function () {
|
||||
teaweb.success("上传成功", function () {
|
||||
window.location.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除证书
|
||||
this.deleteCert = function (certId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除此证书吗?", function () {
|
||||
that.$post("/servers/components/ssl/delete")
|
||||
.params({
|
||||
certId: certId
|
||||
})
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
// 查看证书
|
||||
this.viewCert = function (certId) {
|
||||
teaweb.popup("/servers/components/ssl/certPopup?certId=" + certId, {
|
||||
height: "28em",
|
||||
width: "48em"
|
||||
})
|
||||
}
|
||||
|
||||
// 修改证书
|
||||
this.updateCert = function (certId) {
|
||||
teaweb.popup("/servers/components/ssl/updatePopup?certId=" + certId, {
|
||||
height: "28em",
|
||||
callback: function () {
|
||||
teaweb.success("上传成功", function () {
|
||||
window.location.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,43 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>选择证书</h3>
|
||||
<p class="comment" v-if="certs.length == 0">暂时还没有相关的证书。</p>
|
||||
<table class="ui table selectable celled" v-if="certs.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>证书说明</th>
|
||||
<th v-if="viewSize == 'normal'">顶级发行组织</th>
|
||||
<th>域名</th>
|
||||
<th>过期日期</th>
|
||||
<th v-if="viewSize == 'normal'">引用服务</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 v-if="viewSize == 'normal'">
|
||||
<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 v-if="viewSize == 'normal'">{{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>
|
||||
@@ -1,14 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.selectCert = function (cert) {
|
||||
NotifyPopup({
|
||||
code: 200,
|
||||
data: {
|
||||
cert: cert,
|
||||
certRef: {
|
||||
isOn: true,
|
||||
certId: cert.id
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,60 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改证书</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="certId" :value="certConfig.id"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">证书说明 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" v-model="certConfig.name"/>
|
||||
<p class="comment">可以简单说明证书的用途。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>证书类型</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="isCA" v-model="isCA">
|
||||
<option value="0">加密证书</option>
|
||||
<option value="1">CA证书</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>选择证书文件</td>
|
||||
<td>
|
||||
<input type="file" name="certFile" accept="application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert"/>
|
||||
<p class="comment">内容中通常含有"-----BEGIN CERTIFICATE-----"类似的信息。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="isCA == 0">
|
||||
<td>选择私钥文件</td>
|
||||
<td>
|
||||
<input type="file" name="keyFile" accept="application/pkcs8"/>
|
||||
<p class="comment">内容中通常含有"-----BEGIN RSA PRIVATE KEY-----"类似的信息。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>详细说明</td>
|
||||
<td>
|
||||
<textarea rows="3" name="description" maxlength="200" v-model="certConfig.description"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否启用</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isOn" value="1" v-model="certConfig.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -1,4 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
this.isCA = this.certConfig.isCA ? 1 : 0
|
||||
})
|
||||
@@ -1,59 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>上传证书</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">证书说明 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus"/>
|
||||
<p class="comment">可以简单说明证书的用途。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>证书类型</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="isCA" v-model="isCA">
|
||||
<option value="0">加密证书</option>
|
||||
<option value="1">CA证书</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>选择证书文件 *</td>
|
||||
<td>
|
||||
<input type="file" name="certFile" accept="application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert"/>
|
||||
<p class="comment">内容中通常含有"-----BEGIN CERTIFICATE-----"类似的信息。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="isCA == 0">
|
||||
<td>选择私钥文件 *</td>
|
||||
<td>
|
||||
<input type="file" name="keyFile" accept="application/pkcs8"/>
|
||||
<p class="comment">内容中通常含有"-----BEGIN RSA PRIVATE KEY-----"类似的信息。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>详细说明</td>
|
||||
<td>
|
||||
<textarea rows="3" name="description" maxlength="200"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否启用</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isOn" value="1" checked="checked"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -1,4 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
this.isCA = 0
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
Reference in New Issue
Block a user