@xcanwin/manyoyo 6.2.17 → 7.0.1
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/file-browser.js +52 -6
- package/lib/web/frontend/shadcn.html +108 -0
- package/lib/web/server.js +31 -1
- package/package.json +4 -2
package/lib/web/server.js
CHANGED
|
@@ -3315,19 +3315,32 @@ try {
|
|
|
3315
3315
|
itemStat = null;
|
|
3316
3316
|
}
|
|
3317
3317
|
let kind = 'other';
|
|
3318
|
+
let symlinkTarget = null;
|
|
3319
|
+
let symlinkTargetKind = null;
|
|
3318
3320
|
if (entry.isDirectory()) {
|
|
3319
3321
|
kind = 'directory';
|
|
3320
3322
|
} else if (entry.isFile()) {
|
|
3321
3323
|
kind = 'file';
|
|
3322
3324
|
} else if (entry.isSymbolicLink()) {
|
|
3323
3325
|
kind = 'symlink';
|
|
3326
|
+
try {
|
|
3327
|
+
const resolvedPath = fs.realpathSync(fullPath);
|
|
3328
|
+
const resolvedStat = fs.statSync(resolvedPath);
|
|
3329
|
+
symlinkTarget = resolvedPath;
|
|
3330
|
+
symlinkTargetKind = resolvedStat.isDirectory() ? 'directory' : 'file';
|
|
3331
|
+
} catch (e) {
|
|
3332
|
+
symlinkTarget = null;
|
|
3333
|
+
symlinkTargetKind = null;
|
|
3334
|
+
}
|
|
3324
3335
|
}
|
|
3325
3336
|
return {
|
|
3326
3337
|
name: entry.name,
|
|
3327
3338
|
path: fullPath,
|
|
3328
3339
|
kind,
|
|
3329
3340
|
size: itemStat && typeof itemStat.size === 'number' ? itemStat.size : 0,
|
|
3330
|
-
mtimeMs: itemStat && typeof itemStat.mtimeMs === 'number' ? Math.floor(itemStat.mtimeMs) : 0
|
|
3341
|
+
mtimeMs: itemStat && typeof itemStat.mtimeMs === 'number' ? Math.floor(itemStat.mtimeMs) : 0,
|
|
3342
|
+
symlinkTarget,
|
|
3343
|
+
symlinkTargetKind
|
|
3331
3344
|
};
|
|
3332
3345
|
})
|
|
3333
3346
|
.sort((a, b) => {
|
|
@@ -4285,6 +4298,13 @@ async function handleWebAuthRoutes(req, res, pathname, ctx, state) {
|
|
|
4285
4298
|
return true;
|
|
4286
4299
|
}
|
|
4287
4300
|
|
|
4301
|
+
// shadcn/ui 版前端的登录页:与 /shadcn 复用同一份构建产物,
|
|
4302
|
+
// 由前端按 pathname 自行渲染登录表单,登录逻辑仍复用 /auth/login 接口
|
|
4303
|
+
if (req.method === 'GET' && pathname === '/shadcn/auth/login') {
|
|
4304
|
+
sendHtml(res, 200, loadTemplate('shadcn.html'));
|
|
4305
|
+
return true;
|
|
4306
|
+
}
|
|
4307
|
+
|
|
4288
4308
|
const authFrontendMatch = pathname.match(/^\/auth\/frontend\/([A-Za-z0-9._-]+)$/);
|
|
4289
4309
|
if (req.method === 'GET' && authFrontendMatch) {
|
|
4290
4310
|
const assetName = authFrontendMatch[1];
|
|
@@ -4346,6 +4366,10 @@ function sendWebUnauthorized(res, pathname, ctx) {
|
|
|
4346
4366
|
sendRedirect(res, 302, '/auth/login', { 'Set-Cookie': getWebAuthClearCookie() });
|
|
4347
4367
|
return;
|
|
4348
4368
|
}
|
|
4369
|
+
if (pathname === '/shadcn') {
|
|
4370
|
+
sendRedirect(res, 302, '/shadcn/auth/login', { 'Set-Cookie': getWebAuthClearCookie() });
|
|
4371
|
+
return;
|
|
4372
|
+
}
|
|
4349
4373
|
sendHtml(
|
|
4350
4374
|
res,
|
|
4351
4375
|
401,
|
|
@@ -5454,6 +5478,12 @@ async function startWebServer(options) {
|
|
|
5454
5478
|
return;
|
|
5455
5479
|
}
|
|
5456
5480
|
|
|
5481
|
+
// shadcn/ui 版前端的试验性入口,构建产物见 frontend-shadcn/(npm run build:web-shadcn)
|
|
5482
|
+
if (req.method === 'GET' && pathname === '/shadcn') {
|
|
5483
|
+
sendHtml(res, 200, loadTemplate('shadcn.html'));
|
|
5484
|
+
return;
|
|
5485
|
+
}
|
|
5486
|
+
|
|
5457
5487
|
const appFrontendMatch = pathname.match(/^\/app\/frontend\/([A-Za-z0-9._-]+)$/);
|
|
5458
5488
|
if (req.method === 'GET' && appFrontendMatch) {
|
|
5459
5489
|
const assetName = appFrontendMatch[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcanwin/manyoyo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
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",
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev:release": "node scripts/dev-release.js",
|
|
34
34
|
"build:web-editor": "node scripts/build-web-code-editor.js",
|
|
35
|
-
"
|
|
35
|
+
"build:web-shadcn": "node scripts/build-web-shadcn.js",
|
|
36
|
+
"dev:web-shadcn": "node scripts/dev-web-shadcn.js",
|
|
37
|
+
"prepack": "npm run build:web-editor && npm run build:web-shadcn",
|
|
36
38
|
"prepare": "npm run build:web-editor",
|
|
37
39
|
"install-link": "npm link",
|
|
38
40
|
"test": "jest --coverage",
|