@xcanwin/manyoyo 7.0.11 → 7.0.13
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.
- package/lib/web/frontend/app.js +2 -2
- package/lib/web/frontend/login.js +1 -1
- package/lib/web/frontend/shadcn.html +71 -71
- package/lib/web/server.js +15 -7
- package/package.json +4 -3
package/lib/web/server.js
CHANGED
|
@@ -4314,12 +4314,13 @@ async function handleWebAuthRoutes(req, res, pathname, ctx, state) {
|
|
|
4314
4314
|
return true;
|
|
4315
4315
|
}
|
|
4316
4316
|
|
|
4317
|
+
// 旧版默认主题(现为 /legacy 兜底路由)的登录页
|
|
4317
4318
|
if (req.method === 'GET' && pathname === '/auth/login') {
|
|
4318
4319
|
sendHtml(res, 200, renderLoginHtml(ctx));
|
|
4319
4320
|
return true;
|
|
4320
4321
|
}
|
|
4321
4322
|
|
|
4322
|
-
// shadcn/ui
|
|
4323
|
+
// 默认主题(shadcn/ui 版)的登录页:与 / 、/shadcn 复用同一份构建产物,
|
|
4323
4324
|
// 由前端按 pathname 自行渲染登录表单,登录逻辑仍复用 /auth/login 接口
|
|
4324
4325
|
if (req.method === 'GET' && pathname === '/shadcn/auth/login') {
|
|
4325
4326
|
sendHtml(res, 200, applyServeTitle(loadTemplate('shadcn.html'), ctx));
|
|
@@ -4383,12 +4384,12 @@ function sendWebUnauthorized(res, pathname, ctx) {
|
|
|
4383
4384
|
sendJson(res, 401, { error: 'UNAUTHORIZED' });
|
|
4384
4385
|
return;
|
|
4385
4386
|
}
|
|
4386
|
-
if (pathname === '/' || pathname === '') {
|
|
4387
|
-
sendRedirect(res, 302, '/auth/login', { 'Set-Cookie': getWebAuthClearCookie() });
|
|
4387
|
+
if (pathname === '' || pathname === '/' || pathname === '/shadcn') {
|
|
4388
|
+
sendRedirect(res, 302, '/shadcn/auth/login', { 'Set-Cookie': getWebAuthClearCookie() });
|
|
4388
4389
|
return;
|
|
4389
4390
|
}
|
|
4390
|
-
if (pathname === '/
|
|
4391
|
-
sendRedirect(res, 302, '/
|
|
4391
|
+
if (pathname === '/legacy') {
|
|
4392
|
+
sendRedirect(res, 302, '/auth/login', { 'Set-Cookie': getWebAuthClearCookie() });
|
|
4392
4393
|
return;
|
|
4393
4394
|
}
|
|
4394
4395
|
sendHtml(
|
|
@@ -5574,17 +5575,24 @@ async function startWebServer(options) {
|
|
|
5574
5575
|
return;
|
|
5575
5576
|
}
|
|
5576
5577
|
|
|
5578
|
+
// shadcn/ui 版前端现在是默认主题,构建产物见 frontend-shadcn/(npm run build:web-shadcn)
|
|
5577
5579
|
if (req.method === 'GET' && pathname === '/') {
|
|
5578
|
-
sendHtml(res, 200,
|
|
5580
|
+
sendHtml(res, 200, renderShadcnHtml(ctx));
|
|
5579
5581
|
return;
|
|
5580
5582
|
}
|
|
5581
5583
|
|
|
5582
|
-
// shadcn
|
|
5584
|
+
// /shadcn 保留为 / 的别名,兼容此前"试验性预览"阶段留下的书签/脚本
|
|
5583
5585
|
if (req.method === 'GET' && pathname === '/shadcn') {
|
|
5584
5586
|
sendHtml(res, 200, renderShadcnHtml(ctx));
|
|
5585
5587
|
return;
|
|
5586
5588
|
}
|
|
5587
5589
|
|
|
5590
|
+
// 旧版默认主题:不再是默认路由,移到 /legacy 继续保留一段时间作为兜底
|
|
5591
|
+
if (req.method === 'GET' && pathname === '/legacy') {
|
|
5592
|
+
sendHtml(res, 200, renderIndexHtml(ctx));
|
|
5593
|
+
return;
|
|
5594
|
+
}
|
|
5595
|
+
|
|
5588
5596
|
const appFrontendMatch = pathname.match(/^\/app\/frontend\/([A-Za-z0-9._-]+)$/);
|
|
5589
5597
|
if (req.method === 'GET' && appFrontendMatch) {
|
|
5590
5598
|
const assetName = appFrontendMatch[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcanwin/manyoyo",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.13",
|
|
4
4
|
"imageVersion": "1.9.1-common",
|
|
5
5
|
"playwrightCliVersion": "0.1.18",
|
|
6
6
|
"description": "AI Agent CLI Security Sandbox for Docker and Podman",
|
|
@@ -34,11 +34,12 @@
|
|
|
34
34
|
"build:web-editor": "node scripts/build-web-code-editor.js",
|
|
35
35
|
"build:web-shadcn": "node scripts/build-web-shadcn.js",
|
|
36
36
|
"dev:web-shadcn": "node scripts/dev-web-shadcn.js",
|
|
37
|
+
"test:web-shadcn": "node scripts/test-web-shadcn.js",
|
|
37
38
|
"prepack": "npm run build:web-editor && npm run build:web-shadcn",
|
|
38
39
|
"prepare": "npm run build:web-editor",
|
|
39
40
|
"install-link": "npm link",
|
|
40
|
-
"test": "jest --coverage",
|
|
41
|
-
"test:unit": "jest test/",
|
|
41
|
+
"test": "jest --coverage && npm run test:web-shadcn",
|
|
42
|
+
"test:unit": "jest test/ && npm run test:web-shadcn",
|
|
42
43
|
"lint": "echo 'Lint check passed'",
|
|
43
44
|
"docs:dev": "vitepress dev docs --host 127.0.0.1 --port 5173",
|
|
44
45
|
"docs:build": "vitepress build docs",
|