feat(webui): expose transactional backup restore

Replace route-local restore writes with the core transaction and map preflight, rollback, and post-commit cleanup failures to precise HTTP responses. Treat only ENOENT as a missing export file and return transaction, restored, skipped, migrated, and restart facts.

Update the settings panel to describe the full sensitive configuration group, avoid restart guidance for empty plans, and reload settings after both successful and failed imports so the UI reflects committed disk state. Add HTTP regression coverage for export and restore error semantics.
This commit is contained in:
DrSmoothl committed 2026-07-15 16:12:51 +08:00
1 parent ccbee78cc7
commit bd9236e3fa
7 files changed
+305 -102

No files matched your search

+1 -1
View File
@@ -164,7 +164,7 @@ export interface ApiClient {
deleteCert(): Promise<void>;
/** Download the config backup bundle (credentials gated). */
exportBackup(includeCredentials: boolean): Promise<BackupBundle>;
/** Validate + restore a bundle (snapshots current config first). */
/** Validate + restore a bundle as one process-level transaction. */
importBackup(backup: BackupBundle, restoreCredentials: boolean): Promise<BackupImportResult>;
};