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,42 @@
{$layout "layout_popup"}
<h3>添加账号</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td>账号名称 *</td>
<td>
<input type="text" name="name" maxlength="50" ref="focus" tabindex="1"/>
<p class="comment">为当前账号起一个容易识别的名称。</p>
</td>
</tr>
<tr>
<td class="title">证书服务商 *</td>
<td>
<select class="ui dropdown auto-width" name="providerCode" v-model="providerCode" @change="changeProvider" tabindex="2">
<option value="">[选择服务商]</option>
<option v-for="provider in providers" :value="provider.code">{{provider.name}}</option>
</select>
<p class="comment" v-if="selectedProvider != null" v-html="selectedProvider.description"></p>
</td>
</tr>
<tbody v-show="selectedProvider != null && selectedProvider.requireEAB">
<tr>
<td>EAB Kid *</td>
<td>
<input type="text" name="eabKid" maxlength="100" tabindex="3"/>
<p class="comment" v-if="selectedProvider != null" v-html="selectedProvider.eabDescription"></p>
</td>
</tr>
<tr>
<td>EAB HMAC Key *</td>
<td>
<input type="text" name="eabKey" maxlength="300" tabindex="4"/>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,16 @@
Tea.context(function () {
this.selectedProvider = null
this.changeProvider = function () {
if (this.providerCode.length == 0) {
this.selectedProvider = null
return
}
let that = this
this.selectedProvider = this.providers.$find(function (k, v) {
return v.code == that.providerCode
})
}
this.changeProvider()
})

View File

@@ -0,0 +1,46 @@
{$layout}
{$template "/left_menu_top"}
<div class="right-box without-tabbar">
{$template "../menu"}
<second-menu>
<menu-item @click.prevent="createAccount">[创建账号]</menu-item>
</second-menu>
<p class="comment" v-if="accounts.length == 0">暂时还没有服务商账号。</p>
<table class="ui table selectable celled" v-if="accounts.length > 0">
<thead>
<tr>
<th>名称</th>
<th>证书服务商</th>
<th class="four wide">EAB Kid</th>
<th class="four wide">EBA HMAC Key</th>
<th class="two wide">操作</th>
</tr>
</thead>
<tr v-for="account in accounts">
<td>
<a href="" @click.prevent="updateAccount(account.id)">{{account.name}} <i class="icon expand small"></i></a>
</td>
<td>
<span v-if="account.provider != null">{{account.provider.name}}</span>
</td>
<td>
<span v-if="account.eabKid.length > 0">{{account.eabKid}}</span>
<span v-else class="disabled">-</span>
</td>
<td>
<span v-if="account.eabKey.length > 0">{{account.eabKey}}</span>
<span v-else class="disabled">-</span>
</td>
<td>
<a href="" @click.prevent="updateAccount(account.id)">修改</a> &nbsp;
<a href="" @click.prevent="deleteAccount(account.id)">删除</a>
</td>
</tr>
</table>
<div class="page" v-html="page"></div>
</div>

View File

@@ -0,0 +1,33 @@
Tea.context(function () {
this.createAccount = function () {
teaweb.popup(".createPopup", {
height: "24em",
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
})
}
this.updateAccount = function (accountId) {
teaweb.popup(".updatePopup?accountId=" + accountId, {
height: "24em",
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
})
}
this.deleteAccount = function (accountId) {
teaweb.confirm("确定要删除此账号吗?", function () {
this.$post(".delete")
.params({
accountId: accountId
})
.refresh()
})
}
})

View File

@@ -0,0 +1,41 @@
{$layout "layout_popup"}
<h3>修改账号</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="accountId" :value="account.id"/>
<input type="hidden" name="providerCode" :value="account.providerCode"/>
<table class="ui table definition selectable">
<tr>
<td>账号名称 *</td>
<td>
<input type="text" name="name" maxlength="50" ref="focus" v-model="account.name" tabindex="1"/>
</td>
</tr>
<tr>
<td class="title">证书服务商 *</td>
<td>
<span v-if="account.provider != null">{{account.provider.name}}</span>
<span v-else class="disabled">服务商已失效</span>
<p class="comment" v-if="account.provider != null" v-html="account.provider.description"></p>
</td>
</tr>
<tbody v-show="account.provider != null && account.provider.requireEAB">
<tr>
<td>EAB Kid *</td>
<td>
<input type="text" name="eabKid" maxlength="100" v-model="account.eabKid" tabindex="3"/>
<p class="comment" v-if="account.provider != null" v-html="account.provider.eabDescription"></p>
</td>
</tr>
<tr>
<td>EAB HMAC Key *</td>
<td>
<input type="text" name="eabKey" maxlength="300" v-model="account.eabKey" tabindex="4"/>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
})