mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-07-06 23:01:42 +08:00
feat(mail): 多邮箱服务支持:将「自定义域名(REST API)」展开为两种子类型说明——MoeMail 和 TempMail
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 自定义域名管理 -->
|
||||
<!-- 自定义域名管理(含 MoeMail / TempMail) -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>🔗 自定义域名服务</h3>
|
||||
@@ -105,7 +105,8 @@
|
||||
<tr>
|
||||
<th style="width: 40px;"><input type="checkbox" id="select-all-custom"></th>
|
||||
<th>名称</th>
|
||||
<th style="width: 200px;">API 地址</th>
|
||||
<th style="width: 90px;">类型</th>
|
||||
<th style="width: 200px;">地址</th>
|
||||
<th style="width: 100px;">状态</th>
|
||||
<th style="width: 80px;">优先级</th>
|
||||
<th style="width: 160px;">最后使用</th>
|
||||
@@ -114,41 +115,7 @@
|
||||
</thead>
|
||||
<tbody id="custom-services-table">
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<div class="empty-state">
|
||||
<div class="skeleton skeleton-text"></div>
|
||||
<div class="skeleton skeleton-text" style="width: 80%;"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Temp-Mail 服务管理 -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>📮 Temp-Mail 服务(自部署)</h3>
|
||||
<button class="btn btn-primary btn-sm" id="add-tempmail-btn">➕ 添加服务</button>
|
||||
</div>
|
||||
<div class="card-body" style="padding: 0;">
|
||||
<div class="table-container">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th style="width: 200px;">Worker 地址</th>
|
||||
<th style="width: 120px;">邮箱域名</th>
|
||||
<th style="width: 100px;">状态</th>
|
||||
<th style="width: 80px;">优先级</th>
|
||||
<th style="width: 160px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tempmail-services-table">
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<td colspan="8">
|
||||
<div class="empty-state">
|
||||
<div class="skeleton skeleton-text"></div>
|
||||
<div class="skeleton skeleton-text" style="width: 80%;"></div>
|
||||
@@ -223,7 +190,7 @@
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- 添加自定义域名模态框 -->
|
||||
<!-- 添加自定义域名服务模态框(含类型选择) -->
|
||||
<div class="modal" id="add-custom-modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -237,16 +204,41 @@
|
||||
<input type="text" id="custom-name" name="name" required placeholder="例如:我的域名邮箱">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-api-url">API 地址</label>
|
||||
<input type="text" id="custom-api-url" name="api_url" required placeholder="https://api.example.com">
|
||||
<label for="custom-sub-type">服务类型</label>
|
||||
<select id="custom-sub-type" name="sub_type">
|
||||
<option value="moemail">MoeMail(自定义域名 API)</option>
|
||||
<option value="tempmail">TempMail(自部署 Cloudflare Worker)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-api-key">API 密钥 (可选)</label>
|
||||
<input type="text" id="custom-api-key" name="api_key" placeholder="API Key">
|
||||
<!-- MoeMail 字段 -->
|
||||
<div id="add-moemail-fields">
|
||||
<div class="form-group">
|
||||
<label for="custom-api-url">API 地址</label>
|
||||
<input type="text" id="custom-api-url" name="api_url" placeholder="https://api.example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-api-key">API 密钥 (可选)</label>
|
||||
<input type="text" id="custom-api-key" name="api_key" placeholder="API Key">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-domain">邮箱域名</label>
|
||||
<input type="text" id="custom-domain" name="domain" placeholder="example.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-domain">邮箱域名</label>
|
||||
<input type="text" id="custom-domain" name="domain" placeholder="example.com">
|
||||
<!-- TempMail 字段 -->
|
||||
<div id="add-tempmail-fields" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="custom-tm-base-url">Worker 地址</label>
|
||||
<input type="text" id="custom-tm-base-url" name="tm_base_url" placeholder="https://mail.example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-tm-admin-password">Admin 密码</label>
|
||||
<input type="password" id="custom-tm-admin-password" name="tm_admin_password" placeholder="x-admin-auth 密码">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom-tm-domain">邮箱域名</label>
|
||||
<input type="text" id="custom-tm-domain" name="tm_domain" placeholder="example.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
@@ -269,7 +261,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 编辑自定义域名模态框 -->
|
||||
|
||||
<!-- 编辑自定义域名服务模态框(含类型选择) -->
|
||||
<div class="modal" id="edit-custom-modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -279,22 +272,46 @@
|
||||
<div class="modal-body">
|
||||
<form id="edit-custom-form">
|
||||
<input type="hidden" id="edit-custom-id" name="id">
|
||||
<input type="hidden" id="edit-custom-sub-type-hidden" name="sub_type">
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-name">服务名称</label>
|
||||
<input type="text" id="edit-custom-name" name="name" required placeholder="例如:我的域名邮箱">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-api-url">API 地址</label>
|
||||
<input type="text" id="edit-custom-api-url" name="api_url" required placeholder="https://api.example.com">
|
||||
<label>服务类型</label>
|
||||
<div id="edit-custom-type-badge" style="padding: 6px 0; color: var(--text-muted); font-size: 0.875rem;"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-api-key">API 密钥</label>
|
||||
<input type="text" id="edit-custom-api-key" name="api_key" placeholder="API Key">
|
||||
<small style="color: var(--text-muted);">留空则保持原值不变</small>
|
||||
<!-- MoeMail 字段 -->
|
||||
<div id="edit-moemail-fields">
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-api-url">API 地址</label>
|
||||
<input type="text" id="edit-custom-api-url" name="api_url" placeholder="https://api.example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-api-key">API 密钥</label>
|
||||
<input type="text" id="edit-custom-api-key" name="api_key" placeholder="API Key">
|
||||
<small style="color: var(--text-muted);">留空则保持原值不变</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-domain">邮箱域名</label>
|
||||
<input type="text" id="edit-custom-domain" name="domain" placeholder="example.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-custom-domain">邮箱域名</label>
|
||||
<input type="text" id="edit-custom-domain" name="domain" placeholder="example.com">
|
||||
<!-- TempMail 字段 -->
|
||||
<div id="edit-tempmail-fields" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-base-url">Worker 地址</label>
|
||||
<input type="text" id="edit-tm-base-url" name="tm_base_url" placeholder="https://mail.example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-admin-password">Admin 密码</label>
|
||||
<input type="password" id="edit-tm-admin-password" name="tm_admin_password" placeholder="留空则不修改">
|
||||
<small style="color: var(--text-muted);">留空则保持原值不变</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-domain">邮箱域名</label>
|
||||
<input type="text" id="edit-tm-domain" name="tm_domain" placeholder="example.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
@@ -366,100 +383,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 添加 Temp-Mail 服务模态框 -->
|
||||
<div class="modal" id="add-tempmail-modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3>➕ 添加 Temp-Mail 服务</h3>
|
||||
<button class="modal-close" id="close-add-tempmail-modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="add-tempmail-form">
|
||||
<div class="form-group">
|
||||
<label for="tm-name">服务名称</label>
|
||||
<input type="text" id="tm-name" name="name" required placeholder="例如:我的临时邮箱">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tm-base-url">Worker 地址</label>
|
||||
<input type="text" id="tm-base-url" name="base_url" required placeholder="https://mail.example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tm-admin-password">Admin 密码</label>
|
||||
<input type="password" id="tm-admin-password" name="admin_password" required placeholder="x-admin-auth 密码">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tm-domain">邮箱域名</label>
|
||||
<input type="text" id="tm-domain" name="domain" required placeholder="example.com">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="tm-priority">优先级</label>
|
||||
<input type="number" id="tm-priority" name="priority" value="0" min="0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" id="tm-enabled" name="enabled" checked>
|
||||
启用服务
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">添加</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancel-add-tempmail">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 编辑 Temp-Mail 服务模态框 -->
|
||||
<div class="modal" id="edit-tempmail-modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3>✏️ 编辑 Temp-Mail 服务</h3>
|
||||
<button class="modal-close" id="close-edit-tempmail-modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="edit-tempmail-form">
|
||||
<input type="hidden" id="edit-tm-id">
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-name">服务名称</label>
|
||||
<input type="text" id="edit-tm-name" name="name" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-base-url">Worker 地址</label>
|
||||
<input type="text" id="edit-tm-base-url" name="base_url" required placeholder="https://mail.example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-admin-password">Admin 密码(留空保持不变)</label>
|
||||
<input type="password" id="edit-tm-admin-password" name="admin_password" placeholder="留空则不修改">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-domain">邮箱域名</label>
|
||||
<input type="text" id="edit-tm-domain" name="domain" required placeholder="example.com">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="edit-tm-priority">优先级</label>
|
||||
<input type="number" id="edit-tm-priority" name="priority" value="0" min="0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" id="edit-tm-enabled" name="enabled">
|
||||
启用服务
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancel-edit-tempmail">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/utils.js"></script>
|
||||
<script src="/static/js/utils.js"></script>
|
||||
<script src="/static/js/email_services.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user