dsh-config-manager 0.1.49 → 0.1.51
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 +40 -3
- package/lib/client.js +548 -254
- package/lib/client.js.map +1 -1
- package/lib/core/cache-cleaner.d.ts +6 -0
- package/lib/core/cache-cleaner.js +5 -1
- package/lib/core/cache-cleaner.js.map +1 -1
- package/lib/index.js +49 -1
- package/lib/index.js.map +1 -1
- package/lib/sync/backup-files.d.ts +42 -0
- package/lib/sync/backup-files.js +113 -0
- package/lib/sync/backup-files.js.map +1 -0
- package/lib/sync/backup-scheduler.d.ts +3 -0
- package/lib/sync/backup-scheduler.js +16 -1
- package/lib/sync/backup-scheduler.js.map +1 -1
- package/package.json +1 -1
- package/src/client/CLIENT_DEPENDENCIES.md +2 -0
- package/src/client/api.ts +23 -0
- package/src/client/config-manager.module.css +36 -0
- package/src/client/import/ImportWizardView.tsx +40 -0
- package/src/client/locales.ts +34 -6
- package/src/client/run-store.test.ts +35 -5
- package/src/client/run-store.ts +18 -0
- package/src/client/snapshots/SnapshotsPanel.tsx +312 -110
- package/src/core/cache-cleaner.test.ts +29 -0
- package/src/core/cache-cleaner.ts +10 -1
- package/src/index.ts +45 -1
- package/src/sync/backup-files.test.ts +154 -0
- package/src/sync/backup-files.ts +127 -0
- package/src/sync/backup-scheduler.test.ts +86 -1
- package/src/sync/backup-scheduler.ts +17 -1
package/lib/client.d.ts
CHANGED
|
@@ -346,6 +346,23 @@ interface BackupScheduleStatus {
|
|
|
346
346
|
lastRunMessage?: string;
|
|
347
347
|
}
|
|
348
348
|
//#endregion
|
|
349
|
+
//#region src/sync/backup-files.d.ts
|
|
350
|
+
/** 备份文件来源(UI Badge 展示) */
|
|
351
|
+
type BackupFileSource = 'auto' | 'manual';
|
|
352
|
+
/** 备份文件元信息(列表行数据;无敏感字段) */
|
|
353
|
+
interface BackupFileMeta {
|
|
354
|
+
/** 文件名(如 dsh-config-auto-20260824-120000-abc.zip) */
|
|
355
|
+
name: string;
|
|
356
|
+
/** 绝对路径(供 /download 与导入向导引用) */
|
|
357
|
+
path: string;
|
|
358
|
+
/** 字节数 */
|
|
359
|
+
sizeBytes: number;
|
|
360
|
+
/** 修改时间(ms 时间戳;按此倒序展示/清理) */
|
|
361
|
+
mtimeMs: number;
|
|
362
|
+
/** 来源:auto = 定时备份;manual = 手动导出 */
|
|
363
|
+
source: BackupFileSource;
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
349
366
|
//#region src/ui/i18n.d.ts
|
|
350
367
|
/**
|
|
351
368
|
* 客户端展示层(src/ui/*、src/client/common/*)的渲染文案目录(zh 源语言 / en 镜像)。
|
|
@@ -757,6 +774,12 @@ declare class ConfigManagerApi {
|
|
|
757
774
|
run: BackupRunResult;
|
|
758
775
|
schedule: BackupScheduleStatus;
|
|
759
776
|
}>;
|
|
777
|
+
/** 列出导出目录(exports/*.zip)下的全部备份文件(时间倒序;含来源 auto/manual)。 */
|
|
778
|
+
listBackupFiles(): Promise<BackupFileMeta[]>;
|
|
779
|
+
/** 删除一个备份文件(危险操作:不可恢复;仅限 exports 目录内 .zip)。 */
|
|
780
|
+
deleteBackupFile(name: string): Promise<{
|
|
781
|
+
removed: boolean;
|
|
782
|
+
}>;
|
|
760
783
|
}
|
|
761
784
|
//#endregion
|
|
762
785
|
//#region src/sync/sync-engine.d.ts
|
|
@@ -1506,7 +1529,7 @@ declare const zh$2: {
|
|
|
1506
1529
|
readonly 'section.description': "导出 / 导入 / 迁移 DSH 配置(备份不含密钥,加密备份可选)";
|
|
1507
1530
|
readonly 'view.export': "导出备份";
|
|
1508
1531
|
readonly 'view.import': "导入恢复";
|
|
1509
|
-
readonly 'view.snapshots': "
|
|
1532
|
+
readonly 'view.snapshots': "备份与快照";
|
|
1510
1533
|
readonly 'view.sync': "远程同步";
|
|
1511
1534
|
readonly 'view.market': "配置市场";
|
|
1512
1535
|
readonly 'view.about': "关于";
|
|
@@ -1599,8 +1622,10 @@ declare const zh$2: {
|
|
|
1599
1622
|
readonly 'import.paths.old': "原路径";
|
|
1600
1623
|
readonly 'import.paths.new': "新路径";
|
|
1601
1624
|
readonly 'import.paths.unresolved': "还有 {count} 条路径未映射";
|
|
1602
|
-
readonly 'snapshots.title': "
|
|
1603
|
-
readonly 'snapshots.hint': "恢复到导入前状态:整文件还原 settings/patch
|
|
1625
|
+
readonly 'snapshots.title': "备份与快照";
|
|
1626
|
+
readonly 'snapshots.hint': "导出备份 = 便携 ZIP(下载 / 一键导入 / 删除,含定时全量备份);快照恢复 = 恢复到导入前状态:整文件还原 settings/patch、卸载导入期间新增插件、补偿被修改文件,执行前会把当前文件备份到快照的 pre-restore 目录。";
|
|
1627
|
+
readonly 'snapshots.subTab.restore': "快照恢复";
|
|
1628
|
+
readonly 'snapshots.subTab.files': "备份文件";
|
|
1604
1629
|
readonly 'snapshots.empty': "暂无快照。执行导入时会自动创建安全快照。";
|
|
1605
1630
|
readonly 'snapshots.loading': "加载快照中…";
|
|
1606
1631
|
readonly 'snapshots.selectHint': "选择快照以预览恢复计划(dry-run,零写入):";
|
|
@@ -1645,6 +1670,18 @@ declare const zh$2: {
|
|
|
1645
1670
|
readonly 'backupSchedule.status.failed': "失败";
|
|
1646
1671
|
readonly 'backupSchedule.loading': "加载定时备份设置…";
|
|
1647
1672
|
readonly 'backupSchedule.error': "定时备份设置加载失败";
|
|
1673
|
+
readonly 'backupFiles.title': "备份文件";
|
|
1674
|
+
readonly 'backupFiles.hint': "导出产物(手动导出与定时备份)统一在此管理:可下载到本机、直接导入恢复,或删除。定时备份自动保留最近 10 个。";
|
|
1675
|
+
readonly 'backupFiles.empty': "暂无备份文件。手动导出或启用定时备份后此处会列出。";
|
|
1676
|
+
readonly 'backupFiles.loading': "加载备份文件…";
|
|
1677
|
+
readonly 'backupFiles.error': "备份文件加载失败";
|
|
1678
|
+
readonly 'backupFiles.source.auto': "定时备份";
|
|
1679
|
+
readonly 'backupFiles.source.manual': "手动导出";
|
|
1680
|
+
readonly 'backupFiles.download': "下载";
|
|
1681
|
+
readonly 'backupFiles.import': "导入";
|
|
1682
|
+
readonly 'backupFiles.delete': "删除";
|
|
1683
|
+
readonly 'backupFiles.deleteConfirmTitle': "删除备份文件";
|
|
1684
|
+
readonly 'backupFiles.deleteConfirm': "确认删除备份文件「{name}」?此操作不可恢复。";
|
|
1648
1685
|
readonly 'report.export.title': "导出完成";
|
|
1649
1686
|
readonly 'report.import.title': "导入结果";
|
|
1650
1687
|
readonly 'report.rollback.title': "回滚报告";
|