mock-service-cli-ultra 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="14" fill="#1e40af"/>
3
+ <path d="M14 20c0-3.3 2.7-6 6-6h11l5 6h8c3.3 0 6 2.7 6 6v8H14V20z" fill="#93c5fd"/>
4
+ <rect x="20" y="31" width="25" height="20" rx="4" fill="#f8fafc"/>
5
+ <path d="M26 31v-4a6.5 6.5 0 0 1 13 0v4" fill="none" stroke="#f8fafc" stroke-width="5" stroke-linecap="round"/>
6
+ <circle cx="32.5" cy="40" r="3" fill="#1e40af"/>
7
+ <path d="M32.5 43v3" stroke="#1e40af" stroke-width="3" stroke-linecap="round"/>
8
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="14" fill="#1d4ed8"/>
3
+ <path d="M12 22c0-3.3 2.7-6 6-6h11l5 6h12c3.3 0 6 2.7 6 6v17c0 3.3-2.7 6-6 6H18c-3.3 0-6-2.7-6-6V22z" fill="#fbbf24"/>
4
+ <path d="M12 29h40v16c0 3.3-2.7 6-6 6H18c-3.3 0-6-2.7-6-6V29z" fill="#fde68a"/>
5
+ <path d="M21 37h22" stroke="#1d4ed8" stroke-width="4" stroke-linecap="round"/>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="14" fill="#0f766e"/>
3
+ <path d="M17 19h30v26H17z" fill="none" stroke="#ccfbf1" stroke-width="4" stroke-linejoin="round"/>
4
+ <path d="M24 28h16M24 36h11" stroke="#ccfbf1" stroke-width="4" stroke-linecap="round"/>
5
+ <circle cx="47" cy="45" r="7" fill="#fbbf24"/>
6
+ </svg>
@@ -0,0 +1,60 @@
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.0" />
6
+ <title>文件浏览器登录</title>
7
+ <link rel="icon" type="image/svg+xml" href="/favicon-file-explorer-login.svg" />
8
+ <style>
9
+ * { box-sizing: border-box; }
10
+ body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #f4f6f8; color: #202124; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
11
+ main { width: min(360px, calc(100vw - 32px)); padding: 28px; background: #fff; border: 1px solid #dde1e6; border-radius: 8px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08); }
12
+ h1 { margin: 0 0 22px; font-size: 20px; }
13
+ label { display: block; margin-bottom: 8px; font-size: 14px; }
14
+ input { width: 100%; height: 38px; padding: 8px 10px; border: 1px solid #b9c1cb; border-radius: 4px; font: inherit; }
15
+ button { width: 100%; height: 38px; margin-top: 16px; border: 0; border-radius: 4px; background: #276ef1; color: #fff; cursor: pointer; font: inherit; }
16
+ button:disabled { opacity: 0.6; cursor: wait; }
17
+ #error { min-height: 20px; margin: 12px 0 0; color: #c62828; font-size: 13px; }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <main>
22
+ <h1>文件浏览器</h1>
23
+ <form id="loginForm">
24
+ <label for="password">访问密码</label>
25
+ <input id="password" type="password" autocomplete="current-password" required autofocus />
26
+ <button id="submitButton" type="submit">登录</button>
27
+ <p id="error" role="alert"></p>
28
+ </form>
29
+ </main>
30
+ <script>
31
+ const storageKey = 'mock-service-cli.file-explorer.password';
32
+ const form = document.getElementById('loginForm');
33
+ const passwordInput = document.getElementById('password');
34
+ const submitButton = document.getElementById('submitButton');
35
+ const errorElement = document.getElementById('error');
36
+
37
+ form.addEventListener('submit', async event => {
38
+ event.preventDefault();
39
+ const password = passwordInput.value;
40
+ submitButton.disabled = true;
41
+ errorElement.textContent = '';
42
+ try {
43
+ const response = await fetch('/__api/auth/verify', {
44
+ method: 'POST',
45
+ headers: { 'Content-Type': 'application/json', 'X-File-Explorer-Password': password },
46
+ body: JSON.stringify({ password })
47
+ });
48
+ if (!response.ok) throw new Error('密码不正确');
49
+ sessionStorage.setItem(storageKey, password);
50
+ window.location.replace('/');
51
+ } catch (error) {
52
+ errorElement.textContent = error.message || '登录失败';
53
+ passwordInput.select();
54
+ } finally {
55
+ submitButton.disabled = false;
56
+ }
57
+ });
58
+ </script>
59
+ </body>
60
+ </html>