mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 21:00:41 +00:00
2a7879efaa
- Added support for backup integrity verification during export and restore processes. - Introduced progress dispatching for backup export and restore operations. - Implemented new API endpoints for inspecting remote backup integrity. - Enhanced user interface with progress indicators and warning dialogs for integrity issues. - Updated localization strings for new features and user feedback. - Refactored backup-related functions for better clarity and maintainability.
28 lines
890 B
TypeScript
28 lines
890 B
TypeScript
export type BackupProgressOperation = 'backup-restore' | 'backup-export' | 'backup-remote-run';
|
|
|
|
export interface BackupProgressDetail {
|
|
operation: BackupProgressOperation;
|
|
source?: 'local' | 'remote';
|
|
step: string;
|
|
fileName: string;
|
|
stageTitle?: string;
|
|
stageDetail?: string;
|
|
replaceExisting?: boolean;
|
|
done?: boolean;
|
|
ok?: boolean;
|
|
error?: string | null;
|
|
Date?: string;
|
|
}
|
|
|
|
export type BackupRestoreProgressDetail = BackupProgressDetail;
|
|
|
|
export const BACKUP_PROGRESS_EVENT = 'nodewarden:backup-progress';
|
|
export const BACKUP_RESTORE_PROGRESS_EVENT = BACKUP_PROGRESS_EVENT;
|
|
|
|
export function dispatchBackupProgress(detail: BackupProgressDetail): void {
|
|
if (typeof window === 'undefined') return;
|
|
window.dispatchEvent(new CustomEvent<BackupProgressDetail>(BACKUP_PROGRESS_EVENT, { detail }));
|
|
}
|
|
|
|
export const dispatchBackupRestoreProgress = dispatchBackupProgress;
|