143 lines
6.0 KiB
HTML
143 lines
6.0 KiB
HTML
<!DOCTYPE html>
|
|||
|
|
<html lang="zh-CN">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>MessageHub 通道管理</title>
|
||
|
|
<link rel="stylesheet" href="./styles.css">
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="page-shell">
|
||
|
|
<header class="hero">
|
||
|
|
<div>
|
||
|
|
<p class="eyebrow">MessageHub Admin</p>
|
||
|
|
<h1>短信 / 邮件通道管理</h1>
|
||
|
|
<p class="subtitle">在这里维护数据库通道配置、执行健康检查,并直接发送测试消息。</p>
|
||
|
|
</div>
|
||
|
|
<div class="hero-actions">
|
||
|
|
<button id="refreshButton" class="ghost-button">刷新列表</button>
|
||
|
|
<button id="createButton" class="primary-button">新增通道</button>
|
||
|
|
</div>
|
||
|
|
</header>
|
||
|
|
|
||
|
|
<main class="content-grid">
|
||
|
|
<section class="panel">
|
||
|
|
<div class="panel-header">
|
||
|
|
<div>
|
||
|
|
<h2>通道列表</h2>
|
||
|
|
<p>支持启停、默认通道切换与单通道健康检查。</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div id="channelEmptyState" class="empty-state" hidden>暂无通道数据。</div>
|
||
|
|
<div class="table-wrap">
|
||
|
|
<table>
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>名称</th>
|
||
|
|
<th>类型</th>
|
||
|
|
<th>提供方</th>
|
||
|
|
<th>状态</th>
|
||
|
|
<th>健康检查</th>
|
||
|
|
<th>最近检测</th>
|
||
|
|
<th>操作</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody id="channelTableBody"></tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
</section>
|
||
|
|
|
||
|
|
<aside class="side-stack">
|
||
|
|
<section class="panel">
|
||
|
|
<div class="panel-header">
|
||
|
|
<div>
|
||
|
|
<h2 id="formTitle">新增通道</h2>
|
||
|
|
<p id="formSubtitle">保存后即可加入发送主链路。</p>
|
||
|
|
</div>
|
||
|
|
<button id="resetButton" class="ghost-button small">重置</button>
|
||
|
|
</div>
|
||
|
|
<form id="channelForm" class="form-grid">
|
||
|
|
<input type="hidden" id="channelId">
|
||
|
|
<label>
|
||
|
|
<span>通道类型</span>
|
||
|
|
<select id="channelType" required>
|
||
|
|
<option value="SMS">短信</option>
|
||
|
|
<option value="EMAIL">邮件</option>
|
||
|
|
</select>
|
||
|
|
</label>
|
||
|
|
<label>
|
||
|
|
<span>提供方</span>
|
||
|
|
<select id="providerCode" required></select>
|
||
|
|
</label>
|
||
|
|
<label>
|
||
|
|
<span>通道名称</span>
|
||
|
|
<input id="channelName" type="text" maxlength="100" required placeholder="例如:生产短信主通道">
|
||
|
|
</label>
|
||
|
|
<label>
|
||
|
|
<span>备注</span>
|
||
|
|
<input id="remark" type="text" maxlength="255" placeholder="可选">
|
||
|
|
</label>
|
||
|
|
<div class="inline-checks">
|
||
|
|
<label class="checkbox">
|
||
|
|
<input id="enabled" type="checkbox" checked>
|
||
|
|
<span>启用</span>
|
||
|
|
</label>
|
||
|
|
<label class="checkbox">
|
||
|
|
<input id="isDefault" type="checkbox">
|
||
|
|
<span>设为默认</span>
|
||
|
|
</label>
|
||
|
|
</div>
|
||
|
|
<div id="dynamicFields" class="dynamic-fields"></div>
|
||
|
|
<div class="form-actions">
|
||
|
|
<button type="submit" class="primary-button">保存通道</button>
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</section>
|
||
|
|
|
||
|
|
<section class="panel">
|
||
|
|
<div class="panel-header">
|
||
|
|
<div>
|
||
|
|
<h2>测试发送</h2>
|
||
|
|
<p>支持按通道直接发测试短信或测试邮件。</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<form id="testForm" class="form-grid">
|
||
|
|
<label>
|
||
|
|
<span>选择通道</span>
|
||
|
|
<select id="testChannelId" required></select>
|
||
|
|
</label>
|
||
|
|
<label>
|
||
|
|
<span>接收目标</span>
|
||
|
|
<input id="testReceiver" type="text" required placeholder="手机号或邮箱">
|
||
|
|
</label>
|
||
|
|
<label class="test-only-email">
|
||
|
|
<span>邮件主题</span>
|
||
|
|
<input id="testSubject" type="text" placeholder="留空则使用默认主题">
|
||
|
|
</label>
|
||
|
|
<label class="test-only-sms">
|
||
|
|
<span>模板编码</span>
|
||
|
|
<input id="testTemplateCode" type="text" placeholder="Spug 短信测试时必填">
|
||
|
|
</label>
|
||
|
|
<label class="full-width">
|
||
|
|
<span>消息内容 / 说明</span>
|
||
|
|
<textarea id="testContent" rows="4" placeholder="短信 mock 会直接记录这里的内容;邮件会作为正文"></textarea>
|
||
|
|
</label>
|
||
|
|
<label class="full-width test-only-sms">
|
||
|
|
<span>模板参数 JSON</span>
|
||
|
|
<textarea id="testTemplateParams" rows="4" placeholder='例如:{"code":"123456","minutes":"5"}'></textarea>
|
||
|
|
</label>
|
||
|
|
<div class="form-actions">
|
||
|
|
<button type="submit" class="primary-button">发送测试消息</button>
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</section>
|
||
|
|
</aside>
|
||
|
|
</main>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="toast" class="toast" hidden></div>
|
||
|
|
|
||
|
|
<script src="./app.js"></script>
|
||
|
|
</body>
|
||
|
|
</html>
|