@xcanwin/manyoyo 3.8.7 → 3.9.3

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,22 @@
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>MANYOYO Web Login</title>
7
+ <link rel="stylesheet" href="/auth/static/login.css" />
8
+ </head>
9
+ <body>
10
+ <form class="card" id="loginForm">
11
+ <h1>MANYOYO Web</h1>
12
+ <p>请先登录后使用网页交互服务。</p>
13
+ <label for="username">用户名</label>
14
+ <input id="username" name="username" autocomplete="username" />
15
+ <label for="password">密码</label>
16
+ <input id="password" name="password" type="password" autocomplete="current-password" />
17
+ <button type="submit">登录</button>
18
+ <div class="error" id="error"></div>
19
+ </form>
20
+ <script src="/auth/static/login.js"></script>
21
+ </body>
22
+ </html>
@@ -0,0 +1,28 @@
1
+ (function () {
2
+ const form = document.getElementById('loginForm');
3
+ const userNode = document.getElementById('username');
4
+ const passNode = document.getElementById('password');
5
+ const errorNode = document.getElementById('error');
6
+
7
+ form.addEventListener('submit', async function (event) {
8
+ event.preventDefault();
9
+ errorNode.textContent = '';
10
+ try {
11
+ const response = await fetch('/auth/login', {
12
+ method: 'POST',
13
+ headers: { 'Content-Type': 'application/json' },
14
+ body: JSON.stringify({
15
+ username: (userNode.value || '').trim(),
16
+ password: passNode.value || ''
17
+ })
18
+ });
19
+ const payload = await response.json().catch(function () { return {}; });
20
+ if (!response.ok) {
21
+ throw new Error(payload.error || '登录失败');
22
+ }
23
+ window.location.href = '/';
24
+ } catch (e) {
25
+ errorNode.textContent = e.message || '登录失败';
26
+ }
27
+ });
28
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "3.8.7",
3
+ "version": "3.9.3",
4
4
  "imageVersion": "1.7.3",
5
5
  "description": "AI Agent CLI Security Sandbox for Docker and Podman",
6
6
  "keywords": [
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "files": [
48
48
  "bin/manyoyo.js",
49
+ "lib/**",
49
50
  "README.md",
50
51
  "LICENSE",
51
52
  "docker/manyoyo.Dockerfile",