dsh-config-manager 0.1.8 → 0.1.10
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.d.ts +1 -1
- package/lib/client.js +88 -80
- package/lib/client.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/ui/import-wizard.js +10 -5
- package/lib/ui/import-wizard.js.map +1 -1
- package/lib/ui/progress.d.ts +10 -0
- package/lib/ui/progress.js +12 -0
- package/lib/ui/progress.js.map +1 -1
- package/package.json +1 -2
- package/src/client/locales.ts +2 -2
- package/src/index.ts +1 -1
- package/src/ui/import-wizard.test.ts +21 -0
- package/src/ui/import-wizard.ts +10 -5
- package/src/ui/progress.ts +13 -0
package/lib/client.d.ts
CHANGED
|
@@ -310,7 +310,7 @@ declare const zh: {
|
|
|
310
310
|
readonly 'import.confirm.execute': "确认导入";
|
|
311
311
|
readonly 'import.confirm.warning': "导入将修改当前 DSH 配置;执行前会自动创建安全快照,失败时整体回滚。";
|
|
312
312
|
readonly 'import.rollbackOnError': "失败时整体回滚(推荐)";
|
|
313
|
-
readonly 'import.importing': "
|
|
313
|
+
readonly 'import.importing': "正在导入…(插件安装较多时可能需要几分钟,请勿关闭页面)";
|
|
314
314
|
readonly 'import.secrets.title': "补录密钥";
|
|
315
315
|
readonly 'import.secrets.hint': "以下凭据未随备份导出(安全设计)。如需在目标 DSH 使用,请手动补录;留空将跳过。";
|
|
316
316
|
readonly 'import.secrets.optional': "(可选)";
|
package/lib/client.js
CHANGED
|
@@ -241,6 +241,16 @@ const IMPORT_STAGES = [
|
|
|
241
241
|
"rolling-back",
|
|
242
242
|
"done"
|
|
243
243
|
];
|
|
244
|
+
/**
|
|
245
|
+
* 真实执行阶段(不在 IMPORT_STAGES 序列里,因此 step/total 缺省 → 进度条渲染
|
|
246
|
+
* 为不定态动画而非伪造百分比)。execute 是一个单次 HTTP 请求,Host 端串行
|
|
247
|
+
* 跑完全部计划项(其中插件安装是 npm 串行,耗时最长);请求期间没有中间
|
|
248
|
+
* 进度事件可回传,旧实现把 restoring-settings / restoring-plugins /
|
|
249
|
+
* restoring-mcp / validating-config 在请求前全部预发,导致进度条瞬间跳到
|
|
250
|
+
* 78% 后长时间无变化——像卡死。现在统一在请求期间显示 'executing' 不定态,
|
|
251
|
+
* 让用户明确知道「仍在执行,请等待」。
|
|
252
|
+
*/
|
|
253
|
+
const EXECUTING_STAGE = "executing";
|
|
244
254
|
const STAGE_TEXTS = {
|
|
245
255
|
"analyzing": "Analyzing configuration...",
|
|
246
256
|
"exporting-settings": "Exporting settings...",
|
|
@@ -257,6 +267,7 @@ const STAGE_TEXTS = {
|
|
|
257
267
|
"restoring-mcp": "Restoring MCP...",
|
|
258
268
|
"validating-config": "Validating configuration...",
|
|
259
269
|
"rolling-back": "Rolling back...",
|
|
270
|
+
"executing": "Applying configuration (plugin installs may take a while)...",
|
|
260
271
|
"done": "Done"
|
|
261
272
|
};
|
|
262
273
|
/** 阶段 id → 用户可读文案(未知阶段回退 id) */
|
|
@@ -570,93 +581,93 @@ if (typeof document !== "undefined" && document.querySelector("style[data-tag=\"
|
|
|
570
581
|
document.head.appendChild(tag);
|
|
571
582
|
}
|
|
572
583
|
var config_manager_module_css_default = {
|
|
573
|
-
"
|
|
574
|
-
"
|
|
575
|
-
"
|
|
576
|
-
"groupItems": "_367UGW_groupItems",
|
|
577
|
-
"errorActionLabel": "_367UGW_errorActionLabel",
|
|
578
|
-
"categoryDesc": "_367UGW_categoryDesc",
|
|
579
|
-
"section": "_367UGW_section",
|
|
580
|
-
"errorReason": "_367UGW_errorReason",
|
|
581
|
-
"sectionTitleBlock": "_367UGW_sectionTitleBlock",
|
|
584
|
+
"spinnerWrap": "_367UGW_spinnerWrap",
|
|
585
|
+
"conflictId": "_367UGW_conflictId",
|
|
586
|
+
"groupList": "_367UGW_groupList",
|
|
582
587
|
"dshCmSpin": "_367UGW_dshCmSpin",
|
|
588
|
+
"viewBody": "_367UGW_viewBody",
|
|
589
|
+
"input": "_367UGW_input",
|
|
590
|
+
"errorBanner": "_367UGW_errorBanner",
|
|
591
|
+
"pathRow": "_367UGW_pathRow",
|
|
592
|
+
"pathNew": "_367UGW_pathNew",
|
|
593
|
+
"errorAction": "_367UGW_errorAction",
|
|
594
|
+
"conflictOptions": "_367UGW_conflictOptions",
|
|
595
|
+
"dshCmIndeterminate": "_367UGW_dshCmIndeterminate",
|
|
596
|
+
"conflictDetail": "_367UGW_conflictDetail",
|
|
597
|
+
"badgeError": "_367UGW_badgeError",
|
|
598
|
+
"spinner": "_367UGW_spinner",
|
|
599
|
+
"sectionBody": "_367UGW_sectionBody",
|
|
600
|
+
"radioLabel": "_367UGW_radioLabel",
|
|
601
|
+
"secretsList": "_367UGW_secretsList",
|
|
602
|
+
"dangerButton": "_367UGW_dangerButton",
|
|
603
|
+
"groupLabel": "_367UGW_groupLabel",
|
|
583
604
|
"spinnerLabel": "_367UGW_spinnerLabel",
|
|
605
|
+
"progressIndeterminate": "_367UGW_progressIndeterminate",
|
|
606
|
+
"sectionTitle": "_367UGW_sectionTitle",
|
|
584
607
|
"fieldLabel": "_367UGW_fieldLabel",
|
|
585
|
-
"
|
|
586
|
-
"
|
|
587
|
-
"
|
|
608
|
+
"field": "_367UGW_field",
|
|
609
|
+
"formError": "_367UGW_formError",
|
|
610
|
+
"categoryDesc": "_367UGW_categoryDesc",
|
|
611
|
+
"reportFooter": "_367UGW_reportFooter",
|
|
612
|
+
"checkboxRow": "_367UGW_checkboxRow",
|
|
613
|
+
"pathMappingList": "_367UGW_pathMappingList",
|
|
614
|
+
"sectionTitleBlock": "_367UGW_sectionTitleBlock",
|
|
615
|
+
"badgeWarn": "_367UGW_badgeWarn",
|
|
616
|
+
"categoryItem": "_367UGW_categoryItem",
|
|
617
|
+
"groupCard": "_367UGW_groupCard",
|
|
588
618
|
"severityError": "_367UGW_severityError",
|
|
589
|
-
"
|
|
590
|
-
"
|
|
591
|
-
"
|
|
619
|
+
"badgeInfo": "_367UGW_badgeInfo",
|
|
620
|
+
"pathValue": "_367UGW_pathValue",
|
|
621
|
+
"viewTabs": "_367UGW_viewTabs",
|
|
622
|
+
"card": "_367UGW_card",
|
|
623
|
+
"groupHeader": "_367UGW_groupHeader",
|
|
624
|
+
"progressLabel": "_367UGW_progressLabel",
|
|
625
|
+
"progressTrack": "_367UGW_progressTrack",
|
|
592
626
|
"pathOld": "_367UGW_pathOld",
|
|
593
|
-
"
|
|
594
|
-
"errorItem": "_367UGW_errorItem",
|
|
595
|
-
"empty": "_367UGW_empty",
|
|
596
|
-
"progressBar": "_367UGW_progressBar",
|
|
627
|
+
"pathIssueKind": "_367UGW_pathIssueKind",
|
|
597
628
|
"hint": "_367UGW_hint",
|
|
598
|
-
"sectionSubtitle": "_367UGW_sectionSubtitle",
|
|
599
|
-
"progressBarDone": "_367UGW_progressBarDone",
|
|
600
|
-
"dshCmIndeterminate": "_367UGW_dshCmIndeterminate",
|
|
601
629
|
"actionRow": "_367UGW_actionRow",
|
|
602
|
-
"
|
|
603
|
-
"
|
|
630
|
+
"ghostButton": "_367UGW_ghostButton",
|
|
631
|
+
"badge": "_367UGW_badge",
|
|
632
|
+
"modeTab": "_367UGW_modeTab",
|
|
633
|
+
"errorList": "_367UGW_errorList",
|
|
634
|
+
"modeTabs": "_367UGW_modeTabs",
|
|
635
|
+
"errorLine": "_367UGW_errorLine",
|
|
636
|
+
"iconButton": "_367UGW_iconButton",
|
|
604
637
|
"reportView": "_367UGW_reportView",
|
|
605
|
-
"
|
|
606
|
-
"
|
|
607
|
-
"
|
|
608
|
-
"
|
|
609
|
-
"conflictId": "_367UGW_conflictId",
|
|
610
|
-
"groupHeader": "_367UGW_groupHeader",
|
|
611
|
-
"conflictDetail": "_367UGW_conflictDetail",
|
|
612
|
-
"card": "_367UGW_card",
|
|
613
|
-
"progressMeta": "_367UGW_progressMeta",
|
|
614
|
-
"progressPercent": "_367UGW_progressPercent",
|
|
615
|
-
"conflictList": "_367UGW_conflictList",
|
|
638
|
+
"viewTab": "_367UGW_viewTab",
|
|
639
|
+
"groupItems": "_367UGW_groupItems",
|
|
640
|
+
"hiddenFile": "_367UGW_hiddenFile",
|
|
641
|
+
"errorTitle": "_367UGW_errorTitle",
|
|
616
642
|
"statRow": "_367UGW_statRow",
|
|
617
|
-
"
|
|
618
|
-
"
|
|
619
|
-
"modeTab": "_367UGW_modeTab",
|
|
620
|
-
"viewBody": "_367UGW_viewBody",
|
|
621
|
-
"rollbackBox": "_367UGW_rollbackBox",
|
|
622
|
-
"conflictItem": "_367UGW_conflictItem",
|
|
643
|
+
"section": "_367UGW_section",
|
|
644
|
+
"sectionSubtitle": "_367UGW_sectionSubtitle",
|
|
623
645
|
"secretFields": "_367UGW_secretFields",
|
|
624
|
-
"
|
|
625
|
-
"
|
|
626
|
-
"iconButton": "_367UGW_iconButton",
|
|
627
|
-
"badge": "_367UGW_badge",
|
|
628
|
-
"badgeInfo": "_367UGW_badgeInfo",
|
|
629
|
-
"modeHint": "_367UGW_modeHint",
|
|
630
|
-
"spinnerWrap": "_367UGW_spinnerWrap",
|
|
631
|
-
"errorAction": "_367UGW_errorAction",
|
|
632
|
-
"badgeError": "_367UGW_badgeError",
|
|
633
|
-
"warnList": "_367UGW_warnList",
|
|
634
|
-
"progressLabel": "_367UGW_progressLabel",
|
|
646
|
+
"progressBarDone": "_367UGW_progressBarDone",
|
|
647
|
+
"groupNote": "_367UGW_groupNote",
|
|
635
648
|
"banner": "_367UGW_banner",
|
|
636
649
|
"sectionHeader": "_367UGW_sectionHeader",
|
|
637
|
-
"input": "_367UGW_input",
|
|
638
|
-
"categoryName": "_367UGW_categoryName",
|
|
639
|
-
"viewTabs": "_367UGW_viewTabs",
|
|
640
|
-
"ghostButton": "_367UGW_ghostButton",
|
|
641
|
-
"radioLabel": "_367UGW_radioLabel",
|
|
642
|
-
"viewTab": "_367UGW_viewTab",
|
|
643
|
-
"reportFooter": "_367UGW_reportFooter",
|
|
644
|
-
"pathRow": "_367UGW_pathRow",
|
|
645
|
-
"errorList": "_367UGW_errorList",
|
|
646
|
-
"pathMappingList": "_367UGW_pathMappingList",
|
|
647
|
-
"progressIndeterminate": "_367UGW_progressIndeterminate",
|
|
648
|
-
"errorLine": "_367UGW_errorLine",
|
|
649
|
-
"dangerButton": "_367UGW_dangerButton",
|
|
650
|
-
"checkboxRow": "_367UGW_checkboxRow",
|
|
651
|
-
"modeTabs": "_367UGW_modeTabs",
|
|
652
|
-
"groupLabel": "_367UGW_groupLabel",
|
|
653
650
|
"progressBlock": "_367UGW_progressBlock",
|
|
654
|
-
"
|
|
655
|
-
"
|
|
656
|
-
"
|
|
657
|
-
"
|
|
658
|
-
"
|
|
659
|
-
"
|
|
651
|
+
"progressPercent": "_367UGW_progressPercent",
|
|
652
|
+
"progressBar": "_367UGW_progressBar",
|
|
653
|
+
"modeHint": "_367UGW_modeHint",
|
|
654
|
+
"progressMeta": "_367UGW_progressMeta",
|
|
655
|
+
"rollbackBox": "_367UGW_rollbackBox",
|
|
656
|
+
"errorFooter": "_367UGW_errorFooter",
|
|
657
|
+
"optionsCard": "_367UGW_optionsCard",
|
|
658
|
+
"categoryName": "_367UGW_categoryName",
|
|
659
|
+
"badgeOk": "_367UGW_badgeOk",
|
|
660
|
+
"progressDetail": "_367UGW_progressDetail",
|
|
661
|
+
"conflictItem": "_367UGW_conflictItem",
|
|
662
|
+
"primaryButton": "_367UGW_primaryButton",
|
|
663
|
+
"reportText": "_367UGW_reportText",
|
|
664
|
+
"errorActionLabel": "_367UGW_errorActionLabel",
|
|
665
|
+
"conflictHead": "_367UGW_conflictHead",
|
|
666
|
+
"empty": "_367UGW_empty",
|
|
667
|
+
"errorItem": "_367UGW_errorItem",
|
|
668
|
+
"warnList": "_367UGW_warnList",
|
|
669
|
+
"conflictList": "_367UGW_conflictList",
|
|
670
|
+
"errorReason": "_367UGW_errorReason"
|
|
660
671
|
};
|
|
661
672
|
//#endregion
|
|
662
673
|
//#region src/client/common/ui.tsx
|
|
@@ -1561,10 +1572,7 @@ var ImportWizard = class {
|
|
|
1561
1572
|
this.tracker.emit("creating-snapshot");
|
|
1562
1573
|
try {
|
|
1563
1574
|
this.plan = await this.port.createImportPlan(this.zipPath, this.decisions);
|
|
1564
|
-
this.tracker.emit(
|
|
1565
|
-
this.tracker.emit("restoring-plugins");
|
|
1566
|
-
this.tracker.emit("restoring-mcp");
|
|
1567
|
-
this.tracker.emit("validating-config");
|
|
1575
|
+
this.tracker.emit(EXECUTING_STAGE);
|
|
1568
1576
|
this.result = await this.port.executeImportPlan(this.zipPath, this.plan, {
|
|
1569
1577
|
confirm: true,
|
|
1570
1578
|
secretInputs: this.secretInputs,
|
|
@@ -2475,7 +2483,7 @@ const zh = {
|
|
|
2475
2483
|
"import.confirm.execute": "确认导入",
|
|
2476
2484
|
"import.confirm.warning": "导入将修改当前 DSH 配置;执行前会自动创建安全快照,失败时整体回滚。",
|
|
2477
2485
|
"import.rollbackOnError": "失败时整体回滚(推荐)",
|
|
2478
|
-
"import.importing": "
|
|
2486
|
+
"import.importing": "正在导入…(插件安装较多时可能需要几分钟,请勿关闭页面)",
|
|
2479
2487
|
"import.secrets.title": "补录密钥",
|
|
2480
2488
|
"import.secrets.hint": "以下凭据未随备份导出(安全设计)。如需在目标 DSH 使用,请手动补录;留空将跳过。",
|
|
2481
2489
|
"import.secrets.optional": "(可选)",
|
|
@@ -2557,7 +2565,7 @@ const en = {
|
|
|
2557
2565
|
"import.confirm.execute": "Confirm Import",
|
|
2558
2566
|
"import.confirm.warning": "Import modifies the current DSH configuration; a safety snapshot is created first and everything rolls back on failure.",
|
|
2559
2567
|
"import.rollbackOnError": "Roll back everything on failure (recommended)",
|
|
2560
|
-
"import.importing": "Importing…",
|
|
2568
|
+
"import.importing": "Importing… (installing many plugins may take a few minutes; keep this page open)",
|
|
2561
2569
|
"import.secrets.title": "Re-enter Secrets",
|
|
2562
2570
|
"import.secrets.hint": "These credentials were not exported with the backup (security by design). Enter them manually to use them here; leave blank to skip.",
|
|
2563
2571
|
"import.secrets.optional": "(optional)",
|