lantern-harness 0.1.6 → 0.1.8
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/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/builtin/session/update-check.mjs +517 -0
- package/cli/lantern.mjs +123 -22
- package/cli/server.mjs +5 -2
- package/dist/500.html +3 -3
- package/dist/_astro/Base.DjIEQkT7.css +1 -0
- package/dist/_astro/Base.astro_astro_type_script_index_0_lang.D0snmAJ_.js +1 -0
- package/dist/_astro/{CaseExecBoard.FJ1Y9b4e.js → CaseExecBoard.BAV4EE3o.js} +1 -1
- package/dist/_astro/{CaseGenerateApp.CT2n4VOf.js → CaseGenerateApp.Bz4ryNJG.js} +1 -1
- package/dist/_astro/{CasesLibrary.BjrehOiI.js → CasesLibrary.BPifyHUA.js} +1 -1
- package/dist/_astro/{ChatApp.Dqfx4FcI.js → ChatApp.DLo31SYZ.js} +5 -5
- package/dist/_astro/{DashboardBoard.wILBO_CD.js → DashboardBoard.Bd3eUPwZ.js} +2 -2
- package/dist/_astro/{DocsFileBrowser.D32MgVAR.js → DocsFileBrowser.D3cKurQE.js} +1 -1
- package/dist/_astro/{DocsPager.BARD7JvD.js → DocsPager.rzu4mnzw.js} +1 -1
- package/dist/_astro/{KnowledgeLibrary.C-Sg2R6B.js → KnowledgeLibrary.B0sO4QR1.js} +1 -1
- package/dist/_astro/{NavLibraries.BzInZVDf.js → NavLibraries.Cvg3wery.js} +1 -1
- package/dist/_astro/{PluginsPage.CVyua_fb.js → PluginsPage.DIltPILi.js} +2 -2
- package/dist/_astro/PluginsPage.uvmSuXzi.js +1 -0
- package/dist/_astro/PmBugsBoard.CiaIhCHv.js +1 -0
- package/dist/_astro/PmIterationsBoard.H67QwKFw.js +1 -0
- package/dist/_astro/{PmProjectDetail.CtQdpGes.js → PmProjectDetail.DqDoIg8a.js} +1 -1
- package/dist/_astro/PmProjectsBoard.nOC1Hugt.js +1 -0
- package/dist/_astro/PmRequirementsBoard.BPjZ7khP.js +1 -0
- package/dist/_astro/PmRequirementsBoard.CanxvcKg.js +1 -0
- package/dist/_astro/PmShared.CZnXaUq-.js +1 -0
- package/dist/_astro/{PromptsLibrary.Z1DQBrFL.js → PromptsLibrary.DU9EuSim.js} +1 -1
- package/dist/_astro/{ReportsPage.CGpIPPr9.js → ReportsPage.Cr88iz8c.js} +1 -1
- package/dist/_astro/{RequirementsLibrary.D8078xLd.js → RequirementsLibrary.BwriF8F0.js} +1 -1
- package/dist/_astro/{SearchableSelect.BTJoZC_a.js → SearchableSelect.Ctg8V1Z1.js} +1 -1
- package/dist/_astro/SettingsDialog.DEgsVfaL.js +1 -0
- package/dist/_astro/SpaceSwitcher.BEJo5KFi.js +7 -0
- package/dist/_astro/{TasksBoard.CL-sNPZN.js → TasksBoard.BZi_GBPG.js} +1 -1
- package/dist/_astro/{TemplatesLibrary.d6uIe7I-.js → TemplatesLibrary.T4K9jUex.js} +1 -1
- package/dist/_astro/{TestStatsBoard.CSdXWc4Q.js → TestStatsBoard.Dd1Kcmx6.js} +1 -1
- package/dist/_astro/{TodosBoard.nl23X5Gi.js → TodosBoard.C4yd_JFb.js} +1 -1
- package/dist/_astro/app-config.DKMxjv3g.js +1 -0
- package/dist/_astro/i18n.BXeGGutk.js +7 -0
- package/dist/_astro/{open-docs-in-session.B5cUxqHi.js → open-docs-in-session.B0ZdZNj2.js} +1 -1
- package/dist/_astro/{plugins.DaDJq-mn.js → plugins.D5ypJIXn.js} +1 -1
- package/dist/_astro/pm.BsnTv63L.js +4 -0
- package/dist/_astro/{settings.CMK4PEak.js → settings.CnDCvwnQ.js} +2 -2
- package/dist/_astro/{spaces-client.CoQfaOIO.js → spaces-client.Cai2tHEI.js} +1 -1
- package/dist/_astro/update.DXCPfU4a.js +1 -0
- package/dist/_astro/{view-prefs.Dhdh8Z5a.js → view-prefs.HCowOWXL.js} +1 -1
- package/dist/case-exec/index.html +4 -4
- package/dist/cases/generate/index.html +4 -4
- package/dist/cases/library/index.html +4 -4
- package/dist/dashboard/index.html +4 -4
- package/dist/docs/changelog/index.html +25 -4
- package/dist/docs/install/index.html +3 -3
- package/dist/docs/manual/index.html +15 -5
- package/dist/index.html +4 -4
- package/dist/knowledge/index.html +4 -4
- package/dist/knowledge//345/212/237/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/347/274/226/345/206/231/350/247/204/350/214/203/index.html +3 -3
- package/dist/plugins/index.html +4 -4
- package/dist/pm/bugs/index.html +4 -4
- package/dist/pm/iterations/index.html +4 -4
- package/dist/pm/projects/detail/index.html +4 -4
- package/dist/pm/projects/index.html +4 -4
- package/dist/pm/requirements/index.html +4 -4
- package/dist/prompts/index.html +4 -4
- package/dist/reports/index.html +4 -4
- package/dist/requirements/index.html +4 -4
- package/dist/tasks/index.html +4 -4
- package/dist/templates/index.html +4 -4
- package/dist/templates//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +3 -3
- package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +3 -3
- package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +3 -3
- package/dist/templates//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +3 -3
- package/dist/templates//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +3 -3
- package/dist/test-stats/index.html +4 -4
- package/dist/todos/index.html +4 -4
- package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +13 -2
- package/lh-plugins/lh-pm.mjs +18 -4
- package/lh-plugins/lh-update.mjs +171 -0
- package/package.json +1 -1
- package/dist/_astro/Base.DGaLtzMo.css +0 -1
- package/dist/_astro/Base.astro_astro_type_script_index_0_lang.uhTNjhRY.js +0 -1
- package/dist/_astro/PluginsPage.CS1GaJtR.js +0 -1
- package/dist/_astro/PmBugsBoard.BXUu0kNL.js +0 -1
- package/dist/_astro/PmIterationsBoard.Deso1uyK.js +0 -1
- package/dist/_astro/PmProjectsBoard.MM4vxneK.js +0 -1
- package/dist/_astro/PmRequirementsBoard.62ONLCH5.js +0 -1
- package/dist/_astro/PmRequirementsBoard.SLVDgspp.js +0 -1
- package/dist/_astro/PmShared.CwCmF-kI.js +0 -1
- package/dist/_astro/SettingsDialog.BA57gp90.js +0 -1
- package/dist/_astro/SpaceSwitcher.DZ8b_85M.js +0 -7
- package/dist/_astro/app-config.huKxSIlN.js +0 -1
- package/dist/_astro/i18n.Bbh04ngD.js +0 -7
- package/dist/_astro/pm.CpFmMslU.js +0 -4
package/cli/lantern.mjs
CHANGED
|
@@ -16,6 +16,16 @@ import { runAcpServer } from './acp-server.mjs';
|
|
|
16
16
|
import { headlessAsk, loadHeadlessSettings } from './headless.mjs';
|
|
17
17
|
import { runJsonRpcServer } from './jsonrpc-server.mjs';
|
|
18
18
|
import { displaySpacePath, publicSpacePath } from '../builtin/session/space-layout.mjs';
|
|
19
|
+
import {
|
|
20
|
+
detachedCwd,
|
|
21
|
+
detectInstallMode,
|
|
22
|
+
proxyEnv,
|
|
23
|
+
resolveGlobalCli,
|
|
24
|
+
resolveGlobalRoot,
|
|
25
|
+
resolvePackageManager,
|
|
26
|
+
writeUpdateStatus,
|
|
27
|
+
updateLogHint,
|
|
28
|
+
} from '../builtin/session/update-check.mjs';
|
|
19
29
|
import { prepareSpaceDir, prepareSpacesRoot, startLocalServer } from './server.mjs';
|
|
20
30
|
import {
|
|
21
31
|
clearDataRootFromConfig,
|
|
@@ -73,22 +83,9 @@ function isNpxRun() {
|
|
|
73
83
|
return __dirname.split(path.sep).includes('_npx');
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
/**
|
|
77
|
-
* pnpm 是否「可用于全局安装」:既要有 pnpm,也要它的全局 bin 目录已在 PATH 上。
|
|
78
|
-
* 没执行过 pnpm setup 时 `pnpm add -g` 会直接报 ERR_PNPM_GLOBAL_BIN_DIR_NOT_IN_PATH,
|
|
79
|
-
* 此时退避到 npm,否则用户会装不上(npm 随 Node 一起安装,必然可用)。
|
|
80
|
-
*/
|
|
81
|
-
function isPnpmGlobalReady() {
|
|
82
|
-
const probe = spawnSync('pnpm', ['bin', '-g'], {
|
|
83
|
-
stdio: 'ignore',
|
|
84
|
-
shell: process.platform === 'win32',
|
|
85
|
-
});
|
|
86
|
-
return !probe.error && probe.status === 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
86
|
/** 优先 pnpm(可直接用于全局安装时);否则回退 npm */
|
|
90
87
|
function getPackageManager() {
|
|
91
|
-
return
|
|
88
|
+
return resolvePackageManager();
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
/** 全局安装 / 卸载 / 查询版本列表的 argv(pnpm 与 npm 子命令不同) */
|
|
@@ -258,13 +255,20 @@ async function cmdInit() {
|
|
|
258
255
|
|
|
259
256
|
async function runForegroundServer(dataRoot) {
|
|
260
257
|
const { host, port } = getServerOpts();
|
|
261
|
-
const {
|
|
258
|
+
const {
|
|
259
|
+
url,
|
|
260
|
+
server,
|
|
261
|
+
dataRoot: root,
|
|
262
|
+
spacesRoot,
|
|
263
|
+
} = await startLocalServer({ dataRoot, host, port });
|
|
262
264
|
saveRunState({
|
|
263
265
|
pid: process.pid,
|
|
264
266
|
url,
|
|
265
267
|
host,
|
|
266
268
|
port,
|
|
267
269
|
dataRoot: root,
|
|
270
|
+
// 池根单独记:更新重启时用它还原 `--dir`,避免掉回默认数据目录
|
|
271
|
+
spacesRoot,
|
|
268
272
|
});
|
|
269
273
|
const shutdown = () => {
|
|
270
274
|
clearRunState();
|
|
@@ -280,14 +284,14 @@ async function runForegroundServer(dataRoot) {
|
|
|
280
284
|
console.log('');
|
|
281
285
|
}
|
|
282
286
|
|
|
283
|
-
function cmdStart({ foreground = false, dir = null } = {}) {
|
|
287
|
+
function cmdStart({ foreground = false, dir = null, soft = false } = {}) {
|
|
284
288
|
const dataRoot = requireDataRoot(dir);
|
|
285
289
|
const alive = getAliveRun();
|
|
286
290
|
if (alive) {
|
|
287
291
|
console.log(`服务已在运行(pid ${alive.pid})`);
|
|
288
292
|
console.log(` 地址:${alive.url}`);
|
|
289
293
|
console.log(` 当前空间:${alive.dataRoot}`);
|
|
290
|
-
return;
|
|
294
|
+
return true;
|
|
291
295
|
}
|
|
292
296
|
|
|
293
297
|
if (foreground) {
|
|
@@ -324,20 +328,32 @@ function cmdStart({ foreground = false, dir = null } = {}) {
|
|
|
324
328
|
console.log(' 更新:lantern update');
|
|
325
329
|
console.log(' 更多命令:lantern help');
|
|
326
330
|
console.log('');
|
|
327
|
-
return;
|
|
331
|
+
return true;
|
|
328
332
|
}
|
|
329
333
|
}
|
|
330
334
|
const state = getAliveRun();
|
|
331
335
|
if (state) {
|
|
332
336
|
console.log(`Lantern Harness v${readPkgVersion()} 已启动:${state.url}`);
|
|
333
|
-
return;
|
|
337
|
+
return true;
|
|
334
338
|
}
|
|
335
339
|
console.error('启动超时或失败,请查看日志:');
|
|
336
340
|
console.error(` ${logPath}`);
|
|
337
341
|
console.error('或前台排查:lantern web --foreground');
|
|
342
|
+
if (soft) return false;
|
|
338
343
|
process.exit(1);
|
|
339
344
|
}
|
|
340
345
|
|
|
346
|
+
/** 轮询等 run.json 出现(新服务写完才开始监听);超时返回 null */
|
|
347
|
+
function waitForAliveRun(deadlineMs = 8000) {
|
|
348
|
+
const deadline = Date.now() + deadlineMs;
|
|
349
|
+
while (Date.now() < deadline) {
|
|
350
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 150);
|
|
351
|
+
const state = getAliveRun();
|
|
352
|
+
if (state) return state;
|
|
353
|
+
}
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
|
|
341
357
|
function cmdStop() {
|
|
342
358
|
const state = loadRunState();
|
|
343
359
|
if (!state?.pid) {
|
|
@@ -523,12 +539,18 @@ function cmdList() {
|
|
|
523
539
|
function cmdUpdate(version) {
|
|
524
540
|
const pm = getPackageManager();
|
|
525
541
|
const spec = version ? `${PKG_NAME}@${version}` : `${PKG_NAME}@latest`;
|
|
542
|
+
// 页面里点「更新」时,CLI 读到的当前版本就是被替换前的版本
|
|
543
|
+
const from = readPkgVersion();
|
|
544
|
+
const mode = detectInstallMode(PKG_ROOT, pm);
|
|
526
545
|
console.log(version ? `正在更新到 ${spec} …` : `正在更新到最新版本(${spec})…`);
|
|
546
|
+
writeUpdateStatus({ phase: 'installing', from, to: version || '' });
|
|
527
547
|
|
|
528
548
|
// 更新前先停掉后台服务:
|
|
529
549
|
// 1) 进程里跑的是旧代码 + 旧 dist,不停就算装完了页面也还是旧版本;
|
|
530
550
|
// 2) Windows 上文件被运行中的进程占用时,全局安装替换目录可能直接失败。
|
|
531
551
|
const running = getAliveRun();
|
|
552
|
+
// 用 --dir 启动过的服务要把池根带回去,否则重启会掉到默认数据目录
|
|
553
|
+
const spacesRoot = running?.spacesRoot || '';
|
|
532
554
|
if (running) {
|
|
533
555
|
console.log(`正在停止后台服务(pid ${running.pid})…`);
|
|
534
556
|
cmdStop();
|
|
@@ -536,27 +558,106 @@ function cmdUpdate(version) {
|
|
|
536
558
|
|
|
537
559
|
const r = spawnSync(pm, pmGlobalArgs(pm, 'install', spec), {
|
|
538
560
|
stdio: 'inherit',
|
|
561
|
+
// 从临时目录执行:Windows 上 cwd 在包目录里会锁住要被替换的文件
|
|
562
|
+
cwd: detachedCwd(),
|
|
563
|
+
// npm/pnpm 不读系统代理;把探测到的代理传下去,否则国内网络装不动
|
|
564
|
+
env: { ...process.env, ...proxyEnv() },
|
|
539
565
|
shell: process.platform === 'win32',
|
|
540
566
|
});
|
|
541
567
|
const code = r.status === null ? 1 : r.status;
|
|
542
568
|
if (code !== 0) {
|
|
543
569
|
console.error('更新失败。');
|
|
570
|
+
writeUpdateStatus({
|
|
571
|
+
phase: 'failed',
|
|
572
|
+
from,
|
|
573
|
+
to: version || '',
|
|
574
|
+
error: `全局安装失败(${pm} 退出码 ${code}),可查看日志:${updateLogHint()}`,
|
|
575
|
+
});
|
|
544
576
|
if (running) {
|
|
545
577
|
console.log('正在用更新前的版本恢复启动 …');
|
|
546
|
-
cmdStart({ foreground: false });
|
|
578
|
+
cmdStart({ foreground: false, dir: spacesRoot || null });
|
|
547
579
|
}
|
|
548
580
|
process.exit(code);
|
|
549
581
|
}
|
|
550
582
|
|
|
551
|
-
|
|
583
|
+
// npx 模式下本进程读到的还是 npx 缓存里的旧副本,新版本要从全局包看
|
|
584
|
+
const globalRoot = resolveGlobalRoot(pm);
|
|
585
|
+
let next = readPkgVersion();
|
|
586
|
+
if (mode === 'npx' && globalRoot) {
|
|
587
|
+
try {
|
|
588
|
+
const raw = JSON.parse(
|
|
589
|
+
fs.readFileSync(path.join(globalRoot, PKG_NAME, 'package.json'), 'utf8'),
|
|
590
|
+
);
|
|
591
|
+
if (typeof raw.version === 'string' && raw.version) next = raw.version;
|
|
592
|
+
} catch {
|
|
593
|
+
// 读不到就沿用当前版本号,不影响已完成的安装
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
552
597
|
if (!running) {
|
|
598
|
+
writeUpdateStatus({ phase: 'done', from, to: next });
|
|
553
599
|
console.log('');
|
|
554
600
|
console.log(`已更新到 ${next},下次 lantern web 会使用新版本。`);
|
|
555
601
|
return;
|
|
556
602
|
}
|
|
557
603
|
|
|
558
604
|
console.log(`已更新到 ${next},正在后台重启 …`);
|
|
559
|
-
|
|
605
|
+
writeUpdateStatus({ phase: 'restarting', from, to: next });
|
|
606
|
+
|
|
607
|
+
if (mode === 'npx') {
|
|
608
|
+
// npx 的临时副本仍是旧的,重启必须走刚装好的全局命令
|
|
609
|
+
const globalCli = resolveGlobalCli(pm);
|
|
610
|
+
if (!globalCli) {
|
|
611
|
+
writeUpdateStatus({
|
|
612
|
+
phase: 'failed',
|
|
613
|
+
from,
|
|
614
|
+
to: next,
|
|
615
|
+
error: '全局包已安装,但找不到全局 lantern 命令,请运行 npx lantern-harness@latest web',
|
|
616
|
+
});
|
|
617
|
+
console.error('已安装全局包,但找不到全局 lantern 命令。');
|
|
618
|
+
console.error('请手动启动:npx lantern-harness@latest web');
|
|
619
|
+
process.exit(1);
|
|
620
|
+
}
|
|
621
|
+
const logPath = ensureLogFile();
|
|
622
|
+
const out = fs.openSync(logPath, 'a');
|
|
623
|
+
const args = ['web', '--foreground'];
|
|
624
|
+
if (spacesRoot) args.push('--dir', spacesRoot);
|
|
625
|
+
const child = spawn(globalCli, args, {
|
|
626
|
+
detached: true,
|
|
627
|
+
stdio: ['ignore', out, out],
|
|
628
|
+
env: { ...process.env, ...proxyEnv() },
|
|
629
|
+
cwd: detachedCwd(),
|
|
630
|
+
shell: process.platform === 'win32',
|
|
631
|
+
});
|
|
632
|
+
child.unref();
|
|
633
|
+
fs.closeSync(out);
|
|
634
|
+
const state = waitForAliveRun(12000);
|
|
635
|
+
if (state) {
|
|
636
|
+
writeUpdateStatus({ phase: 'done', from, to: next });
|
|
637
|
+
console.log(`已用全局命令重启:${state.url}`);
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
writeUpdateStatus({
|
|
641
|
+
phase: 'failed',
|
|
642
|
+
from,
|
|
643
|
+
to: next,
|
|
644
|
+
error: `重启超时,请查看日志:${updateLogHint()}`,
|
|
645
|
+
});
|
|
646
|
+
console.error(`重启超时,请查看日志:${logPath}`);
|
|
647
|
+
process.exit(1);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// soft:重启失败时不要 process.exit,否则状态文件会一直停在 restarting,
|
|
651
|
+
// 页面只能干等到超时;这里拿到 false 就把失败原因写进状态再退出。
|
|
652
|
+
const restarted = cmdStart({ foreground: false, dir: spacesRoot || null, soft: true });
|
|
653
|
+
const state = restarted ? getAliveRun() : null;
|
|
654
|
+
writeUpdateStatus({
|
|
655
|
+
phase: state ? 'done' : 'failed',
|
|
656
|
+
from,
|
|
657
|
+
to: next,
|
|
658
|
+
error: state ? '' : `重启失败,请查看日志:${updateLogHint()}`,
|
|
659
|
+
});
|
|
660
|
+
if (!state) process.exit(1);
|
|
560
661
|
}
|
|
561
662
|
|
|
562
663
|
// ── 数据空间(多空间数据隔离)────────────────────────────────
|
package/cli/server.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import { lhTasksPlugin } from '../lh-plugins/lh-tasks.mjs';
|
|
|
21
21
|
import { lhPmPlugin } from '../lh-plugins/lh-pm.mjs';
|
|
22
22
|
import { lhReportsPlugin } from '../lh-plugins/lh-reports.mjs';
|
|
23
23
|
import { lhStatsPlugin } from '../lh-plugins/lh-stats.mjs';
|
|
24
|
+
import { lhUpdatePlugin } from '../lh-plugins/lh-update.mjs';
|
|
24
25
|
import { lhWebPlugin } from '../builtin/session/lh-web.mjs';
|
|
25
26
|
import { tbSessionRunsPlugin } from '../builtin/session/session-runs.mjs';
|
|
26
27
|
import { lhSpacesPlugin } from '../builtin/session/lh-spaces.mjs';
|
|
@@ -58,6 +59,7 @@ function attachPlugins(app, dataRoot) {
|
|
|
58
59
|
lhPmPlugin(),
|
|
59
60
|
lhReportsPlugin(),
|
|
60
61
|
lhStatsPlugin(),
|
|
62
|
+
lhUpdatePlugin(),
|
|
61
63
|
lhNavGroupsPlugin(),
|
|
62
64
|
lhConfigPlugin(),
|
|
63
65
|
lhResourcesPlugin(),
|
|
@@ -84,7 +86,8 @@ function attachPlugins(app, dataRoot) {
|
|
|
84
86
|
/**
|
|
85
87
|
* @param {{ dataRoot: string, host?: string, port?: number }} opts
|
|
86
88
|
* `opts.dataRoot` 是池根(lantern 记住的数据目录):公共空间在 `<池根>/公共空间`。
|
|
87
|
-
* @returns {Promise<{ url: string, server: http.Server, dataRoot: string }>}
|
|
89
|
+
* @returns {Promise<{ url: string, server: http.Server, dataRoot: string, spacesRoot: string }>}
|
|
90
|
+
* dataRoot 为当前生效的空间目录;spacesRoot 为池根(重启时要带回去,否则会掉到默认目录)
|
|
88
91
|
*/
|
|
89
92
|
export function startLocalServer(opts) {
|
|
90
93
|
const spacesRoot = prepareSpacesRoot(opts.dataRoot);
|
|
@@ -121,7 +124,7 @@ export function startLocalServer(opts) {
|
|
|
121
124
|
server.once('error', reject);
|
|
122
125
|
server.listen(port, host, () => {
|
|
123
126
|
const url = `http://${host}:${port}/`;
|
|
124
|
-
resolve({ url, server, dataRoot: getDataRoot() });
|
|
127
|
+
resolve({ url, server, dataRoot: getDataRoot(), spacesRoot });
|
|
125
128
|
});
|
|
126
129
|
});
|
|
127
130
|
}
|
package/dist/500.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
try {
|
|
4
4
|
if ('scrollRestoration' in history) history.scrollRestoration = 'manual';
|
|
5
5
|
} catch (e) {}
|
|
6
|
-
</script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.
|
|
6
|
+
</script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.D0snmAJ_.js"></script><meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback" content="animate"><script type="module" src="/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CO1cjG9V.js"></script><script>
|
|
7
7
|
(function () {
|
|
8
8
|
try {
|
|
9
9
|
var raw = localStorage.getItem('tw.app.config.v1');
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
} catch (e) {}
|
|
78
78
|
})();
|
|
79
|
-
</script><link rel="stylesheet" href="/_astro/Base.
|
|
79
|
+
</script><link rel="stylesheet" href="/_astro/Base.DjIEQkT7.css"><style>.tw-error-page[data-astro-cid-qnkxrarz]{text-align:center;background:var(--tw-surface-page);flex-direction:column;justify-content:center;align-items:center;gap:.75rem;min-height:100vh;padding:2rem 1.25rem;display:flex}.tw-error-title[data-astro-cid-qnkxrarz]{color:var(--tw-label-primary);margin:0;font-size:1.25rem;font-weight:650}.tw-error-desc[data-astro-cid-qnkxrarz]{color:var(--tw-label-secondary);margin:0;font-size:.875rem;line-height:1.5}.tw-error-pre[data-astro-cid-qnkxrarz]{border:1px solid var(--tw-border);background:color-mix(in srgb, var(--tw-surface-panel,#fff) 90%, transparent);text-align:left;max-width:28rem;max-height:8rem;color:var(--tw-label-secondary);white-space:pre-wrap;word-break:break-word;border-radius:.5rem;margin:.25rem 0 0;padding:.65rem .85rem;font-size:.7rem;line-height:1.5;overflow:auto}.tw-error-actions[data-astro-cid-qnkxrarz]{flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}.tw-error-btn[data-astro-cid-qnkxrarz]{cursor:pointer;border:1px solid #0000;border-radius:.5rem;justify-content:center;align-items:center;height:2.25rem;padding:0 1rem;font-size:.8125rem;font-weight:550;text-decoration:none;display:inline-flex}.tw-error-btn--primary[data-astro-cid-qnkxrarz]{color:#fff;background:#4176e6}.tw-error-btn--primary[data-astro-cid-qnkxrarz]:hover{background:#3565c7}.tw-error-btn--ghost[data-astro-cid-qnkxrarz]{color:var(--tw-label-secondary);border-color:var(--tw-border);background:0 0}.tw-error-btn--ghost[data-astro-cid-qnkxrarz]:hover{color:var(--tw-label-primary)}
|
|
80
80
|
</style><script type="module" src="/_astro/page.Bx2KSkeL.js"></script><style>[data-astro-transition-scope="astro-bbhp3f5g-3"] { view-transition-name: astro-bbhp3f5g-3; }@layer astro { ::view-transition-old(astro-bbhp3f5g-3) {
|
|
81
81
|
animation-duration: 180ms;
|
|
82
82
|
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
animation-duration: 180ms;
|
|
114
114
|
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
115
115
|
animation-fill-mode: both;
|
|
116
|
-
animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1"><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.6">v0.1.6</span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.DZ8b_85M.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-gyrtbwwo-1"]}" ssr client="only" opts="{"name":"SpaceSwitcher","value":"react"}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/" class="tw-nav-item" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.BzInZVDf.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-iywf7oe7-2"]}" ssr client="only" opts="{"name":"NavLibraries","value":"react"}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.BA57gp90.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{}" ssr client="load" opts="{"name":"SettingsDialog","value":true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
|
|
116
|
+
animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1"><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.8">v0.1.8<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.BEJo5KFi.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-gyrtbwwo-1"]}" ssr client="only" opts="{"name":"SpaceSwitcher","value":"react"}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/" class="tw-nav-item" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.Cvg3wery.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-iywf7oe7-2"]}" ssr client="only" opts="{"name":"NavLibraries","value":"react"}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.DEgsVfaL.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{}" ssr client="load" opts="{"name":"SettingsDialog","value":true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
|
|
117
117
|
(function () {
|
|
118
118
|
var root = document.documentElement;
|
|
119
119
|
var btn = document.getElementById('tw-nav-toggle');
|