Update static/templates/api-test.html
Browse files
static/templates/api-test.html
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<div class="api-test-page">
|
| 2 |
<div class="api-tester">
|
| 3 |
-
<h2
|
| 4 |
-
<p
|
| 5 |
|
| 6 |
<div class="form-group">
|
| 7 |
<label for="apiEndpoint">📡 选择 API 端点</label>
|
|
@@ -14,15 +37,13 @@
|
|
| 14 |
</select>
|
| 15 |
</div>
|
| 16 |
|
| 17 |
-
<button id="testBtn" class="btn btn-primary"
|
| 18 |
🚀 发送请求
|
| 19 |
</button>
|
| 20 |
|
| 21 |
-
<div class="response-container"
|
| 22 |
-
<h3
|
| 23 |
-
|
| 24 |
-
</h3>
|
| 25 |
-
<pre id="apiResponse" style="background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 12px; overflow-x: auto; font-family: 'Courier New', monospace; font-size: 0.9em; line-height: 1.6; max-height: 500px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);">⏳ 等待发送请求...
|
| 26 |
|
| 27 |
💡 提示:选择一个 API 端点后点击"发送请求"按钮</pre>
|
| 28 |
</div>
|
|
|
|
| 1 |
+
<style>
|
| 2 |
+
.api-test-page{padding:14px;background:linear-gradient(180deg,#eef2ff 0%,#f1f5f9 240px);min-height:calc(100vh - 80px);font-feature-settings:"tnum"}
|
| 3 |
+
.api-test-page .api-tester{background:#fff;padding:24px 26px;border-radius:14px;box-shadow:0 4px 14px rgba(15,23,42,.06),0 1px 4px rgba(15,23,42,.04);border:1px solid #f1f5f9;max-width:1100px;margin:0 auto}
|
| 4 |
+
.api-test-page .api-tester h2{margin:0 0 6px!important;font-size:18px!important;font-weight:700!important;color:#1e293b!important;letter-spacing:.2px}
|
| 5 |
+
.api-test-page .api-tester>p{margin:0 0 22px!important;color:#64748b!important;font-size:13px!important}
|
| 6 |
+
.api-test-page .form-group{margin-bottom:18px}
|
| 7 |
+
.api-test-page .form-group label{display:block;font-size:13px;font-weight:600;color:#475569;margin-bottom:6px;letter-spacing:.2px}
|
| 8 |
+
.api-test-page .form-control{width:100%;padding:10px 12px;border:1px solid #cbd5e1;border-radius:8px;font-size:13px;outline:none;transition:all .15s;background:#fff;color:#1e293b;font-family:ui-monospace,SFMono-Regular,Consolas,Menlo,monospace}
|
| 9 |
+
.api-test-page .form-control:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.15)}
|
| 10 |
+
.api-test-page .btn{border:none;border-radius:8px;font-weight:600;cursor:pointer;transition:all .15s;color:#fff;box-shadow:0 1px 3px rgba(15,23,42,.08);font-size:13px}
|
| 11 |
+
.api-test-page .btn:hover:not(:disabled){transform:translateY(-1px);filter:brightness(1.05);box-shadow:0 6px 16px rgba(99,102,241,.32)}
|
| 12 |
+
.api-test-page .btn:active:not(:disabled){transform:translateY(0)}
|
| 13 |
+
.api-test-page .btn:disabled{opacity:.6;cursor:not-allowed;box-shadow:none}
|
| 14 |
+
.api-test-page #testBtn{background:linear-gradient(135deg,#6366f1,#8b5cf6);width:100%;padding:13px 18px!important;font-size:14px!important;font-weight:700;letter-spacing:.3px;display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:4px}
|
| 15 |
+
.api-test-page .response-container{margin-top:26px}
|
| 16 |
+
.api-test-page .response-container h3{margin:0 0 10px!important;font-size:11px!important;color:#94a3b8!important;font-weight:700!important;letter-spacing:.6px;text-transform:uppercase;display:flex;align-items:center;gap:6px}
|
| 17 |
+
.api-test-page #apiResponse{background:#0f172a!important;color:#e2e8f0!important;padding:18px 20px!important;border-radius:12px!important;overflow:auto!important;font-family:ui-monospace,SFMono-Regular,Consolas,Menlo,monospace!important;font-size:12px!important;line-height:1.65!important;max-height:540px!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 4px 14px rgba(15,23,42,.16)!important;border:1px solid #1e293b!important;margin:0!important;white-space:pre;tab-size:2}
|
| 18 |
+
.api-test-page #apiResponse::-webkit-scrollbar{width:10px;height:10px}
|
| 19 |
+
.api-test-page #apiResponse::-webkit-scrollbar-thumb{background:#334155;border-radius:5px;border:2px solid #0f172a;background-clip:padding-box}
|
| 20 |
+
.api-test-page #apiResponse::-webkit-scrollbar-thumb:hover{background:#475569;background-clip:padding-box}
|
| 21 |
+
.api-test-page .loading-spinner-large{border:3px solid rgba(255,255,255,.3)!important;border-top-color:#fff!important;border-radius:50%!important;animation:apiSpin 0.7s linear infinite}
|
| 22 |
+
@keyframes apiSpin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
|
| 23 |
+
</style>
|
| 24 |
<div class="api-test-page">
|
| 25 |
<div class="api-tester">
|
| 26 |
+
<h2>🔧 API 接口测试工具</h2>
|
| 27 |
+
<p>测试后端 API 接口的响应速度和数据返回</p>
|
| 28 |
|
| 29 |
<div class="form-group">
|
| 30 |
<label for="apiEndpoint">📡 选择 API 端点</label>
|
|
|
|
| 37 |
</select>
|
| 38 |
</div>
|
| 39 |
|
| 40 |
+
<button id="testBtn" class="btn btn-primary">
|
| 41 |
🚀 发送请求
|
| 42 |
</button>
|
| 43 |
|
| 44 |
+
<div class="response-container">
|
| 45 |
+
<h3>📊 响应结果</h3>
|
| 46 |
+
<pre id="apiResponse">⏳ 等待发送请求...
|
|
|
|
|
|
|
| 47 |
|
| 48 |
💡 提示:选择一个 API 端点后点击"发送请求"按钮</pre>
|
| 49 |
</div>
|