lantern-harness 0.1.45 → 0.2.2
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 +215 -0
- package/README.md +25 -8
- package/builtin/session/lh-fs.mjs +93 -4
- package/builtin/session/lh-nav-groups.mjs +3 -0
- package/builtin/session/mcp-client.mjs +7 -3
- package/builtin/session/session-runs.mjs +5 -1
- package/builtin/session/skill-validation.mjs +72 -0
- package/builtin/session/space-skills.mjs +751 -0
- package/cli/data-root.mjs +21 -4
- package/cli/lantern.mjs +26 -1
- package/cli/mcp-server.mjs +2779 -0
- package/cli/server.mjs +8 -2
- package/config/app.defaults.json +4 -2
- package/dist/500.html +9 -6
- package/dist/_astro/Base.Du_-4L-4.css +1 -0
- package/dist/_astro/Base.astro_astro_type_script_index_0_lang.XUV2H6ea.js +2 -0
- package/dist/_astro/BusinessMapBoard.mRxl2G3D.js +5 -0
- package/dist/_astro/CaseExecBoard.Cqkxuf5c.js +1 -0
- package/dist/_astro/CaseExecutionBoard.CjX4CoKd.js +5 -0
- package/dist/_astro/CaseGenerateApp.acgnxl79.js +10 -0
- package/dist/_astro/CasesLibrary.zmzOQwdn.js +21 -0
- package/dist/_astro/ChatApp.Ben9LFra.js +1 -0
- package/dist/_astro/ChatApp.DBi6q7Qv.js +262 -0
- package/dist/_astro/{ConfirmDialog.DrrPf1MB.js → ConfirmDialog.DQFd6g2r.js} +1 -1
- package/dist/_astro/DashboardBoard.CAJVE2G4.js +5 -0
- package/dist/_astro/{DatePicker.Bkl71M49.js → DatePicker.BRO_CjVQ.js} +1 -1
- package/dist/_astro/DefectSubmitEntry.BzKXJ-zq.js +2 -0
- package/dist/_astro/DocsFileBrowser.apKMbGVf.js +1 -0
- package/dist/_astro/{DocsPager.Duf4I68E.js → DocsPager.DMN9-Tjg.js} +1 -1
- package/dist/_astro/{DrawerField.BH3p4Q4D.js → DrawerField.CLdvmHc6.js} +1 -1
- package/dist/_astro/KnowledgeLibrary.BcoMQeUd.js +1 -0
- package/dist/_astro/LifeKrTasksBoard.DJU0-QI-.js +1 -0
- package/dist/_astro/LifeKrTodosBoard.GK7KRAO3.js +1 -0
- package/dist/_astro/LifeObjectivesBoard.DuKa6Q3k.js +1 -0
- package/dist/_astro/LifePlanTypeSelect.Cm2lUmnH.js +1 -0
- package/dist/_astro/{LifeReviewsBoard.BPXeVpg1.js → LifeReviewsBoard.BWOOVMtz.js} +3 -3
- package/dist/_astro/{LifeShared.tnT7aQON.js → LifeShared.bY2l01Ha.js} +2 -2
- package/dist/_astro/LifeStagesBoard.CIzxPOJB.js +1 -0
- package/dist/_astro/LifeYearCycleSelect.BlsyPmmI.js +1 -0
- package/dist/_astro/LifeYearPlansBoard.DaA9O08j.js +1 -0
- package/dist/_astro/MultiSelectDropdown.D-rbpivp.js +1 -0
- package/dist/_astro/{NamePromptDialog.Csfnh5eM.js → NamePromptDialog.KPCeXmri.js} +1 -1
- package/dist/_astro/NavLibraries.DVR5Ua-S.js +1 -0
- package/dist/_astro/PluginsPage.B063QIlQ.js +18 -0
- package/dist/_astro/PmBugsBoard.Cu-v0Gfd.js +1 -0
- package/dist/_astro/PmIterationsBoard.CgRzkP-j.js +1 -0
- package/dist/_astro/{PmProjectDetail.DneFVBpy.js → PmProjectDetail.DVCEh0Lm.js} +1 -1
- package/dist/_astro/PmProjectsBoard.z-bQa98r.js +1 -0
- package/dist/_astro/PmRequirementsBoard.B0W6bsW2.js +1 -0
- package/dist/_astro/PmRequirementsBoard.CyfBI0u_.js +1 -0
- package/dist/_astro/PmShared.BQVzwsiz.js +1 -0
- package/dist/_astro/ReportsPage.najSzJeT.js +1 -0
- package/dist/_astro/ReqAnalysisBoard.BQb8dHFD.js +39 -0
- package/dist/_astro/RequirementBreakdownLibrary.Cn6OV6xt.js +2 -0
- package/dist/_astro/RequirementsLibrary.CqKNFVsP.js +1 -0
- package/dist/_astro/SearchableSelect.DXclLMJI.js +1 -0
- package/dist/_astro/SelectDropdown.D7IeyHDI.js +1 -0
- package/dist/_astro/SettingsDialog.db3BpFw0.js +1 -0
- package/dist/_astro/SlideOverDrawer.BMg2tce6.js +1 -0
- package/dist/_astro/SpaceSwitcher.DSUVAPOi.js +7 -0
- package/dist/_astro/{TableFieldConfig.C7O-mL-p.js → TableFieldConfig.72AL-8p-.js} +1 -1
- package/dist/_astro/{TagSelect.UUXgkMqJ.js → TagSelect.B_r2p0fp.js} +1 -1
- package/dist/_astro/TasksBoard.CCDhCSR7.js +1 -0
- package/dist/_astro/TemplatesLibrary.peYzrHZ2.js +1 -0
- package/dist/_astro/TestReportsLibrary.fWiEyCRx.js +1 -0
- package/dist/_astro/TestStatsBoard.BSUBsWSu.js +1 -0
- package/dist/_astro/Toast.BydY-X7T.js +1 -0
- package/dist/_astro/TodosBoard.By5YdlUe.js +1 -0
- package/dist/_astro/UiAutoBoard.BGdlp5Sr.js +3 -0
- package/dist/_astro/UiAutoEnvPanel.BUASgPLB.js +10 -0
- package/dist/_astro/UiAutoGenerationDialog.D1PyCgrD.js +12 -0
- package/dist/_astro/UiAutoProjectsPage.B6A9NlVK.js +3 -0
- package/dist/_astro/app-config.Dvfzl5_N.js +1 -0
- package/dist/_astro/app-version.CNpnKIb9.js +1 -0
- package/dist/_astro/{bash-tools.D9HCzC_7.js → bash-tools.CS2w8LOb.js} +1 -1
- package/dist/_astro/business-map.BiJ85oxm.js +1 -0
- package/dist/_astro/business-map.DKwdW1VL.css +1 -0
- package/dist/_astro/case-gen-run.Cvvdv_kv.js +26 -0
- package/dist/_astro/case-prompt.CZ3vWUju.js +2 -0
- package/dist/_astro/{case-review.TdDs1WFM.js → case-review.DFWZkoR9.js} +1 -1
- package/dist/_astro/{case-template.Cd2xNbgy.js → case-template.Clb7HrDB.js} +1 -1
- package/dist/_astro/defect-submit.Dc49lFjm.css +1 -0
- package/dist/_astro/defect-workbench.CjTb4FDv.js +6 -0
- package/dist/_astro/dialog.XgRGNF_Q.js +1 -0
- package/dist/_astro/doc-roots.C-20VD0x.js +1 -0
- package/dist/_astro/{hydrate-cache.B15Nrpq0.js → hydrate-cache.O4CIma9y.js} +1 -1
- package/dist/_astro/i18n.Cp4so7KR.js +7 -0
- package/dist/_astro/{llm.DN5S1KBK.js → llm.BCYNgppW.js} +1 -1
- package/dist/_astro/mcp-tools.Kf-lupGn.js +7 -0
- package/dist/_astro/{open-docs-in-session.CRiZT022.js → open-docs-in-session.BpcAcBSI.js} +1 -1
- package/dist/_astro/plugins.Db9xoFZb.js +1 -0
- package/dist/_astro/project-docs.bB9lQ1Ki.js +1 -0
- package/dist/_astro/prompts-meta.VAjE4OET.js +2 -0
- package/dist/_astro/report-prompt.CwHuOcRN.js +1 -0
- package/dist/_astro/req-analysis.C_gARMrB.js +31 -0
- package/dist/_astro/requirement-breakdown-library.l0rPd7b3.js +1 -0
- package/dist/_astro/{settings.38J2uD5M.js → settings.D02wZj3w.js} +2 -2
- package/dist/_astro/space-skills.CPucW8zt.js +1 -0
- package/dist/_astro/{spaces-client.DV04tRyD.js → spaces-client.BAtG6PkW.js} +1 -1
- package/dist/_astro/story-review.DTN91Vl9.js +7 -0
- package/dist/_astro/test-points.C7ZgggQT.js +8 -0
- package/dist/_astro/test-reports.0gr6-c_0.js +19 -0
- package/dist/_astro/ui-auto-prompt.BmO3ja2m.js +8 -0
- package/dist/_astro/{view-prefs.DhdLZjGh.js → view-prefs.COAKEQtZ.js} +1 -1
- package/dist/business-map/index.html +983 -0
- package/dist/case-exec/index.html +10 -7
- package/dist/{prompts → case-execution}/index.html +12 -9
- package/dist/cases/generate/index.html +9 -6
- package/dist/cases/library/index.html +10 -7
- package/dist/dashboard/index.html +10 -7
- package/dist/defect-rules/index.html +690 -0
- package/dist/defect-submit/index.html +690 -0
- package/dist/defect-submit/templates/index.html +690 -0
- package/dist/docs/changelog/index.html +259 -52
- package/dist/docs/install/index.html +44 -12
- package/dist/docs/manual/index.html +212 -75
- package/dist/knowledge/index.html +10 -7
- package/dist/life/kr-tasks/index.html +10 -7
- package/dist/life/kr-todos/index.html +10 -7
- package/dist/life/objectives/index.html +10 -7
- package/dist/life/reviews/index.html +10 -7
- package/dist/life/stages/index.html +10 -7
- package/dist/life/year-plans/index.html +10 -7
- package/dist/plugins/index.html +10 -7
- package/dist/pm/bugs/index.html +10 -7
- package/dist/pm/iterations/index.html +10 -7
- package/dist/pm/projects/detail/index.html +10 -7
- package/dist/pm/projects/index.html +10 -7
- package/dist/pm/requirements/index.html +10 -7
- package/dist/reports/index.html +10 -7
- package/dist/requirement-analysis/index.html +10 -7
- package/dist/requirement-breakdowns/index.html +983 -0
- package/dist/requirements/index.html +10 -7
- package/dist/tasks/index.html +10 -7
- package/dist/templates/index.html +10 -7
- package/dist/test-automation/index.html +10 -7
- package/dist/test-automation/projects/index.html +10 -7
- package/dist/test-reports/index.html +10 -7
- package/dist/test-stats/index.html +10 -7
- package/dist/todos/index.html +10 -7
- package/dist/workbench/index.html +9 -6
- package/docs/Codex-MCP/351/233/206/346/210/220.md +296 -0
- package/docs//344/270/232/345/212/241/345/234/260/345/233/276/350/257/204/344/274/260.md +39 -0
- package/docs//344/270/232/345/212/241/345/234/260/345/233/276/350/257/206/345/210/253/351/207/215/346/236/204/346/226/271/346/241/210.md +88 -0
- package/docs//344/274/232/350/257/235/346/217/222/344/273/266.md +22 -3
- package/docs//345/205/250/345/261/200/346/217/222/344/273/266.md +41 -1
- package/docs//345/256/211/350/243/205/346/211/213/345/206/214.md +63 -17
- package/docs//346/217/222/344/273/266/344/273/223/345/272/223/344/270/216/346/212/200/350/203/275/346/225/264/345/220/210/346/226/271/346/241/210.md +187 -0
- package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +207 -69
- package/lh-plugins/business-map/assistant.mjs +958 -0
- package/lh-plugins/business-map/auth-paths.mjs +61 -0
- package/lh-plugins/business-map/jobs.mjs +749 -0
- package/lh-plugins/business-map/login.mjs +295 -0
- package/lh-plugins/business-map/sources.mjs +1014 -0
- package/lh-plugins/case-execution/files.mjs +777 -0
- package/lh-plugins/case-execution/service.mjs +959 -0
- package/lh-plugins/case-execution-prompt.mjs +33 -0
- package/lh-plugins/lh-business-map.mjs +2431 -0
- package/lh-plugins/lh-case-execution.mjs +304 -0
- package/lh-plugins/lh-config.mjs +13 -0
- package/lh-plugins/lh-defect-submit.mjs +989 -0
- package/lh-plugins/lh-project-docs.mjs +31 -140
- package/lh-plugins/lh-reports.mjs +29 -57
- package/lh-plugins/lh-req-analysis.mjs +32 -3
- package/lh-plugins/lh-req-breakdown-library.mjs +1084 -0
- package/lh-plugins/lh-uiauto.mjs +514 -22
- package/lh-plugins/plugin-prompts.mjs +19 -15
- package/lh-plugins/req-analysis-revision.mjs +24 -0
- package/lh-plugins/test-points-prompt.mjs +2 -3
- package/lh-plugins/uiauto-auth-setup.mjs +218 -0
- package/lh-plugins/uiauto-explorer/apps.mjs +13 -2
- package/lh-plugins/uiauto-explorer/runner.mjs +15 -2
- package/lh-plugins/uiauto-explorer/sessions.mjs +305 -17
- package/lh-plugins/uiauto-node.mjs +102 -11
- package/lh-plugins/uiauto-prompt.mjs +20 -15
- package/lh-plugins/uiauto-sso.mjs +407 -0
- package/package.json +5 -2
- package/skills/case-execution/SKILL.md +30 -0
- package/skills/lantern-defect-submit/SKILL.md +15 -0
- package/skills/lantern-workflow/SKILL.md +57 -0
- package/skills/office/SKILL.md +26 -0
- package/dist/_astro/Base.Bkt1lrgu.css +0 -1
- package/dist/_astro/Base.astro_astro_type_script_index_0_lang.UKTVQqk7.js +0 -2
- package/dist/_astro/CaseExecBoard.DICluCbK.js +0 -1
- package/dist/_astro/CaseGenerateApp.Be3h5XPG.js +0 -10
- package/dist/_astro/CasesLibrary.Buys7Cy-.js +0 -21
- package/dist/_astro/ChatApp.D3BheKci.js +0 -227
- package/dist/_astro/DashboardBoard.Qvf8o4v1.js +0 -5
- package/dist/_astro/DocsFileBrowser.DwKBffbM.js +0 -1
- package/dist/_astro/KnowledgeLibrary.MDpMqeOd.js +0 -1
- package/dist/_astro/LifeKrTasksBoard.DsvW_S66.js +0 -1
- package/dist/_astro/LifeKrTodosBoard.D2KTqvg1.js +0 -1
- package/dist/_astro/LifeObjectivesBoard.B0cDK934.js +0 -1
- package/dist/_astro/LifePlanTypeSelect.BELDvMWU.js +0 -1
- package/dist/_astro/LifeStagesBoard.CZftLR9K.js +0 -1
- package/dist/_astro/LifeYearCycleSelect.Bw2eRbSm.js +0 -1
- package/dist/_astro/LifeYearPlansBoard.DB-RJFEl.js +0 -1
- package/dist/_astro/MultiSelectDropdown.CBC7aNOv.js +0 -1
- package/dist/_astro/NavLibraries.DdQYsZbe.js +0 -1
- package/dist/_astro/OverflowHint.CHZeFfUj.js +0 -1
- package/dist/_astro/PluginsPage.C1JnInH4.js +0 -17
- package/dist/_astro/PluginsPage.C3eEwy3K.js +0 -1
- package/dist/_astro/PmBugsBoard.CGpXUTPu.js +0 -1
- package/dist/_astro/PmIterationsBoard.BaKiFIam.js +0 -1
- package/dist/_astro/PmProjectsBoard.BxoMF9gK.js +0 -1
- package/dist/_astro/PmRequirementsBoard.-SI8VZXI.js +0 -1
- package/dist/_astro/PmRequirementsBoard.DsK6RF7Q.js +0 -1
- package/dist/_astro/PmShared.BK8kWRSV.js +0 -1
- package/dist/_astro/PromptMountDialog.mrTx3U5T.js +0 -1
- package/dist/_astro/PromptsLibrary.B_SUf47p.js +0 -1
- package/dist/_astro/ReportsPage.B9lGg1_s.js +0 -16
- package/dist/_astro/ReqAnalysisBoard.CIZKnCQH.js +0 -39
- package/dist/_astro/RequirementsLibrary.cJc-bnGQ.js +0 -1
- package/dist/_astro/SearchableSelect.SyLRS-Jj.js +0 -1
- package/dist/_astro/SelectDropdown.T3CKHaLt.js +0 -1
- package/dist/_astro/SettingsDialog.DYdtCvLc.js +0 -1
- package/dist/_astro/SpaceSwitcher.C47_S1g9.js +0 -7
- package/dist/_astro/TasksBoard.BUEg2BYk.js +0 -1
- package/dist/_astro/TemplatesLibrary.BLVIphXO.js +0 -1
- package/dist/_astro/TestReportsLibrary.DVq30Jae.js +0 -1
- package/dist/_astro/TestStatsBoard.-5BWQ6bI.js +0 -1
- package/dist/_astro/Toast.BO2NFckG.js +0 -1
- package/dist/_astro/TodosBoard.DI_lTp2e.js +0 -1
- package/dist/_astro/UiAutoBoard.ChFdgv7s.js +0 -2
- package/dist/_astro/UiAutoEnvPanel.B50q4kYb.js +0 -19
- package/dist/_astro/UiAutoGenerationDialog.CLkFAHrm.js +0 -1
- package/dist/_astro/UiAutoProjectsPage.DCsDeN5d.js +0 -3
- package/dist/_astro/app-config.DkyjuL-S.js +0 -1
- package/dist/_astro/app-version.Cy-5oZO2.js +0 -1
- package/dist/_astro/case-gen-run.BklG1H8k.js +0 -22
- package/dist/_astro/case-types.DlFkbZJN.js +0 -1
- package/dist/_astro/dialog.DZHZCe_T.js +0 -1
- package/dist/_astro/doc-roots.CO3IBiY6.js +0 -1
- package/dist/_astro/i18n.D_aOCHSN.js +0 -7
- package/dist/_astro/markdown-client.BS19nLL3.js +0 -62
- package/dist/_astro/plugins.BRvXWHLe.js +0 -1
- package/dist/_astro/project-docs.CCjtiFjB.js +0 -1
- package/dist/_astro/prompts-meta.BUGutlsk.js +0 -2
- package/dist/_astro/report-prompt.B9C4cv84.js +0 -1
- package/dist/_astro/req-analysis.B12_MGMQ.js +0 -31
- package/dist/_astro/story-review.D2W5tEOY.js +0 -14
- package/dist/_astro/test-reports.CuIjlEyK.js +0 -19
- package/dist/_astro/ui-auto-prompt.H9_yhau9.js +0 -9
- package/dist/_astro/ui-auto.DMv940x4.js +0 -1
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon" type="image/png" sizes="32x32" href="/brand/favicon.png"><link rel="apple-touch-icon" href="/brand/apple-touch-icon.png"><title>缺陷规则 · Lantern Harness</title><script>
|
|
2
|
+
// 尽早禁用滚动恢复,避免整页跳转/切页时停在旧滚动位置造成文字叠影
|
|
3
|
+
try {
|
|
4
|
+
if ('scrollRestoration' in history) history.scrollRestoration = 'manual';
|
|
5
|
+
} catch (e) {}
|
|
6
|
+
</script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.XUV2H6ea.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
|
+
/**
|
|
8
|
+
* 侧栏高亮兜底:按当前路径只留一个 is-active。
|
|
9
|
+
*
|
|
10
|
+
* React 岛屿(client:only + transition:persist)在某些场景会停在旧模块上
|
|
11
|
+
* (HMR 失败 / 缓存片段叠加),子路由相同的两个入口(自动化执行、自动化项目)
|
|
12
|
+
* 就可能同时亮着。这里不依赖岛屿,直接用 anchor href 的最长匹配校正一遍。
|
|
13
|
+
*/
|
|
14
|
+
(function () {
|
|
15
|
+
var dec = function (p) {
|
|
16
|
+
return (p || '/').replace(/\/+$/, '') || '/';
|
|
17
|
+
};
|
|
18
|
+
function syncNavActive() {
|
|
19
|
+
var host = document.querySelector('.tw-nav-libraries');
|
|
20
|
+
if (!host) return;
|
|
21
|
+
var here = dec(location.pathname);
|
|
22
|
+
var links = host.querySelectorAll('a.tw-nav-item-main');
|
|
23
|
+
// 岛屿还没渲染出菜单时不要动占位:否则首屏会短暂没有任何高亮
|
|
24
|
+
if (!links.length) return;
|
|
25
|
+
var best = null;
|
|
26
|
+
var bestLen = -1;
|
|
27
|
+
for (var i = 0; i < links.length; i++) {
|
|
28
|
+
var raw = (links[i].getAttribute('href') || '').split(/[?#]/)[0];
|
|
29
|
+
if (!raw) continue;
|
|
30
|
+
var target = dec(raw);
|
|
31
|
+
if (here !== target && here.indexOf(target + '/') !== 0) continue;
|
|
32
|
+
if (target.length > bestLen) {
|
|
33
|
+
bestLen = target.length;
|
|
34
|
+
best = links[i];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
var rows = host.querySelectorAll('.tw-nav-item');
|
|
38
|
+
for (var j = 0; j < rows.length; j++) {
|
|
39
|
+
if (rows[j].classList.contains('tw-nav-summary')) continue;
|
|
40
|
+
rows[j].classList.remove('is-active');
|
|
41
|
+
rows[j].classList.remove('font-medium');
|
|
42
|
+
}
|
|
43
|
+
if (!best) return;
|
|
44
|
+
var row = best.closest('.tw-nav-item');
|
|
45
|
+
if (!row) return;
|
|
46
|
+
row.classList.add('is-active');
|
|
47
|
+
row.classList.add('font-medium');
|
|
48
|
+
}
|
|
49
|
+
function schedule() {
|
|
50
|
+
syncNavActive();
|
|
51
|
+
setTimeout(syncNavActive, 80);
|
|
52
|
+
setTimeout(syncNavActive, 320);
|
|
53
|
+
}
|
|
54
|
+
if (document.readyState === 'loading') {
|
|
55
|
+
document.addEventListener('DOMContentLoaded', schedule);
|
|
56
|
+
} else {
|
|
57
|
+
schedule();
|
|
58
|
+
}
|
|
59
|
+
document.addEventListener('astro:page-load', schedule);
|
|
60
|
+
})();
|
|
61
|
+
</script><script>
|
|
62
|
+
(function () {
|
|
63
|
+
try {
|
|
64
|
+
// 配置按空间分键(`tw.app.config.v1::<spaceId>`),主题必须从同一个键读,
|
|
65
|
+
// 否则深色下刷新会先按浅色画一帧、等脚本跑完才变黑(闪白)。
|
|
66
|
+
var earlySpaceId = (
|
|
67
|
+
sessionStorage.getItem('tw.space.active-id') ||
|
|
68
|
+
localStorage.getItem('tw.space.active-id') ||
|
|
69
|
+
''
|
|
70
|
+
).trim();
|
|
71
|
+
var raw =
|
|
72
|
+
(earlySpaceId ? localStorage.getItem('tw.app.config.v1::' + earlySpaceId) : null) ||
|
|
73
|
+
localStorage.getItem('tw.app.config.v1');
|
|
74
|
+
var cfg = raw ? JSON.parse(raw) : null;
|
|
75
|
+
var g = (cfg && cfg.general) || {};
|
|
76
|
+
var root = document.documentElement;
|
|
77
|
+
if (raw) {
|
|
78
|
+
var size = typeof g.sessionFontSize === 'number' ? Math.round(g.sessionFontSize) : 14;
|
|
79
|
+
if (size < 12) size = 12;
|
|
80
|
+
if (size > 22) size = 22;
|
|
81
|
+
var px = size + 'px';
|
|
82
|
+
root.style.setProperty('--tw-ui-font-size', px);
|
|
83
|
+
root.style.setProperty('--tw-session-font-size', px);
|
|
84
|
+
if (g.language === 'en') root.lang = 'en';
|
|
85
|
+
}
|
|
86
|
+
// 没有配置时按系统偏好定主题:早一帧定下来,页面就不会先亮后暗
|
|
87
|
+
var appearance = g.appearance;
|
|
88
|
+
var theme =
|
|
89
|
+
appearance === 'dark' || appearance === 'light'
|
|
90
|
+
? appearance
|
|
91
|
+
: window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
92
|
+
? 'dark'
|
|
93
|
+
: 'light';
|
|
94
|
+
root.dataset.theme = theme;
|
|
95
|
+
root.style.colorScheme = theme;
|
|
96
|
+
if (localStorage.getItem('tw.nav.collapsed') === '1') {
|
|
97
|
+
document.documentElement.dataset.navCollapsed = '1';
|
|
98
|
+
}
|
|
99
|
+
var spaceId = earlySpaceId;
|
|
100
|
+
var cfgKey = spaceId ? 'tw.app.config.v1::' + spaceId : 'tw.app.config.v1';
|
|
101
|
+
var cfgRaw = localStorage.getItem(cfgKey) || localStorage.getItem('tw.app.config.v1');
|
|
102
|
+
if (cfgRaw) {
|
|
103
|
+
var savedCfg = JSON.parse(cfgRaw) || {};
|
|
104
|
+
var plugins = savedCfg.plugins || {};
|
|
105
|
+
if (plugins.cases === false) document.documentElement.dataset.pluginOffCases = '1';
|
|
106
|
+
if (plugins.todos === false) document.documentElement.dataset.pluginOffTodos = '1';
|
|
107
|
+
if (plugins.tasks === false) document.documentElement.dataset.pluginOffTasks = '1';
|
|
108
|
+
if (plugins.projects !== true) document.documentElement.dataset.pluginOffProjects = '1';
|
|
109
|
+
if (plugins.iterations !== true)
|
|
110
|
+
document.documentElement.dataset.pluginOffIterations = '1';
|
|
111
|
+
if (plugins.pmRequirements !== true)
|
|
112
|
+
document.documentElement.dataset.pluginOffPmRequirements = '1';
|
|
113
|
+
if (plugins.bugs !== true) document.documentElement.dataset.pluginOffBugs = '1';
|
|
114
|
+
if (plugins.reports !== true) document.documentElement.dataset.pluginOffReports = '1';
|
|
115
|
+
if (plugins.testStats !== true)
|
|
116
|
+
document.documentElement.dataset.pluginOffTestStats = '1';
|
|
117
|
+
if (plugins.caseExec !== true) document.documentElement.dataset.pluginOffCaseExec = '1';
|
|
118
|
+
if (plugins.caseExecution !== true)
|
|
119
|
+
document.documentElement.dataset.pluginOffCaseExecution = '1';
|
|
120
|
+
if (plugins.dashboard !== true)
|
|
121
|
+
document.documentElement.dataset.pluginOffDashboard = '1';
|
|
122
|
+
if (plugins.knowledgeLib === false)
|
|
123
|
+
document.documentElement.dataset.pluginOffKnowledgeLib = '1';
|
|
124
|
+
if (plugins.requirements === false)
|
|
125
|
+
document.documentElement.dataset.pluginOffRequirements = '1';
|
|
126
|
+
if (plugins.templates === false)
|
|
127
|
+
document.documentElement.dataset.pluginOffTemplates = '1';
|
|
128
|
+
if (plugins.testReports === false)
|
|
129
|
+
document.documentElement.dataset.pluginOffTestReports = '1';
|
|
130
|
+
// 本地已有菜单布局:静态占位(固定顺序平铺)不再亮相,避免闪一下「排序前」
|
|
131
|
+
if (Array.isArray(savedCfg.navGroups) || Array.isArray(savedCfg.navOrder)) {
|
|
132
|
+
document.documentElement.dataset.navCached = '1';
|
|
133
|
+
// 兜底:脚本没跑起来(岛始终为空)时把占位放回来,别让侧栏彻底空着
|
|
134
|
+
window.setTimeout(function () {
|
|
135
|
+
var island = document.querySelector('.tw-nav-libraries astro-island');
|
|
136
|
+
if (!island || !island.querySelector('.tw-nav-item-main')) {
|
|
137
|
+
document.documentElement.removeAttribute('data-nav-cached');
|
|
138
|
+
}
|
|
139
|
+
}, 3000);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 有了侧栏刷新缓存(上次真实渲染的 DOM)也不必再摆平铺占位:
|
|
143
|
+
// 否则收起的分组会先以「平铺展开」的样子闪一下再变成分组
|
|
144
|
+
try {
|
|
145
|
+
var navCacheKey = spaceId ? 'tw.hydrate.nav::' + spaceId : 'tw.hydrate.nav';
|
|
146
|
+
if (localStorage.getItem(navCacheKey)) {
|
|
147
|
+
document.documentElement.dataset.navCached = '1';
|
|
148
|
+
window.setTimeout(function () {
|
|
149
|
+
var island = document.querySelector('.tw-nav-libraries astro-island');
|
|
150
|
+
if (!island || !island.querySelector('.tw-nav-item-main')) {
|
|
151
|
+
document.documentElement.removeAttribute('data-nav-cached');
|
|
152
|
+
}
|
|
153
|
+
}, 3000);
|
|
154
|
+
}
|
|
155
|
+
} catch (e) {
|
|
156
|
+
/* ignore */
|
|
157
|
+
}
|
|
158
|
+
} catch (e) {}
|
|
159
|
+
})();
|
|
160
|
+
</script><link rel="stylesheet" href="/_astro/Base.Du_-4L-4.css"><link rel="stylesheet" href="/_astro/defect-submit.Dc49lFjm.css"><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) {
|
|
161
|
+
animation-duration: 180ms;
|
|
162
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
163
|
+
animation-fill-mode: both;
|
|
164
|
+
animation-name: astroFadeOut; }::view-transition-new(astro-bbhp3f5g-3) {
|
|
165
|
+
animation-duration: 180ms;
|
|
166
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
167
|
+
animation-fill-mode: both;
|
|
168
|
+
animation-name: astroFadeIn; }[data-astro-transition=back]::view-transition-old(astro-bbhp3f5g-3) {
|
|
169
|
+
animation-duration: 180ms;
|
|
170
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
171
|
+
animation-fill-mode: both;
|
|
172
|
+
animation-name: astroFadeOut; }[data-astro-transition=back]::view-transition-new(astro-bbhp3f5g-3) {
|
|
173
|
+
animation-duration: 180ms;
|
|
174
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
175
|
+
animation-fill-mode: both;
|
|
176
|
+
animation-name: astroFadeIn; } }[data-astro-transition-fallback="old"] [data-astro-transition-scope="astro-bbhp3f5g-3"],
|
|
177
|
+
[data-astro-transition-fallback="old"][data-astro-transition-scope="astro-bbhp3f5g-3"] {
|
|
178
|
+
animation-duration: 180ms;
|
|
179
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
180
|
+
animation-fill-mode: both;
|
|
181
|
+
animation-name: astroFadeOut; }[data-astro-transition-fallback="new"] [data-astro-transition-scope="astro-bbhp3f5g-3"],
|
|
182
|
+
[data-astro-transition-fallback="new"][data-astro-transition-scope="astro-bbhp3f5g-3"] {
|
|
183
|
+
animation-duration: 180ms;
|
|
184
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
185
|
+
animation-fill-mode: both;
|
|
186
|
+
animation-name: astroFadeIn; }[data-astro-transition=back][data-astro-transition-fallback="old"] [data-astro-transition-scope="astro-bbhp3f5g-3"],
|
|
187
|
+
[data-astro-transition=back][data-astro-transition-fallback="old"][data-astro-transition-scope="astro-bbhp3f5g-3"] {
|
|
188
|
+
animation-duration: 180ms;
|
|
189
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
190
|
+
animation-fill-mode: both;
|
|
191
|
+
animation-name: astroFadeOut; }[data-astro-transition=back][data-astro-transition-fallback="new"] [data-astro-transition-scope="astro-bbhp3f5g-3"],
|
|
192
|
+
[data-astro-transition=back][data-astro-transition-fallback="new"][data-astro-transition-scope="astro-bbhp3f5g-3"] {
|
|
193
|
+
animation-duration: 180ms;
|
|
194
|
+
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
195
|
+
animation-fill-mode: both;
|
|
196
|
+
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" data-astro-reload><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.2.2">v0.2.2<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.DSUVAPOi.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.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="/workbench/" 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><a href="/plugins/" class="tw-nav-item"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 7h16v13H4zM8 7V4h8v3M9 12h6M12 9v6"></path></svg><span class="tw-nav-label">插件仓库</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="/case-execution/" class="tw-nav-item" data-plugin-nav="caseExecution"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4h14v16H5z"></path><path d="M8 8h8M8 12h8M8 16h5"></path></svg><span class="tw-nav-label" data-i18n="nav.caseExecution">用例执行</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><a href="/test-reports/" class="tw-nav-item" data-plugin-nav="testReports" data-i18n-hint="nav.testReports"><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.testReports">报告管理</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.DVR5Ua-S.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.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><script>(function(){const host = ".tw-nav-libraries";
|
|
197
|
+
const cacheKey = "tw.hydrate.nav";
|
|
198
|
+
const fixActive = true;
|
|
199
|
+
const capture = false;
|
|
200
|
+
const syncNavGroups = true;
|
|
201
|
+
|
|
202
|
+
(function () {
|
|
203
|
+
try {
|
|
204
|
+
var target = document.querySelector(host);
|
|
205
|
+
if (!target) return;
|
|
206
|
+
var spaceId = (
|
|
207
|
+
sessionStorage.getItem('tw.space.active-id') ||
|
|
208
|
+
localStorage.getItem('tw.space.active-id') ||
|
|
209
|
+
''
|
|
210
|
+
).trim();
|
|
211
|
+
var key = spaceId ? cacheKey + '::' + spaceId : cacheKey;
|
|
212
|
+
var html = localStorage.getItem(key);
|
|
213
|
+
var island = target.querySelector('astro-island');
|
|
214
|
+
|
|
215
|
+
// 「插件未启用」这类提示不该被缓存,否则启用后刷新还会先闪一下旧提示
|
|
216
|
+
if (html && html.indexOf('tw-lib-notice') !== -1) {
|
|
217
|
+
try {
|
|
218
|
+
localStorage.removeItem(key);
|
|
219
|
+
} catch (e) {
|
|
220
|
+
/* ignore */
|
|
221
|
+
}
|
|
222
|
+
html = null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (html) {
|
|
226
|
+
var tpl = document.createElement('template');
|
|
227
|
+
tpl.innerHTML = html;
|
|
228
|
+
var nodes = Array.prototype.slice.call(tpl.content.children || []);
|
|
229
|
+
if (nodes.length) {
|
|
230
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
231
|
+
nodes[i].setAttribute('data-hydrate-cache', '');
|
|
232
|
+
nodes[i].setAttribute('aria-hidden', 'true');
|
|
233
|
+
}
|
|
234
|
+
// 侧栏分组:缓存里的展开 / 收起状态可能过期(用户收起后又刷新),
|
|
235
|
+
// 按 localStorage 校正一遍再插入,避免「先展开、再收起」闪一下
|
|
236
|
+
if (syncNavGroups) {
|
|
237
|
+
for (var gi = 0; gi < nodes.length; gi++) {
|
|
238
|
+
// 缓存片段是按岛屿的顶层子节点逐个存的:分组本身就是顶层 <details>,
|
|
239
|
+
// 只查后代会漏掉它,所以自己也要算一个候选
|
|
240
|
+
var candidates = [nodes[gi]];
|
|
241
|
+
var nested = nodes[gi].querySelectorAll
|
|
242
|
+
? nodes[gi].querySelectorAll('[data-nav-group]')
|
|
243
|
+
: [];
|
|
244
|
+
for (var ni = 0; ni < nested.length; ni++) candidates.push(nested[ni]);
|
|
245
|
+
for (var gj = 0; gj < candidates.length; gj++) {
|
|
246
|
+
var groupEl = candidates[gj];
|
|
247
|
+
if (!groupEl.hasAttribute || !groupEl.hasAttribute('data-nav-group')) continue;
|
|
248
|
+
var gid = groupEl.getAttribute('data-nav-group');
|
|
249
|
+
if (!gid) continue;
|
|
250
|
+
var gKey = 'tw.nav.groupOpen.' + gid;
|
|
251
|
+
if (spaceId) gKey += '::' + spaceId;
|
|
252
|
+
var gVal = null;
|
|
253
|
+
try {
|
|
254
|
+
gVal = localStorage.getItem(gKey);
|
|
255
|
+
} catch (e) {
|
|
256
|
+
/* ignore */
|
|
257
|
+
}
|
|
258
|
+
if (gVal === '0') groupEl.removeAttribute('open');
|
|
259
|
+
else if (gVal === '1') groupEl.setAttribute('open', '');
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// 片段并列插入:挂在岛屿前面,挂载后由 CSS 隐藏
|
|
264
|
+
var frag = document.createDocumentFragment();
|
|
265
|
+
for (var j = 0; j < nodes.length; j++) frag.appendChild(nodes[j]);
|
|
266
|
+
if (island && island.parentNode === target) target.insertBefore(frag, island);
|
|
267
|
+
else target.appendChild(frag);
|
|
268
|
+
|
|
269
|
+
if (fixActive) {
|
|
270
|
+
// 缓存里的高亮是上一次停留的页面,按当前路径重新点亮
|
|
271
|
+
var here = location.pathname.replace(/\/+$/, '') || '/';
|
|
272
|
+
var marks = target.querySelectorAll(
|
|
273
|
+
'[data-hydrate-cache].is-active, [data-hydrate-cache] .is-active',
|
|
274
|
+
);
|
|
275
|
+
for (var k = 0; k < marks.length; k++) marks[k].classList.remove('is-active');
|
|
276
|
+
var links = target.querySelectorAll('[data-hydrate-cache] a.tw-nav-item-main');
|
|
277
|
+
for (var m = 0; m < links.length; m++) {
|
|
278
|
+
var href = (links[m].getAttribute('href') || '').split(/[?#]/)[0].replace(/\/+$/, '');
|
|
279
|
+
if (href && href === here) {
|
|
280
|
+
var row = links[m].closest('.tw-nav-item');
|
|
281
|
+
if (row) row.classList.add('is-active');
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!island) return;
|
|
289
|
+
|
|
290
|
+
/*
|
|
291
|
+
* 缓存已经铺上了:先给 host 打个标记,CSS 会把岛屿整块藏起来(缓存独占),
|
|
292
|
+
* 等真实内容就绪再撤。没有缓存时不打标记,走原来的 loading 骨架。
|
|
293
|
+
*/
|
|
294
|
+
var pendingMarked = false;
|
|
295
|
+
function markPending() {
|
|
296
|
+
if (pendingMarked || !html) return;
|
|
297
|
+
pendingMarked = true;
|
|
298
|
+
target.setAttribute('data-hydrate-pending', '');
|
|
299
|
+
// 兜底:页面一直加载不出来时别把岛屿永远藏着
|
|
300
|
+
setTimeout(function () {
|
|
301
|
+
target.removeAttribute('data-hydrate-pending');
|
|
302
|
+
}, 8000);
|
|
303
|
+
}
|
|
304
|
+
function unmarkPending() {
|
|
305
|
+
target.removeAttribute('data-hydrate-pending');
|
|
306
|
+
}
|
|
307
|
+
markPending();
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* 岛屿处于首屏 loading:此时缓存片段继续占位(CSS 同时把岛屿藏起来)。
|
|
311
|
+
* `.tw-lib-spin` / `aria-busy` 是各页面 loading 骨架的统一特征。
|
|
312
|
+
*/
|
|
313
|
+
function isPending() {
|
|
314
|
+
return Boolean(
|
|
315
|
+
island.querySelector('.tw-hydrate-pending, [aria-busy="true"], .tw-lib-spin'),
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** 撤掉缓存片段(含淡出中的) */
|
|
320
|
+
function dropCache() {
|
|
321
|
+
var kids = Array.prototype.slice.call(target.children);
|
|
322
|
+
for (var i = 0; i < kids.length; i++) {
|
|
323
|
+
if (kids[i].hasAttribute && kids[i].hasAttribute('data-hydrate-cache')) {
|
|
324
|
+
kids[i].parentNode.removeChild(kids[i]);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** 列出当前缓存节点 */
|
|
330
|
+
function cacheNodes() {
|
|
331
|
+
var out = [];
|
|
332
|
+
var kids = target.children;
|
|
333
|
+
for (var i = 0; i < kids.length; i++) {
|
|
334
|
+
if (kids[i].hasAttribute && kids[i].hasAttribute('data-hydrate-cache')) {
|
|
335
|
+
out.push(kids[i]);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return out;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
var timer = 0;
|
|
342
|
+
var settled = false;
|
|
343
|
+
var saved = '';
|
|
344
|
+
/** 单页缓存上限:列表页的 DOM 可能有两三百 KB,超过就不存(仍走正常加载) */
|
|
345
|
+
var MAX_HTML = 600000;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* 所有页面的刷新缓存共用一份预算(3MB):超了就先扔最大的旧页面缓存,
|
|
349
|
+
* 不去碰 nav / 自动化测试的缓存(这两处最常驻,扔了会明显闪)。
|
|
350
|
+
* 不做这一步的话 localStorage 5MB 配额会被几个大列表页吃光。
|
|
351
|
+
*/
|
|
352
|
+
var PAGE_CACHE_BUDGET = 3 * 1024 * 1024;
|
|
353
|
+
function trimOtherPageCaches(needBytes) {
|
|
354
|
+
var entries = [];
|
|
355
|
+
for (var i = 0; i < localStorage.length; i++) {
|
|
356
|
+
var k = localStorage.key(i);
|
|
357
|
+
if (!k || k === key) continue;
|
|
358
|
+
if (k.indexOf('tw.hydrate.') !== 0) continue;
|
|
359
|
+
if (k.indexOf('tw.hydrate.nav') === 0 || k.indexOf('tw.hydrate.ui-auto') === 0) continue;
|
|
360
|
+
entries.push({ k: k, len: (localStorage.getItem(k) || '').length });
|
|
361
|
+
}
|
|
362
|
+
var total = entries.reduce(function (sum, e) {
|
|
363
|
+
return sum + e.len;
|
|
364
|
+
}, needBytes);
|
|
365
|
+
entries.sort(function (a, b) {
|
|
366
|
+
return b.len - a.len;
|
|
367
|
+
});
|
|
368
|
+
for (var j = 0; j < entries.length && total > PAGE_CACHE_BUDGET; j++) {
|
|
369
|
+
try {
|
|
370
|
+
localStorage.removeItem(entries[j].k);
|
|
371
|
+
total -= entries[j].len;
|
|
372
|
+
} catch (e) {
|
|
373
|
+
/* ignore */
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function saveCache(html) {
|
|
379
|
+
if (!html || html === saved || html.length > MAX_HTML) return;
|
|
380
|
+
trimOtherPageCaches(html.length);
|
|
381
|
+
try {
|
|
382
|
+
localStorage.setItem(key, html);
|
|
383
|
+
saved = html;
|
|
384
|
+
return;
|
|
385
|
+
} catch (e) {
|
|
386
|
+
// 配额满:腾掉其它页面缓存再试一次
|
|
387
|
+
}
|
|
388
|
+
trimOtherPageCaches(html.length);
|
|
389
|
+
try {
|
|
390
|
+
localStorage.setItem(key, html);
|
|
391
|
+
saved = html;
|
|
392
|
+
} catch (e) {
|
|
393
|
+
/* 隐私模式 / 配额仍然不足:放弃缓存 */
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/** 把当前渲染结果存一份(页面在数据变化后离开时也调用,缓存不会停在首屏) */
|
|
398
|
+
function persistNow() {
|
|
399
|
+
if (!capture) return;
|
|
400
|
+
if (!island.firstElementChild || isPending()) return;
|
|
401
|
+
// 只渲染了提示(插件关闭 / 服务未就绪)时不缓存
|
|
402
|
+
var first = island.firstElementChild;
|
|
403
|
+
if (first && first.classList && first.classList.contains('tw-lib-notice')) return;
|
|
404
|
+
saveCache(island.innerHTML.trim());
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* 真实内容就绪后换层:
|
|
409
|
+
* 1) 先把缓存改成绝对叠层(仍盖住画面)
|
|
410
|
+
* 2) 再撤 pending,露出底下已排好的岛屿
|
|
411
|
+
* 3) 缓存短淡出后删除
|
|
412
|
+
* 切勿在撤 pending 前让缓存仍是 in-flow —— 会和岛屿并排把布局摊成两半。
|
|
413
|
+
*/
|
|
414
|
+
function flush() {
|
|
415
|
+
timer = 0;
|
|
416
|
+
if (settled) return;
|
|
417
|
+
if (!island.firstElementChild) return;
|
|
418
|
+
if (isPending()) return;
|
|
419
|
+
|
|
420
|
+
settled = true;
|
|
421
|
+
mo.disconnect();
|
|
422
|
+
|
|
423
|
+
var caches = cacheNodes();
|
|
424
|
+
if (!caches.length) {
|
|
425
|
+
unmarkPending();
|
|
426
|
+
persistNow();
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
var pendingFade = caches.length;
|
|
431
|
+
function doneOne() {
|
|
432
|
+
pendingFade -= 1;
|
|
433
|
+
if (pendingFade <= 0) dropCache();
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
for (var i = 0; i < caches.length; i++) {
|
|
437
|
+
(function (el) {
|
|
438
|
+
el.setAttribute('data-hydrate-leaving', '');
|
|
439
|
+
var finished = false;
|
|
440
|
+
function finish() {
|
|
441
|
+
if (finished) return;
|
|
442
|
+
finished = true;
|
|
443
|
+
el.removeEventListener('transitionend', onEnd);
|
|
444
|
+
if (el.parentNode) el.parentNode.removeChild(el);
|
|
445
|
+
doneOne();
|
|
446
|
+
}
|
|
447
|
+
function onEnd(ev) {
|
|
448
|
+
if (ev && ev.target !== el) return;
|
|
449
|
+
if (ev && ev.propertyName && ev.propertyName !== 'opacity') return;
|
|
450
|
+
finish();
|
|
451
|
+
}
|
|
452
|
+
el.addEventListener('transitionend', onEnd);
|
|
453
|
+
setTimeout(finish, 200);
|
|
454
|
+
})(caches[i]);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// 读一次布局,确保 leaving 的 absolute 已生效,再露岛屿
|
|
458
|
+
void caches[0].offsetWidth;
|
|
459
|
+
unmarkPending();
|
|
460
|
+
persistNow();
|
|
461
|
+
|
|
462
|
+
// 下一帧再收透明度,保证能跑上 transition(同帧改 opacity 常被合成跳过)
|
|
463
|
+
requestAnimationFrame(function () {
|
|
464
|
+
for (var j = 0; j < caches.length; j++) {
|
|
465
|
+
if (caches[j].parentNode) caches[j].style.opacity = '0';
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// 离开页面 / 切到后台时再存一次:列表增删改之后,下次刷新看到的是最新一屏
|
|
471
|
+
window.addEventListener('pagehide', persistNow);
|
|
472
|
+
document.addEventListener('visibilitychange', function () {
|
|
473
|
+
if (document.visibilityState === 'hidden') persistNow();
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
function schedule() {
|
|
477
|
+
if (settled || timer) return;
|
|
478
|
+
// 内容就绪后稍等级联更新结束再换层;过长会盯着旧画面突然一跳
|
|
479
|
+
timer = setTimeout(flush, 64);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
var mo = new MutationObserver(schedule);
|
|
483
|
+
mo.observe(island, { childList: true, subtree: true, characterData: true });
|
|
484
|
+
schedule();
|
|
485
|
+
} catch (e) {
|
|
486
|
+
// 缓存坏了就当没有
|
|
487
|
+
}
|
|
488
|
+
})();
|
|
489
|
+
})();</script></div><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.db3BpFw0.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.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>
|
|
490
|
+
(function () {
|
|
491
|
+
try {
|
|
492
|
+
var raw = localStorage.getItem('tw.app.model.v1');
|
|
493
|
+
if (!raw) return;
|
|
494
|
+
var model = JSON.parse(raw) || {};
|
|
495
|
+
var list = Array.isArray(model.providers) ? model.providers : [];
|
|
496
|
+
var active = null;
|
|
497
|
+
for (var i = 0; i < list.length; i++) {
|
|
498
|
+
if (list[i] && list[i].id === model.activeId) {
|
|
499
|
+
active = list[i];
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (!active && list.length) active = list[0];
|
|
504
|
+
var name = active && active.name ? String(active.name).trim() : '';
|
|
505
|
+
if (!name) return;
|
|
506
|
+
var el = document.querySelector('.tw-nav-provider-name');
|
|
507
|
+
if (!el) return;
|
|
508
|
+
el.textContent = name;
|
|
509
|
+
var chip = el.closest('.tw-nav-provider-chip');
|
|
510
|
+
if (chip) {
|
|
511
|
+
chip.classList.remove('is-empty');
|
|
512
|
+
var m = active.model ? ' · ' + String(active.model).trim() : '';
|
|
513
|
+
chip.setAttribute('data-hint', name + m);
|
|
514
|
+
}
|
|
515
|
+
} catch (e) {
|
|
516
|
+
/* ignore */
|
|
517
|
+
}
|
|
518
|
+
})();
|
|
519
|
+
</script><script data-astro-rerun>
|
|
520
|
+
(function () {
|
|
521
|
+
var root = document.documentElement;
|
|
522
|
+
var btn = document.getElementById('tw-nav-toggle');
|
|
523
|
+
function apply(collapsed) {
|
|
524
|
+
if (collapsed) root.dataset.navCollapsed = '1';
|
|
525
|
+
else delete root.dataset.navCollapsed;
|
|
526
|
+
try {
|
|
527
|
+
localStorage.setItem('tw.nav.collapsed', collapsed ? '1' : '0');
|
|
528
|
+
} catch (e) {}
|
|
529
|
+
if (btn) {
|
|
530
|
+
btn.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
|
|
531
|
+
// 气泡已移除;改为动态更新不可见标签,读屏仍能获知当前动作
|
|
532
|
+
btn.setAttribute('aria-label', collapsed ? '展开导航' : '收起导航');
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
apply(root.dataset.navCollapsed === '1');
|
|
536
|
+
if (btn) {
|
|
537
|
+
btn.addEventListener('click', function () {
|
|
538
|
+
apply(root.dataset.navCollapsed !== '1');
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
try {
|
|
543
|
+
var raw = localStorage.getItem('tw.app.config.v1');
|
|
544
|
+
if (!raw) return;
|
|
545
|
+
var g = JSON.parse(raw).general || {};
|
|
546
|
+
if (g.language !== 'en') return;
|
|
547
|
+
var en = {
|
|
548
|
+
'nav.brand': 'Lantern Harness',
|
|
549
|
+
'nav.home': 'My Workbench',
|
|
550
|
+
'nav.dashboard': 'Dashboard',
|
|
551
|
+
'nav.tasks': 'Tasks',
|
|
552
|
+
'nav.todos': 'Todos',
|
|
553
|
+
'nav.projects': 'Projects',
|
|
554
|
+
'nav.iterations': 'Iterations',
|
|
555
|
+
'nav.requirementsMgmt': 'Requirements Mgmt',
|
|
556
|
+
'nav.bugs': 'Bugs',
|
|
557
|
+
'nav.reports': 'Work Report',
|
|
558
|
+
'nav.testStats': 'Test Statistics',
|
|
559
|
+
'nav.caseExec': 'Case Execution',
|
|
560
|
+
'nav.caseExecution': 'Case Runs',
|
|
561
|
+
'nav.uiAutoProjects': 'Automation Projects',
|
|
562
|
+
'nav.uiAuto': 'Automation Runs',
|
|
563
|
+
'nav.reqAnalysis': 'Requirement Analysis',
|
|
564
|
+
'nav.reqBreakdowns': 'Requirement Breakdowns',
|
|
565
|
+
'nav.caseManage': 'Test Cases',
|
|
566
|
+
'nav.knowledge': 'Knowledge Mgmt',
|
|
567
|
+
'nav.plugins': 'My Plugins',
|
|
568
|
+
'nav.docs': 'Documents',
|
|
569
|
+
'nav.requirements': 'Requirements',
|
|
570
|
+
'nav.templates': 'Test Templates',
|
|
571
|
+
'nav.testReports': 'QA Reports',
|
|
572
|
+
'nav.settings': 'Settings',
|
|
573
|
+
'nav.changelog': 'Changelog',
|
|
574
|
+
'nav.changelogShort': 'Changelog',
|
|
575
|
+
'nav.helpCenter': 'Help Center',
|
|
576
|
+
'docs.nav.title': 'Docs',
|
|
577
|
+
'docs.nav.changelog': 'Changelog',
|
|
578
|
+
'docs.nav.manual': 'User Guide',
|
|
579
|
+
'docs.nav.install': 'Install Guide',
|
|
580
|
+
'nav.repo': 'GitHub',
|
|
581
|
+
'nav.repoShort': 'Repo',
|
|
582
|
+
'nav.npm': 'npm package',
|
|
583
|
+
'nav.npmShort': 'npm',
|
|
584
|
+
'nav.site': 'Yycy Docs',
|
|
585
|
+
'nav.siteShort': 'Site',
|
|
586
|
+
'nav.board': 'Questions & suggestions',
|
|
587
|
+
'nav.boardShort': 'Suggestions',
|
|
588
|
+
};
|
|
589
|
+
document.querySelectorAll('[data-i18n]').forEach(function (el) {
|
|
590
|
+
var key = el.getAttribute('data-i18n');
|
|
591
|
+
if (key && en[key]) el.textContent = en[key];
|
|
592
|
+
});
|
|
593
|
+
document.querySelectorAll('[data-i18n-hint]').forEach(function (el) {
|
|
594
|
+
var key = el.getAttribute('data-i18n-hint');
|
|
595
|
+
if (key && en[key]) el.setAttribute('data-hint', en[key]);
|
|
596
|
+
});
|
|
597
|
+
} catch (e) {}
|
|
598
|
+
})();
|
|
599
|
+
</script><main data-astro-transition-scope="astro-bbhp3f5g-3" class="tw-main min-h-screen"><div id="tw-route-loading" class="tw-route-loading is-hidden" role="status" aria-live="polite" aria-label="页面加载中"><span class="tw-route-loading-spin" aria-hidden="true"></span></div><main class="tw-library-page tw-library-wide defect-page"><astro-island uid="Z2wUl2I" component-url="/_astro/DefectSubmitEntry.BzKXJ-zq.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{}" ssr client="only" opts="{"name":"DefectSubmitEntry","value":"react"}"></astro-island></main></main><astro-island uid="1ae4mb" component-url="/_astro/Toast.BydY-X7T.js" component-export="GlobalToastHost" renderer-url="/_astro/client.BHNTqLjv.js" props="{"data-astro-transition-persist":[0,"astro-34g7cspi-4"]}" ssr client="only" opts="{"name":"GlobalToastHost","value":"react"}" data-astro-transition-persist="astro-34g7cspi-4"></astro-island></div><script>
|
|
600
|
+
(function () {
|
|
601
|
+
/**
|
|
602
|
+
* 切页滚回顶部。
|
|
603
|
+
* 只在「换页后」重置:若在 before-preparation(点击瞬间)就重置,
|
|
604
|
+
* 当前页面会先跳回顶部、再等新页到达,用户看到的就是「打开时还在滚动」。
|
|
605
|
+
* 带锚点(#)时交给浏览器定位,不强制回顶。
|
|
606
|
+
*/
|
|
607
|
+
try {
|
|
608
|
+
if ('scrollRestoration' in history) history.scrollRestoration = 'manual';
|
|
609
|
+
} catch (e) {}
|
|
610
|
+
function twScrollTop() {
|
|
611
|
+
if (location.hash) return;
|
|
612
|
+
if (window.scrollY === 0 && document.documentElement.scrollTop === 0) return;
|
|
613
|
+
try {
|
|
614
|
+
// instant:不受将来可能加入的 scroll-behavior: smooth 影响
|
|
615
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
|
|
616
|
+
} catch (e) {
|
|
617
|
+
// 旧浏览器不认 instant,会抛 TypeError,退回普通写法
|
|
618
|
+
window.scrollTo(0, 0);
|
|
619
|
+
}
|
|
620
|
+
document.documentElement.scrollTop = 0;
|
|
621
|
+
document.body.scrollTop = 0;
|
|
622
|
+
var main = document.querySelector('.tw-main');
|
|
623
|
+
if (main) main.scrollTop = 0;
|
|
624
|
+
}
|
|
625
|
+
document.addEventListener('astro:after-swap', twScrollTop);
|
|
626
|
+
document.addEventListener('astro:page-load', twScrollTop);
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* 软导航「闪白」修复。
|
|
630
|
+
* ClientRouter 交换文档时,会用新文档 <html> 的属性整体替换当前 <html>,
|
|
631
|
+
* 于是 data-theme 连同 style 里的 color-scheme 一起被清空;在主题属性
|
|
632
|
+
* 恢复之前,color-scheme 回落到 normal,画布变白 —— 深色主题下就是
|
|
633
|
+
* 切页瞬间的闪白(与具体页面无关,所有路由都受影响)。
|
|
634
|
+
* 在交换前把主题 / 语言写进新文档的 <html>,交换完成时即已带上,不留空档。
|
|
635
|
+
*/
|
|
636
|
+
document.addEventListener('astro:before-swap', function (e) {
|
|
637
|
+
var next = e.newDocument;
|
|
638
|
+
if (!next || !next.documentElement) return;
|
|
639
|
+
var cur = document.documentElement;
|
|
640
|
+
var nextRoot = next.documentElement;
|
|
641
|
+
var theme = cur.dataset.theme;
|
|
642
|
+
if (theme) {
|
|
643
|
+
nextRoot.dataset.theme = theme;
|
|
644
|
+
nextRoot.style.colorScheme = theme;
|
|
645
|
+
}
|
|
646
|
+
if (cur.lang) nextRoot.lang = cur.lang;
|
|
647
|
+
// 新文档是「解析」出来的:head 里的内联脚本在解析阶段不会执行,
|
|
648
|
+
// 于是所有运行期写在 <html> 上的状态都不会自带。主题 / 语言之外,
|
|
649
|
+
// 侧栏收起状态与空间服务可用性同样要显式搬过去,否则每次软导航都会丢
|
|
650
|
+
// (表现为侧栏自己弹开、骨架又冒出来)。
|
|
651
|
+
if (cur.dataset.navCollapsed === '1') nextRoot.dataset.navCollapsed = '1';
|
|
652
|
+
if (cur.dataset.spaceService) nextRoot.dataset.spaceService = cur.dataset.spaceService;
|
|
653
|
+
// 插件开关同理:不搬过去会先亮出被隐藏的侧栏入口,等 page-load 再收起
|
|
654
|
+
[
|
|
655
|
+
'pluginOffTasks',
|
|
656
|
+
'pluginOffTodos',
|
|
657
|
+
'pluginOffProjects',
|
|
658
|
+
'pluginOffIterations',
|
|
659
|
+
'pluginOffPmRequirements',
|
|
660
|
+
'pluginOffBugs',
|
|
661
|
+
'pluginOffReports',
|
|
662
|
+
'pluginOffTestStats',
|
|
663
|
+
'pluginOffCaseExec',
|
|
664
|
+
'pluginOffDashboard',
|
|
665
|
+
'pluginOffCases',
|
|
666
|
+
'pluginOffKnowledgeLib',
|
|
667
|
+
'pluginOffRequirements',
|
|
668
|
+
'pluginOffTemplates',
|
|
669
|
+
].forEach(function (key) {
|
|
670
|
+
if (cur.dataset[key]) nextRoot.dataset[key] = cur.dataset[key];
|
|
671
|
+
});
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
/** 版本日志「查看更多」:委托绑定,兼容 View Transitions 软导航 */
|
|
675
|
+
document.addEventListener('click', function (e) {
|
|
676
|
+
var t = e.target;
|
|
677
|
+
if (!(t instanceof Element)) return;
|
|
678
|
+
var btn = t.closest('.tw-changelog-toggle');
|
|
679
|
+
if (!(btn instanceof HTMLButtonElement)) return;
|
|
680
|
+
var card = btn.closest('.tw-changelog-card');
|
|
681
|
+
if (!(card instanceof HTMLElement)) return;
|
|
682
|
+
e.preventDefault();
|
|
683
|
+
var next = card.getAttribute('data-open') !== 'true';
|
|
684
|
+
card.setAttribute('data-open', next ? 'true' : 'false');
|
|
685
|
+
btn.setAttribute('aria-expanded', next ? 'true' : 'false');
|
|
686
|
+
var label = btn.querySelector('.tw-changelog-toggle-label');
|
|
687
|
+
if (label) label.textContent = next ? '收起' : '查看更多';
|
|
688
|
+
});
|
|
689
|
+
})();
|
|
690
|
+
</script></body></html>
|