ITADN

Add node migration dialog with migrate, fresh sync, and reset options

#385Pull Requestvexr 创建于 2025-12-01
V
vexrcommented
# Node Database Migration and Reset Options ## Summary This PR adds comprehensive node database migration and reset functionality to Space Acres, allowing users to move their node data to a different drive or reset a corrupted database without having to do it manually outside of the application. Resolves #81 ## Features ### Node Migration Dialog - Added a **Migrate** button in the configuration area next to the node path selector - The migration dialog provides three options: 1. **Migrate** - Copy existing database to a new location and clean up the old location (preserves sync progress) 2. **Fresh Sync** - Start fresh at a new location using snap sync (faster for very outdated nodes) 3. **Reset in Place** - Wipe and resync at the current location (for very outdated nodes and corrupted databases) ### Smart Migration - Only migrates known node data directories (`db` and `network`), leaving unrelated files untouched - Automatically cleans up node data directories (`db`, `network`) and the parent directory if no other files or directories remain after migration - Warns users if non-node data is detected in the source directory (e.g., if they shared the path with a farm) - Includes progress tracking with percentage completion during migration - Verifies copy integrity by comparing source and destination directory sizes before deleting source data ### Low Disk Space Warning Enhancement - The status bar notification for low disk space (< 10 GiB remaining) now includes a **Migrate** button alongside the existing Ok button - Allows users to quickly access the migration dialog to move their node to a larger drive ### Error Recovery - Added a **Reset node** button on the error screen when the application fails to build a subspace node (e.g., database corruption) - Pre-selects the "Reset in Place" option for quick recovery - Allows users to recover from database corruption without manual file deletion ### UI Improvements - Adjusted the free disk space level bar height to be vertically centered and more visually consistent with the peer connections indicator next to it ## Translations - Added translation definitions for all new UI elements - English translations are active; translations for all eight other supported languages (German, Spanish, French, Russian, Serbian, Turkish, Ukrainian, Chinese) are complete but commented out in favor of the English definitions pending human review ## Dependencies - Added only one new dependency: `fs_extra` crate for cross-platform directory copying with progress tracking ## Bug Fixes - **Windows CI**: Fixed gvsbuild failing to build GTK4 on Windows by explicitly setting `RUSTUP_TOOLCHAIN=stable` before running gvsbuild. The project's nightly Rust toolchain was causing compatibility issues with gvsbuild's build process. ## Screenshots ### Configuration <img width="800" height="617" alt="Screenshot From 2025-11-30 18-46-46" src="https://github.com/user-attachments/assets/574ed166-690f-482e-b7de-675c2d38302e" /> ### Migration Dialog <img width="528" height="544" alt="Screenshot From 2025-11-30 16-47-56" src="https://github.com/user-attachments/assets/721d64e7-81ea-428d-bd29-33f0a5a63ac3" /> ### Migration Progress <img width="800" height="600" alt="Screenshot From 2025-11-30 16-01-19" src="https://github.com/user-attachments/assets/d4be57c3-8051-4eb8-8839-988b5535c5a2" /> ### Low Disk Space Warning <img width="800" height="617" alt="Screenshot From 2025-11-30 16-01-44" src="https://github.com/user-attachments/assets/0620b8f0-f724-4e33-9923-6920b927adc8" /> ### Error Recovery <img width="800" height="600" alt="Screenshot From 2025-11-30 16-19-40" src="https://github.com/user-attachments/assets/ec0dc1aa-e80b-47dc-86c7-e90bb461911d" />
合并状态:未合并 3 条评论