This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
{$layout}
{$var "header"}
<script src="/servers/certs/datajs" type="text/javascript"></script>
<script src="/js/sortable.min.js" type="text/javascript"></script>
{$end}
{$template "../settings_menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
<p class="comment">提醒HTTP/2、证书等信息修改后可能需要清空浏览器缓存后才能浏览效果。</p>
<div v-if="httpsConfig.isOn && (missingCertServerNames || []).length > 0" class="ui message warning">
警告当前网站绑定的以下域名尚未配置证书将无法通过HTTPS协议访问{{missingCertServerNames.join("、")}} 。
</div>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="serverId" :value="serverId"/>
<input type="hidden" name="serverType" :value="serverType"/>
<table class="ui table selectable definition">
<tr>
<td class="title">启用HTTPS</td>
<td>
<div class="ui checkbox">
<input type="checkbox" name="isOn" value="1" v-model="httpsConfig.isOn"/>
<label></label>
</div>
</td>
</tr>
</table>
<!-- SSL配置 -->
<ssl-config-box :v-ssl-policy="httpsConfig.sslPolicy" :v-protocol="'https'" v-show="httpsConfig.isOn" :v-server-id="serverId" :v-support-http3="httpsConfig.supportsHTTP3 && http3FeatureEnabled"></ssl-config-box>
<submit-btn></submit-btn>
</form>
</div>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
})

View File

@@ -0,0 +1,43 @@
{$layout "layout_popup"}
<h3>申请免费证书</h3>
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$" data-tea-timeout="300" data-tea-before="beforeSubmit" data-tea-fail="fail">
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td class="title">证书包含的域名 *</td>
<td>
<span v-if="serverNames.length == 0" class="disabled">还没有需要申请证书的域名,暂时不能申请。</span>
<div v-if="serverNames.length > 0">
<div v-for="(serverName, index) in serverNames" class="ui tiny basic label">
<input type="hidden" name="serverNames" :value="serverName"/>
{{serverName}}
<a href="" title="删除" @click.prevent="remove(index)"><i class="icon remove"></i></a>
</div>
</div>
</td>
</tr>
<tr>
<td>证书用户 *</td>
<td>
<div v-if="users.length > 0">
<select class="ui dropdown auto-width" name="userId" v-model="userId">
<option value="0">[请选择]</option>
<option v-for="user in users" :value="user.id">{{user.email}}{{user.description}}</option>>
</select>
<p class="comment">用来申请证书的用户。</p>
</div>
<div v-if="users.length == 0">
<input type="text" name="userEmail" maxlength="100" placeholder="用户E-mail" ref="focus"/>
<p class="comment">用来申请证书的用户邮箱,可以任意填写,只要格式正确即可。</p>
</div>
</td>
</tr>
</table>
<submit-btn v-if="!isRequesting">提交</submit-btn>
<button class="ui button" type="button" v-if="isRequesting">处理中...</button>
</form>

View File

@@ -0,0 +1,25 @@
Tea.context(function () {
this.isRequesting = false
this.userId = 0
this.remove = function (index) {
this.serverNames.$remove(index)
}
this.beforeSubmit = function () {
this.isRequesting = true
}
this.fail = function (resp) {
this.isRequesting = false
teaweb.warn(resp.message)
if (resp.data.acmeUser != null) {
this.users.push({
id: resp.data.acmeUser.id,
email: resp.data.acmeUser.email,
description: ""
})
this.userId = resp.data.acmeUser.id
}
}
})