index.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <!doctype html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>MailHub</title>
  7. <link rel="stylesheet" href="/styles.css">
  8. </head>
  9. <body>
  10. <main class="app-shell">
  11. <header class="topbar">
  12. <div>
  13. <h1>MailHub</h1>
  14. <p id="runtimeLine">加载中</p>
  15. </div>
  16. <div class="topbar-actions">
  17. <button class="icon-button" id="refreshButton" title="刷新">刷新</button>
  18. <button class="icon-button" id="logoutButton" title="退出登录">退出</button>
  19. </div>
  20. </header>
  21. <section class="notice hidden" id="securityNotice"></section>
  22. <div class="workspace">
  23. <aside class="sidebar">
  24. <section class="panel">
  25. <div class="section-head">
  26. <h2>账号</h2>
  27. <span class="badge idle" id="userRole">加载中</span>
  28. </div>
  29. <div class="live-list" id="accountBox"></div>
  30. </section>
  31. <form class="panel compact-form" id="addDomainForm">
  32. <h2>添加发信域名</h2>
  33. <label>
  34. 域名
  35. <input name="domain" placeholder="example.com" autocomplete="off" required>
  36. </label>
  37. <label>
  38. DNS API
  39. <select name="dnsCredentialId" id="domainDnsCredential"></select>
  40. </label>
  41. <div class="form-grid">
  42. <label>
  43. DKIM selector
  44. <input name="selector" placeholder="mh202607">
  45. </label>
  46. <label>
  47. DMARC 策略
  48. <select name="dmarcPolicy">
  49. <option value="none">none</option>
  50. <option value="quarantine">quarantine</option>
  51. <option value="reject">reject</option>
  52. </select>
  53. </label>
  54. </div>
  55. <label>
  56. 发信主机
  57. <input name="senderHost" id="defaultSenderHost" autocomplete="off">
  58. </label>
  59. <label>
  60. 发信 IP
  61. <input name="sendingIp" id="defaultSendingIp" autocomplete="off">
  62. </label>
  63. <label>
  64. 兼容第三方 SPF
  65. <textarea name="spfExtra" id="defaultSpfExtra" rows="2"></textarea>
  66. </label>
  67. <button class="primary-button" type="submit">添加并生成 DNS</button>
  68. </form>
  69. <form class="panel compact-form" id="smtpCredentialForm">
  70. <div class="section-head">
  71. <h2>SMTP 凭据</h2>
  72. <span class="badge idle" id="smtpCredentialState">未加载</span>
  73. </div>
  74. <label>
  75. 用户名
  76. <input name="username" id="smtpUsername" autocomplete="off" required>
  77. </label>
  78. <label>
  79. 新密码
  80. <input name="password" id="smtpPassword" type="password" autocomplete="new-password" placeholder="留空则不修改">
  81. </label>
  82. <div class="button-row">
  83. <button class="secondary-button" id="generateSmtpPassword" type="button">生成密码</button>
  84. <button class="primary-button" type="submit">保存凭据</button>
  85. </div>
  86. <div class="credential-copy" id="smtpCredentialCopy"></div>
  87. </form>
  88. <form class="panel compact-form" id="dnsCredentialForm">
  89. <div class="section-head">
  90. <h2>DNS API</h2>
  91. <span class="count" id="dnsCredentialCount">0</span>
  92. </div>
  93. <label>
  94. 名称
  95. <input name="name" placeholder="Cloudflare 主账号" required>
  96. </label>
  97. <div class="form-grid">
  98. <label>
  99. 服务商
  100. <select name="provider" required>
  101. <option value="cloudflare">Cloudflare</option>
  102. <option value="aliyun">阿里云 DNS</option>
  103. <option value="dnspod">腾讯云 DNSPod</option>
  104. </select>
  105. </label>
  106. <label>
  107. TTL
  108. <input name="defaultTtl" type="number" min="60" max="86400" value="600">
  109. </label>
  110. </div>
  111. <label>
  112. Zone / 根域名
  113. <input name="zoneName" placeholder="example.com" autocomplete="off" required>
  114. </label>
  115. <label>
  116. Cloudflare API Token
  117. <input name="apiToken" autocomplete="off">
  118. </label>
  119. <label>
  120. Cloudflare Zone ID
  121. <input name="zoneId" autocomplete="off">
  122. </label>
  123. <label>
  124. 阿里云 AccessKeyId
  125. <input name="accessKeyId" autocomplete="off">
  126. </label>
  127. <label>
  128. 阿里云 AccessKeySecret
  129. <input name="accessKeySecret" autocomplete="off">
  130. </label>
  131. <label>
  132. 腾讯云 SecretId
  133. <input name="secretId" autocomplete="off">
  134. </label>
  135. <label>
  136. 腾讯云 SecretKey
  137. <input name="secretKey" autocomplete="off">
  138. </label>
  139. <button class="primary-button" type="submit">保存 DNS 凭据</button>
  140. <div class="mini-list" id="dnsCredentialList"></div>
  141. </form>
  142. <form class="panel compact-form" id="apiTokenForm">
  143. <div class="section-head">
  144. <h2>发送 API Token</h2>
  145. <span class="count" id="apiTokenCount">0</span>
  146. </div>
  147. <label>
  148. 名称
  149. <input name="name" placeholder="Production sender" required>
  150. </label>
  151. <button class="primary-button" type="submit">生成 Token</button>
  152. <div class="mini-list" id="apiTokenList"></div>
  153. </form>
  154. <section class="panel domain-panel">
  155. <div class="section-head">
  156. <h2>域名</h2>
  157. <span class="count" id="domainCount">0</span>
  158. </div>
  159. <div class="domain-list" id="domainList"></div>
  160. </section>
  161. <section class="panel hidden" id="adminPanel"></section>
  162. </aside>
  163. <section class="main-panel" id="detailPanel">
  164. <div class="empty-state">
  165. <h2>选择或添加一个域名</h2>
  166. <p>DNS 引导、验证结果、DKIM 记录和测试发送会显示在这里。</p>
  167. </div>
  168. </section>
  169. </div>
  170. </main>
  171. <script src="/app.js" type="module"></script>
  172. </body>
  173. </html>