feat: Implement backup TUI with enhanced refresh functionality and consistent build system

This commit is contained in:
Peter Wood
2025-06-04 08:57:09 -04:00
parent 780e78f132
commit 8b514ac0b2
8 changed files with 508 additions and 60 deletions

View File

@@ -52,7 +52,7 @@ A modern, interactive Terminal User Interface (TUI) for browsing and viewing bac
### 🖥️ User Interface
- **Dual-panel System**: Service list and detailed information viewer
- **Multiple View Modes**: Main browser, logs viewer, status, and configuration views
- **Multiple View Modes**: Main browser, logs viewer, status, and configuration views
- **Tab Navigation**: Switch between panels with Tab key
- **Smart Key Bindings**: Intuitive keyboard shortcuts for navigation
- **Color-coded Display**: Dynamic visual indicators for file types and status
@@ -61,7 +61,7 @@ A modern, interactive Terminal User Interface (TUI) for browsing and viewing bac
### 📦 Backup Service Directories
- **🔵 Plex Backups**: Browse Plex Media Server backup files and archives
- **🖼️ Immich Backups**: View Immich photo management backup files
- **🖼️ Immich Backups**: View Immich photo management backup files
- **🎬 Media Services**: Browse Sonarr, Radarr, Prowlarr, and other media service backups
- **🔧 Environment Files**: View Docker environment and configuration file backups
- **🐳 Docker Configuration**: Browse container and compose file backups
@@ -81,32 +81,47 @@ A modern, interactive Terminal User Interface (TUI) for browsing and viewing bac
### Installation
The TUI is already built and ready to use! Simply run:
The TUI uses a consistent build system with multiple options:
```bash
# From the shell directory
./backup-tui
# Option 1: Use the launcher script (recommended)
cd /home/acedanger/shell
./launch-backup-tui.sh
# Or directly from the tui directory
cd tui && ./backup-manager
# Option 2: Use Makefile for development
cd tui
make all # Build and install
make build # Build only
make dev # Quick development build
# Option 3: Use build script
cd tui
./build.sh
# Option 4: Direct Go build
cd tui
go build -o backup-tui main.go
```
### First Time Setup
1. **Ensure Go 1.19+ is installed** (only needed for rebuilding)
2. **Navigate to your shell directory** where backup scripts are located
3. **Launch the TUI** using `./backup-tui`
3. **Launch the TUI** using `./launch-backup-tui.sh`
4. **Use arrow keys or hjkl** to navigate the interface
5. **Press `?`** for comprehensive help and key bindings
### Launch the TUI
```bash
# From the shell directory
# From the shell directory (recommended - auto-builds if needed)
./launch-backup-tui.sh
# Or if binary exists
./backup-tui
# Or directly from the tui directory
cd tui && ./backup-manager
# Or from the tui directory
cd tui && ./backup-tui
```
### Key Bindings
@@ -203,14 +218,31 @@ The TUI automatically discovers and organizes backup directories:
### Building from Source
The TUI includes multiple build options for consistent binary naming:
```bash
# Option 1: Use Makefile (recommended for development)
cd tui
make all # Clean, build, and install
make build # Build only
make dev # Quick development build
make clean # Remove build artifacts
make help # Show all targets
# Option 2: Use build script
cd tui
./build.sh
# Option 3: Direct Go build
cd tui
export GOROOT=/usr/lib/go-1.19
export PATH=$PATH:$GOROOT/bin
go mod tidy
go build -o backup-manager main.go
go build -o backup-tui main.go
```
**Binary Naming**: All build methods consistently create `backup-tui` binary.
### Dependencies
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) - TUI framework
@@ -239,7 +271,7 @@ The TUI provides comprehensive backup file exploration:
### Backup Analysis
- **Size Tracking**: Monitor backup file sizes and storage usage
- **Date Analysis**: Review backup frequency and file modification dates
- **Date Analysis**: Review backup frequency and file modification dates
- **Service Organization**: Files organized by backup service for easy navigation
- **Compression Detection**: Identify compressed archives and their contents
@@ -271,7 +303,7 @@ The TUI complements your existing backup infrastructure:
## 📝 Notes
- The TUI automatically detects backup directory structure and organization
- Provides read-only access to backup files for safe browsing and analysis
- Provides read-only access to backup files for safe browsing and analysis
- Backup files are displayed with metadata including sizes, dates, and compression status
- Log files can be viewed directly within the interface for troubleshooting and analysis