dsh-config-manager 0.1.1 → 0.1.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/lib/client.js +100 -77
- package/lib/client.js.map +1 -1
- package/lib/ui/flow.d.ts +17 -0
- package/lib/ui/flow.js +22 -0
- package/lib/ui/flow.js.map +1 -0
- package/package.json +1 -1
- package/src/client/import/ImportWizardView.tsx +18 -8
- package/src/ui/flow.test.ts +37 -0
- package/src/ui/flow.ts +24 -0
package/lib/client.js
CHANGED
|
@@ -559,93 +559,93 @@ if (typeof document !== "undefined" && document.querySelector("style[data-tag=\"
|
|
|
559
559
|
document.head.appendChild(tag);
|
|
560
560
|
}
|
|
561
561
|
var config_manager_module_css_default = {
|
|
562
|
-
"section": "_367UGW_section",
|
|
563
|
-
"rollbackBox": "_367UGW_rollbackBox",
|
|
564
|
-
"dshCmIndeterminate": "_367UGW_dshCmIndeterminate",
|
|
565
|
-
"badge": "_367UGW_badge",
|
|
566
|
-
"progressBar": "_367UGW_progressBar",
|
|
567
|
-
"errorActionLabel": "_367UGW_errorActionLabel",
|
|
568
|
-
"pathOld": "_367UGW_pathOld",
|
|
569
|
-
"pathNew": "_367UGW_pathNew",
|
|
570
|
-
"conflictList": "_367UGW_conflictList",
|
|
571
|
-
"secretsList": "_367UGW_secretsList",
|
|
572
|
-
"badgeInfo": "_367UGW_badgeInfo",
|
|
573
|
-
"empty": "_367UGW_empty",
|
|
574
|
-
"sectionHeader": "_367UGW_sectionHeader",
|
|
575
|
-
"errorLine": "_367UGW_errorLine",
|
|
576
|
-
"actionRow": "_367UGW_actionRow",
|
|
577
562
|
"input": "_367UGW_input",
|
|
578
|
-
"iconButton": "_367UGW_iconButton",
|
|
579
|
-
"warnList": "_367UGW_warnList",
|
|
580
|
-
"progressDetail": "_367UGW_progressDetail",
|
|
581
|
-
"reportFooter": "_367UGW_reportFooter",
|
|
582
|
-
"dshCmSpin": "_367UGW_dshCmSpin",
|
|
583
|
-
"conflictItem": "_367UGW_conflictItem",
|
|
584
|
-
"ghostButton": "_367UGW_ghostButton",
|
|
585
|
-
"conflictId": "_367UGW_conflictId",
|
|
586
|
-
"checkboxRow": "_367UGW_checkboxRow",
|
|
587
|
-
"card": "_367UGW_card",
|
|
588
563
|
"dangerButton": "_367UGW_dangerButton",
|
|
589
|
-
"
|
|
590
|
-
"modeTabs": "_367UGW_modeTabs",
|
|
591
|
-
"sectionSubtitle": "_367UGW_sectionSubtitle",
|
|
592
|
-
"categoryDesc": "_367UGW_categoryDesc",
|
|
593
|
-
"progressPercent": "_367UGW_progressPercent",
|
|
594
|
-
"severityError": "_367UGW_severityError",
|
|
564
|
+
"badgeInfo": "_367UGW_badgeInfo",
|
|
595
565
|
"errorReason": "_367UGW_errorReason",
|
|
566
|
+
"pathMappingList": "_367UGW_pathMappingList",
|
|
596
567
|
"sectionTitleBlock": "_367UGW_sectionTitleBlock",
|
|
597
|
-
"
|
|
598
|
-
"formError": "_367UGW_formError",
|
|
568
|
+
"radioLabel": "_367UGW_radioLabel",
|
|
599
569
|
"modeTab": "_367UGW_modeTab",
|
|
600
|
-
"progressBarDone": "_367UGW_progressBarDone",
|
|
601
|
-
"errorList": "_367UGW_errorList",
|
|
602
|
-
"progressLabel": "_367UGW_progressLabel",
|
|
603
|
-
"groupHeader": "_367UGW_groupHeader",
|
|
604
570
|
"groupLabel": "_367UGW_groupLabel",
|
|
605
|
-
"
|
|
571
|
+
"actionRow": "_367UGW_actionRow",
|
|
572
|
+
"spinnerWrap": "_367UGW_spinnerWrap",
|
|
573
|
+
"groupNote": "_367UGW_groupNote",
|
|
574
|
+
"dshCmSpin": "_367UGW_dshCmSpin",
|
|
606
575
|
"progressMeta": "_367UGW_progressMeta",
|
|
607
|
-
"
|
|
576
|
+
"groupItems": "_367UGW_groupItems",
|
|
577
|
+
"categoryName": "_367UGW_categoryName",
|
|
578
|
+
"section": "_367UGW_section",
|
|
579
|
+
"badgeOk": "_367UGW_badgeOk",
|
|
580
|
+
"errorList": "_367UGW_errorList",
|
|
581
|
+
"progressBarDone": "_367UGW_progressBarDone",
|
|
582
|
+
"conflictItem": "_367UGW_conflictItem",
|
|
583
|
+
"errorItem": "_367UGW_errorItem",
|
|
584
|
+
"sectionTitle": "_367UGW_sectionTitle",
|
|
585
|
+
"sectionBody": "_367UGW_sectionBody",
|
|
586
|
+
"progressBlock": "_367UGW_progressBlock",
|
|
587
|
+
"hint": "_367UGW_hint",
|
|
588
|
+
"hiddenFile": "_367UGW_hiddenFile",
|
|
589
|
+
"groupList": "_367UGW_groupList",
|
|
590
|
+
"progressDetail": "_367UGW_progressDetail",
|
|
591
|
+
"conflictHead": "_367UGW_conflictHead",
|
|
592
|
+
"errorLine": "_367UGW_errorLine",
|
|
593
|
+
"optionsCard": "_367UGW_optionsCard",
|
|
594
|
+
"groupCard": "_367UGW_groupCard",
|
|
595
|
+
"card": "_367UGW_card",
|
|
596
|
+
"warnList": "_367UGW_warnList",
|
|
597
|
+
"dshCmIndeterminate": "_367UGW_dshCmIndeterminate",
|
|
598
|
+
"reportFooter": "_367UGW_reportFooter",
|
|
599
|
+
"errorFooter": "_367UGW_errorFooter",
|
|
600
|
+
"errorBanner": "_367UGW_errorBanner",
|
|
601
|
+
"groupHeader": "_367UGW_groupHeader",
|
|
602
|
+
"categoryItem": "_367UGW_categoryItem",
|
|
603
|
+
"errorAction": "_367UGW_errorAction",
|
|
604
|
+
"categoryDesc": "_367UGW_categoryDesc",
|
|
605
|
+
"secretsList": "_367UGW_secretsList",
|
|
606
|
+
"viewTab": "_367UGW_viewTab",
|
|
607
|
+
"progressPercent": "_367UGW_progressPercent",
|
|
608
|
+
"reportView": "_367UGW_reportView",
|
|
608
609
|
"conflictDetail": "_367UGW_conflictDetail",
|
|
610
|
+
"ghostButton": "_367UGW_ghostButton",
|
|
611
|
+
"checkboxRow": "_367UGW_checkboxRow",
|
|
612
|
+
"iconButton": "_367UGW_iconButton",
|
|
609
613
|
"primaryButton": "_367UGW_primaryButton",
|
|
610
|
-
"
|
|
614
|
+
"errorTitle": "_367UGW_errorTitle",
|
|
611
615
|
"conflictOptions": "_367UGW_conflictOptions",
|
|
612
|
-
"
|
|
613
|
-
"hint": "_367UGW_hint",
|
|
614
|
-
"categoryItem": "_367UGW_categoryItem",
|
|
615
|
-
"conflictHead": "_367UGW_conflictHead",
|
|
616
|
-
"pathMappingList": "_367UGW_pathMappingList",
|
|
617
|
-
"pathIssueKind": "_367UGW_pathIssueKind",
|
|
618
|
-
"spinnerWrap": "_367UGW_spinnerWrap",
|
|
616
|
+
"sectionHeader": "_367UGW_sectionHeader",
|
|
619
617
|
"progressTrack": "_367UGW_progressTrack",
|
|
620
|
-
"
|
|
621
|
-
"
|
|
618
|
+
"progressIndeterminate": "_367UGW_progressIndeterminate",
|
|
619
|
+
"formError": "_367UGW_formError",
|
|
620
|
+
"empty": "_367UGW_empty",
|
|
621
|
+
"spinner": "_367UGW_spinner",
|
|
622
622
|
"pathRow": "_367UGW_pathRow",
|
|
623
|
-
"
|
|
624
|
-
"
|
|
623
|
+
"pathIssueKind": "_367UGW_pathIssueKind",
|
|
624
|
+
"sectionSubtitle": "_367UGW_sectionSubtitle",
|
|
625
|
+
"badgeError": "_367UGW_badgeError",
|
|
626
|
+
"conflictId": "_367UGW_conflictId",
|
|
627
|
+
"viewTabs": "_367UGW_viewTabs",
|
|
628
|
+
"modeHint": "_367UGW_modeHint",
|
|
629
|
+
"pathOld": "_367UGW_pathOld",
|
|
625
630
|
"field": "_367UGW_field",
|
|
631
|
+
"statRow": "_367UGW_statRow",
|
|
632
|
+
"banner": "_367UGW_banner",
|
|
633
|
+
"fieldLabel": "_367UGW_fieldLabel",
|
|
634
|
+
"modeTabs": "_367UGW_modeTabs",
|
|
635
|
+
"progressBar": "_367UGW_progressBar",
|
|
636
|
+
"errorActionLabel": "_367UGW_errorActionLabel",
|
|
637
|
+
"pathNew": "_367UGW_pathNew",
|
|
638
|
+
"spinnerLabel": "_367UGW_spinnerLabel",
|
|
639
|
+
"rollbackBox": "_367UGW_rollbackBox",
|
|
626
640
|
"reportText": "_367UGW_reportText",
|
|
627
|
-
"
|
|
628
|
-
"
|
|
629
|
-
"
|
|
641
|
+
"viewBody": "_367UGW_viewBody",
|
|
642
|
+
"severityError": "_367UGW_severityError",
|
|
643
|
+
"conflictList": "_367UGW_conflictList",
|
|
630
644
|
"badgeWarn": "_367UGW_badgeWarn",
|
|
631
|
-
"
|
|
632
|
-
"
|
|
633
|
-
"spinner": "_367UGW_spinner",
|
|
634
|
-
"sectionTitle": "_367UGW_sectionTitle",
|
|
635
|
-
"badgeOk": "_367UGW_badgeOk",
|
|
636
|
-
"hiddenFile": "_367UGW_hiddenFile",
|
|
637
|
-
"reportView": "_367UGW_reportView",
|
|
638
|
-
"groupItems": "_367UGW_groupItems",
|
|
639
|
-
"errorItem": "_367UGW_errorItem",
|
|
645
|
+
"progressLabel": "_367UGW_progressLabel",
|
|
646
|
+
"secretFields": "_367UGW_secretFields",
|
|
640
647
|
"pathValue": "_367UGW_pathValue",
|
|
641
|
-
"
|
|
642
|
-
"errorTitle": "_367UGW_errorTitle",
|
|
643
|
-
"errorFooter": "_367UGW_errorFooter",
|
|
644
|
-
"groupNote": "_367UGW_groupNote",
|
|
645
|
-
"viewBody": "_367UGW_viewBody",
|
|
646
|
-
"viewTab": "_367UGW_viewTab",
|
|
647
|
-
"categoryName": "_367UGW_categoryName",
|
|
648
|
-
"secretFields": "_367UGW_secretFields"
|
|
648
|
+
"badge": "_367UGW_badge"
|
|
649
649
|
};
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region src/client/common/ui.tsx
|
|
@@ -1633,6 +1633,19 @@ var ConflictCollector = class {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
};
|
|
1635
1635
|
//#endregion
|
|
1636
|
+
//#region src/ui/flow.ts
|
|
1637
|
+
/**
|
|
1638
|
+
* 计算下一阶段:在 `list`(适用阶段的有序列表)中取 `from` 的下一项。
|
|
1639
|
+
* - `from` 不在列表中(如来自 preview 页)→ 取第一项;
|
|
1640
|
+
* - `from` 已是最后一项(confirm)→ 原地返回;
|
|
1641
|
+
* - 绝不回退:已完成阶段不会因仍适用而被再次命中。
|
|
1642
|
+
*/
|
|
1643
|
+
function nextFlowPhase(list, from) {
|
|
1644
|
+
if (list.length === 0) return "confirm";
|
|
1645
|
+
const idx = list.indexOf(from);
|
|
1646
|
+
return list[Math.min(idx + 1, list.length - 1)] ?? "confirm";
|
|
1647
|
+
}
|
|
1648
|
+
//#endregion
|
|
1636
1649
|
//#region src/client/import/ConflictList.tsx
|
|
1637
1650
|
/**
|
|
1638
1651
|
* 冲突决策列表(规范 §11,绑 src/ui/conflict-view.ts 的 ConflictCollector)。
|
|
@@ -1820,6 +1833,7 @@ function PathMappingForm({ issues, initial, t, onChange }) {
|
|
|
1820
1833
|
* 中间阶段(conflicts/path-mapping/secrets)是 UI 层流程页,wizard 的 decisions 由
|
|
1821
1834
|
* 对应组件收集后写入。
|
|
1822
1835
|
*/
|
|
1836
|
+
/** 中间流程阶段(wizard.step 之外的 UI 层页面)——定义见 src/ui/flow.ts */
|
|
1823
1837
|
const SCORE_LABEL = {
|
|
1824
1838
|
excellent: "Excellent",
|
|
1825
1839
|
good: "Good",
|
|
@@ -1896,13 +1910,22 @@ function ImportWizardView({ api, t }) {
|
|
|
1896
1910
|
const hasConflicts = (snapshot.plan?.items ?? []).some((i) => i.kind === "Conflict");
|
|
1897
1911
|
const hasPathIssues = (snapshot.analysis?.pathIssues.length ?? 0) > 0;
|
|
1898
1912
|
const hasSecrets = (snapshot.plan?.missingSecrets.length ?? 0) > 0;
|
|
1899
|
-
/**
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1913
|
+
/**
|
|
1914
|
+
* 适用阶段的有序列表(仅含需要用户处理 + 确认页)。
|
|
1915
|
+
* hasConflicts/hasPathIssues/hasSecrets 基于原始 analysis/plan(Dry Run 产物),
|
|
1916
|
+
* 在流程中不会因已解决而重算——所以导航必须只前进(见 nextFlowPhase),
|
|
1917
|
+
* 而不是靠"当前阶段 != X"判定(那会让已完成阶段被重新命中、跳回上一步)。
|
|
1918
|
+
*/
|
|
1919
|
+
const applicablePhases = () => {
|
|
1920
|
+
const list = [];
|
|
1921
|
+
if (hasConflicts) list.push("conflicts");
|
|
1922
|
+
if (hasPathIssues) list.push("path-mapping");
|
|
1923
|
+
if (hasSecrets) list.push("secrets");
|
|
1924
|
+
list.push("confirm");
|
|
1925
|
+
return list;
|
|
1905
1926
|
};
|
|
1927
|
+
/** 从某阶段完成后进入的下一个阶段:只前进(from 不在列表时取第一项) */
|
|
1928
|
+
const nextPhase = (from) => nextFlowPhase(applicablePhases(), from);
|
|
1906
1929
|
/** 选择并上传 ZIP → wizard.selectZip(analyzing → compatibility) */
|
|
1907
1930
|
const onPickFile = async (file) => {
|
|
1908
1931
|
if (file === void 0) return;
|