From d72512300257ae2714d84a595ffa62eed52822b3 Mon Sep 17 00:00:00 2001 From: K-hermes Date: Sat, 15 Aug 2026 12:32:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20Web=20=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2=20UI/UX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 改进: - 替换所有原生弹框(alert/prompt/confirm)为自定义 Modal - 删除操作不再需要二次密码验证,改为确认弹框 - 查看数据使用自定义 Modal,JSON 语法高亮显示 - 添加 Toast 通知替代 alert - JSON 数据完整展示,支持复制 - 点击遮罩层关闭 Modal - 更好的用户体验和视觉效果 --- web/index.html | 335 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 317 insertions(+), 18 deletions(-) diff --git a/web/index.html b/web/index.html index af680c2..fec3cb1 100644 --- a/web/index.html +++ b/web/index.html @@ -160,6 +160,15 @@ background: #c82333; } + .btn-secondary { + background: #6c757d; + color: white; + } + + .btn-secondary:hover { + background: #5a6268; + } + .loading { text-align: center; padding: 40px; @@ -193,6 +202,162 @@ box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6); } + /* Modal 样式 */ + .modal-overlay { + display: none; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.6); + z-index: 1000; + align-items: center; + justify-content: center; + } + + .modal-overlay.active { + display: flex; + } + + .modal { + background: white; + border-radius: 12px; + box-shadow: 0 8px 32px rgba(0,0,0,0.3); + max-width: 90%; + max-height: 90vh; + overflow: hidden; + display: flex; + flex-direction: column; + } + + .modal-header { + padding: 20px 30px; + border-bottom: 1px solid #eee; + display: flex; + justify-content: space-between; + align-items: center; + } + + .modal-title { + font-size: 20px; + font-weight: bold; + color: #333; + } + + .modal-close { + background: none; + border: none; + font-size: 28px; + color: #999; + cursor: pointer; + line-height: 1; + padding: 0; + width: 30px; + height: 30px; + } + + .modal-close:hover { + color: #333; + } + + .modal-body { + padding: 30px; + overflow-y: auto; + flex: 1; + } + + .modal-footer { + padding: 20px 30px; + border-top: 1px solid #eee; + display: flex; + justify-content: flex-end; + gap: 10px; + } + + /* JSON 展示样式 */ + .json-viewer { + background: #f8f9fa; + border-radius: 8px; + padding: 20px; + font-family: 'Courier New', monospace; + font-size: 13px; + line-height: 1.6; + overflow-x: auto; + max-height: 60vh; + } + + .json-key { + color: #0066cc; + font-weight: bold; + } + + .json-string { + color: #22863a; + } + + .json-number { + color: #005cc5; + } + + .json-boolean { + color: #d73a49; + } + + .json-null { + color: #6f42c1; + } + + /* Toast 通知 */ + .toast { + position: fixed; + top: 20px; + right: 20px; + background: white; + padding: 15px 20px; + border-radius: 8px; + box-shadow: 0 4px 20px rgba(0,0,0,0.2); + z-index: 2000; + display: flex; + align-items: center; + gap: 10px; + min-width: 250px; + transform: translateX(400px); + transition: transform 0.3s; + } + + .toast.show { + transform: translateX(0); + } + + .toast-success { + border-left: 4px solid #28a745; + } + + .toast-error { + border-left: 4px solid #dc3545; + } + + .toast-icon { + font-size: 20px; + } + + .toast-message { + flex: 1; + color: #333; + } + + /* 确认对话框 */ + .confirm-modal .modal { + max-width: 450px; + } + + .confirm-message { + font-size: 16px; + color: #333; + line-height: 1.6; + } + .api-docs { background: white; border-radius: 12px; @@ -292,7 +457,100 @@ + + + + + +