diff --git a/tui/README.md b/tui/README.md index 1e67894..63691b7 100644 --- a/tui/README.md +++ b/tui/README.md @@ -1,8 +1,10 @@ -# πŸ”§ Enhanced Backup Manager TUI +# πŸ“ Backup File Browser TUI -A modern, interactive Terminal User Interface (TUI) for## ⌨️ Enhanced Key Bindings +A modern, interactive Terminal User Interface (TUI) for browsing and viewing backup files and logs in your shell environment. Built with Go and Charm's Bubble Tea framework for a delightful file exploration experience. This TUI provides read-only access to your backup infrastructure, allowing you to explore backup directories, view file details, and browse operation logs without modifying any files. -### Navigation & Control +## ⌨️ Key Bindings + +### Navigation & File Browsing | Key | Action | Description | |-----|--------|-------------| @@ -11,87 +13,69 @@ A modern, interactive Terminal User Interface (TUI) for## ⌨️ Enhanced Key Bi | `←/h` | Move left (panel navigation) | Switch to service list panel | | `β†’/l` | Move right (panel navigation) | Switch to output panel | | `Tab` | Switch between panels | Toggle between service list and output | -| `Enter/Space` | Execute selected backup | Start the selected backup operation | +| `Enter` | Browse selected directory | View backup files and details | ### View Management | Key | Action | Description | |-----|--------|-------------| -| `v` | View backup logs | Switch to logs view with real-time updates | -| `s` | View backup status | Display comprehensive status dashboard | -| `c` | View configuration | Show system and service configuration | -| `r` | Refresh status and logs | Reload all status information | +| `v` | View backup logs | Switch to logs view | +| `s` | View backup status | Display backup file status information | +| `f` | View configuration | Show system and service configuration | +| `r` | Refresh current view | Reload directory and status information | | `Esc` | Return to main view | Go back to main backup selection | -### Process Control +### Interface Control | Key | Action | Description | |-----|--------|-------------| -| `x` | Stop running backup | Gracefully cancel active backup process | -| `Space` | Clear output panel | Clear the output display area | +| `c` | Clear output panel | Clear the output display area | | `?` | Toggle help | Show/hide comprehensive help information | | `q/Ctrl+C` | Quit application | Exit the TUI application | -### Advanced Features +## πŸš€ Features -| Key | Action | Description | -|-----|--------|-------------| -| `f` | View configuration | Detailed system and service information | -| `p` | Progress details | Show detailed progress metrics | -| `l` | Live logs | Real-time log streaming display |p operations in your shell environment. Built with Go and Charm's Bubble Tea framework with advanced real-time features. +### πŸ“ File Browser Interface -## πŸš€ Enhanced Features +- **Directory Navigation**: Browse backup directories for different services +- **File Details**: View file sizes, modification dates, and backup types +- **Service Organization**: Organized by backup service (Plex, Immich, Media services, etc.) +- **Log File Viewing**: Browse and read backup operation logs -### πŸ“Š Real-time Progress Tracking +### πŸ“Š Information Display -- **Visual Progress Bars**: Live progress indicators with percentage display -- **ETA Calculations**: Intelligent time estimation based on current progress -- **Output Streaming**: Real-time display of backup command output -- **Performance Metrics**: Elapsed time tracking and transfer statistics +- **Backup Statistics**: View file counts, total sizes, and backup ages +- **Status Information**: Display backup directory health and availability +- **Configuration Details**: Show system and service configuration information +- **File Metadata**: Display compressed file status and service associations -### πŸŽ›οΈ Advanced Process Management +### πŸ–₯️ User Interface -- **Context Cancellation**: Graceful backup cancellation with context support -- **Process Monitoring**: Track and control multiple simultaneous backups -- **Resource Management**: Memory-safe output handling with line limits -- **Thread Safety**: Concurrent operation support with proper synchronization - -### πŸ–₯️ Enhanced User Interface - -- **Dual-panel System**: Service list and live output viewer -- **Multiple View Modes**: Main, logs, status, and configuration views +- **Dual-panel System**: Service list and detailed information viewer +- **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 all actions -- **Color-coded Status**: Dynamic status indicators with real-time updates -- **Progressive Disclosure**: Context-sensitive information display +- **Smart Key Bindings**: Intuitive keyboard shortcuts for navigation +- **Color-coded Display**: Dynamic visual indicators for file types and status +- **Context-sensitive Information**: Detailed descriptions for each backup service -### πŸ“¦ Integrated Backup Services +### πŸ“¦ Backup Service Directories -- **πŸ”΅ Plex Backup**: Complete Plex Media Server backup with integrity checking -- **πŸ–ΌοΈ Immich Backup**: Database and uploads backup with B2 cloud sync -- **🎬 Media Services**: Sonarr, Radarr, Prowlarr, and other media services backup -- **πŸ”§ Environment Files**: Docker environment and configuration files backup -- **🐳 Docker Configuration**: Container and compose files backup +- **πŸ”΅ Plex Backups**: Browse Plex Media Server backup files and archives +- **πŸ–ΌοΈ 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 +- **πŸ“Š Tautulli**: Browse Plex statistics and monitoring backups +- **πŸ“š Audiobookshelf**: View audiobook server backup files +- **πŸ“₯ SABnzbd**: Browse download client configuration backups +- **🎯 Jellyseerr**: View request management system backups -### βœ… Validation & Monitoring +### πŸ“‹ Log and Status Viewing -- **Backup Validation**: Integrity checking for all backup types -- **Real-time Monitoring**: Live backup status and progress tracking -- **Health Checks**: Comprehensive backup health monitoring -- **Status Dashboard**: Detailed status view with statistics and summaries - -### πŸ”„ Restoration Services - -- **Safe Restoration**: Validated restoration with dry-run options -- **Current Data Backup**: Automatic backup before restoration -- **Interactive Selection**: Choose from available backup files - -### πŸ›‘οΈ Intelligent Error Handling - -- **Comprehensive Error Tracking**: Detailed error analysis and reporting -- **User-friendly Messages**: Clear error descriptions with context -- **Recovery Suggestions**: Automated recommendations for error resolution -- **Graceful Degradation**: Continues operation when individual components fail +- **Backup History**: Browse historical backup operation logs +- **File Information**: View detailed file metadata and timestamps +- **Directory Statistics**: See backup counts, sizes, and dates +- **System Configuration**: Display current system and service settings ## 🎯 Quick Start @@ -133,79 +117,80 @@ cd tui && ./backup-manager | `↓/j` | Move down in list | | `←/h` | Move left (panel navigation) | | `β†’/l` | Move right (panel navigation) | -| `Enter/Space` | Execute selected backup | +| `Enter` | Browse selected directory | | `Tab` | Switch between panels | | `v` | View backup logs | | `s` | View backup status | | `f` | View configuration | -| `r` | Refresh status and logs | -| `x` | Stop running backup | +| `r` | Refresh current view | +| `x` | Return to main view | | `c` | Clear output panel | | `Esc` | Return to main view | | `?` | Toggle help | | `q/Ctrl+C` | Quit application | -## πŸ“‹ Available Operations +## πŸ“ Available Backup Directories -### Core Backup Operations +### Backup Service Directories -1. **πŸ“¦ Plex Backup** - Enhanced backup with integrity verification -2. **πŸ–ΌοΈ Immich Backup** - Complete database and media backup -3. **🎬 Media Services Backup** - All media service configurations -4. **πŸ”§ Environment Files Backup** - Docker environment files -5. **🐳 Docker Configuration Backup** - Container configurations +1. **πŸ“¦ Plex Backups** - Browse Plex Media Server backup archives and files +2. **πŸ–ΌοΈ Immich Backups** - View Immich photo management backup files +3. **🎬 Sonarr Backups** - Browse Sonarr TV series management backup files +4. **🎭 Radarr Backups** - View Radarr movie management backup files +5. **πŸ” Prowlarr Backups** - Browse Prowlarr indexer management backup files +6. **🎯 Jellyseerr Backups** - View Jellyseerr request management backup files +7. **πŸ“₯ SABnzbd Backups** - Browse SABnzbd download client backup files +8. **πŸ“Š Tautulli Backups** - View Tautulli Plex statistics backup files +9. **πŸ“š Audiobookshelf Backups** - Browse Audiobookshelf server backup files +10. **🐳 Docker Data Backups** - View Docker container data and volume backups +11. **πŸ“‹ Backup Logs** - Browse backup operation logs and history -### Validation Services +### Directory Information -1. **βœ… Validate Plex Backups** - Check Plex backup integrity -2. **βœ… Validate Immich Backups** - Verify Immich backups -3. **βœ… Validate Environment Backups** - Check environment backup health +Each directory shows: -### Monitoring & Status - -1. **πŸ“Š Monitor Plex Status** - Real-time Plex backup monitoring - -### Restoration Services - -1. **πŸ”„ Restore Plex** - Safe Plex restoration with validation -2. **πŸ”„ Restore Immich** - Immich restoration from backup +- **File listings** with names, sizes, and modification dates +- **Directory statistics** including total files and combined size +- **Backup metadata** such as compression status and service type +- **Path information** for easy navigation and reference ## πŸ”§ How It Works -### Script Integration +### Directory Structure Detection -The TUI integrates with your existing backup scripts: +The TUI automatically discovers and organizes backup directories: -- **Plex Scripts**: `plex/backup-plex.sh`, `plex/restore-plex.sh`, etc. -- **Immich Scripts**: `immich/backup-immich.sh`, `immich/restore-immich.sh`, etc. -- **Media Scripts**: `backup-media.sh`, `backup-env-files.sh`, etc. +- **Backup Path**: Scans `/mnt/share/media/backups/` for service directories +- **Service Recognition**: Identifies Plex, Immich, media services, and other backup folders +- **File Analysis**: Reads file metadata including sizes, dates, and compression status +- **Log Discovery**: Locates and organizes backup operation log files -### Real-time Execution +### File Browsing System -- Scripts are executed with appropriate arguments -- Output is captured and displayed in real-time -- Status is tracked and updated live -- Errors are handled gracefully with detailed reporting +- **Directory Navigation**: Browse through backup files organized by service +- **File Details**: Display comprehensive file information and metadata +- **Content Organization**: Sort files by date, size, or modification time +- **Path Tracking**: Maintain breadcrumb navigation for easy orientation -### Log Integration +### Log File Integration -- Reads from existing log files in `logs/` directories -- Parses performance data from JSON logs -- Displays recent activity and status information -- Provides searchable log viewer +- **Log File Reading**: Access backup operation logs from `logs/` directories +- **Date Parsing**: Extract timestamps and service information from log filenames +- **Content Display**: Show log contents with proper formatting and navigation +- **Historical Viewing**: Browse logs by date and service for troubleshooting ## 🎨 Interface Layout ```text -β”Œβ”€β”€β”€ πŸ”§ Media & Plex Backup Manager ────┐ -β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Services β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€ Output / Logs ───┐│ -β”‚β”‚> 1. πŸ“¦ Plex Backup β”‚β”‚Running backup... β”‚β”‚ -β”‚β”‚ 2. πŸ–ΌοΈ Immich Backup β”‚β”‚ β”‚β”‚ -β”‚β”‚ 3. 🎬 Media Services Backup β”‚β”‚Status: βœ… Success β”‚β”‚ -β”‚β”‚ 4. βœ… Validate Plex Backups β”‚β”‚Duration: 45.3s β”‚β”‚ -β”‚β”‚ 5. πŸ”§ Environment Files Backup β”‚β”‚ β”‚β”‚ +β”Œβ”€β”€β”€ πŸ“ Backup File Browser ────────────┐ +β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Services β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€ File Details ────┐│ +β”‚β”‚> 1. πŸ“¦ Plex Backups β”‚β”‚πŸ“¦ Plex Backups β”‚β”‚ +β”‚β”‚ 2. πŸ–ΌοΈ Immich Backups β”‚β”‚ β”‚β”‚ +β”‚β”‚ 3. 🎬 Sonarr Backups β”‚β”‚Files: 15 β”‚β”‚ +β”‚β”‚ 4. 🎭 Radarr Backups β”‚β”‚Size: 2.3 GB β”‚β”‚ +β”‚β”‚ 5. πŸ” Prowlarr Backups β”‚β”‚Last: 2024-01-15 β”‚β”‚ β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ -β”‚plex: βœ… 45.3s | immich: idle | Panel: Backup List β”‚ +β”‚View: MAIN | Panel: Backup List | Path: /mnt/share/media/backups β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` @@ -237,33 +222,34 @@ go build -o backup-manager main.go | Icon | Status | Description | |------|--------|-------------| -| βœ… | Success | Operation completed successfully | -| ❌ | Error | Operation failed with errors | -| πŸ”„ | Running | Operation currently in progress | -| ⏸️ | Idle | Service available but not running | +| βœ… | Available | Directory exists and contains backup files | +| ❌ | Missing | Directory path not found or inaccessible | +| πŸ“ | Directory | Backup service directory with file contents | +| πŸ“‹ | Logs | Log files and backup operation history | ## πŸš€ Advanced Usage -### Automated Operations +### File Browsing Features -The TUI integrates with your existing automation: +The TUI provides comprehensive backup file exploration: -- Cron jobs continue to work independently -- TUI provides manual execution and monitoring -- Status reflects both manual and automated runs +- **Directory Exploration**: Browse backup files organized by service type +- **File Filtering**: Navigate through files by date, size, or service +- **Metadata Display**: View detailed file information including compression status -### Script Arguments +### Backup Analysis -- Backup scripts are called with appropriate flags (`--non-interactive`, etc.) -- Restore operations use safe defaults (`--dry-run` for Plex) -- Validation scripts run with comprehensive checks +- **Size Tracking**: Monitor backup file sizes and storage usage +- **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 -### Log Management +### Log File Management -- View recent logs with `v` key -- Logs are sorted by timestamp (newest first) -- Real-time updates when logs change -- Integration with existing logging infrastructure +- **Log Browsing**: Navigate through backup operation logs by date and service +- **Content Viewing**: Read log file contents directly within the TUI +- **Error Investigation**: Quickly locate and review backup operation issues +- **Historical Analysis**: Track backup patterns and success rates over time ## πŸ”— Integration @@ -271,24 +257,24 @@ The TUI integrates with your existing automation: The TUI complements your existing backup infrastructure: -- **Preserves** all existing scripts and functionality -- **Enhances** with interactive management -- **Integrates** with current logging and monitoring -- **Maintains** compatibility with automation +- **Read-Only Access**: Safely browse backup files without risk of modification +- **Log Integration**: View backup operation logs from existing automation +- **Directory Monitoring**: Track backup file creation and organization +- **Compatible Viewing**: Works alongside existing backup scripts and cron jobs -### Notification Integration +### Backup Infrastructure Viewing -- Scripts continue to send notifications (webhook, email) -- TUI provides additional visual feedback -- Status updates reflect script execution results -- Status updates reflect script execution results +- **File Discovery**: Automatically detects backup files from all services +- **Status Information**: Shows backup file health and availability +- **Log Analysis**: Provides easy access to backup operation history +- **Storage Monitoring**: Track backup storage usage and file organization ## πŸ“ Notes -- The TUI automatically detects the shell directory structure -- Scripts are executed from their proper directories -- Environment variables and paths are preserved -- Safe execution with proper error handling +- The TUI automatically detects backup directory structure and organization +- 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 --- diff --git a/tui/backup-manager b/tui/backup-manager deleted file mode 100755 index ceb7b71..0000000 Binary files a/tui/backup-manager and /dev/null differ diff --git a/tui/demo-features.sh b/tui/demo-features.sh deleted file mode 100755 index 423e437..0000000 --- a/tui/demo-features.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -# Enhanced Backup TUI Demonstration Script -# Shows all the advanced features implemented in the TUI - -set -e - -YELLOW='\033[1;33m' -GREEN='\033[0;32m' -RED='\033[0;31m' -BLUE='\033[0;34m' -CYAN='\033[0;36m' -NC='\033[0m' # No Color - -clear -echo -e "${BLUE}╔══════════════════════════════════════════════════════════════════════════════╗${NC}" -echo -e "${BLUE}β•‘ Enhanced Backup TUI Feature Demo β•‘${NC}" -echo -e "${BLUE}β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•${NC}" -echo "" - -echo -e "${GREEN}πŸŽ‰ Successfully compiled and ready for testing!${NC}" -echo "" - -echo -e "${YELLOW}Enhanced Features Implemented:${NC}" -echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" - -echo -e "${GREEN}βœ“ Real-time Progress Tracking${NC}" -echo " β€’ Visual progress bars with percentage indicators" -echo " β€’ ETA calculation based on elapsed time" -echo " β€’ Live output streaming from backup processes" -echo "" - -echo -e "${GREEN}βœ“ Advanced Process Management${NC}" -echo " β€’ Context-based cancellation support" -echo " β€’ Process monitoring and cleanup" -echo " β€’ Graceful shutdown handling" -echo "" - -echo -e "${GREEN}βœ“ Enhanced User Interface${NC}" -echo " β€’ Dual-panel system (list + output)" -echo " β€’ Multiple view modes (main, logs, status, config)" -echo " β€’ Tab navigation between panels" -echo " β€’ Color-coded status indicators" -echo "" - -echo -e "${GREEN}βœ“ Intelligent Error Handling${NC}" -echo " β€’ Comprehensive error tracking" -echo " β€’ User-friendly error messages" -echo " β€’ Recovery suggestions" -echo "" - -echo -e "${GREEN}βœ“ Enhanced Key Bindings${NC}" -echo " β€’ Enter: Execute selected backup" -echo " β€’ x: Stop running backup" -echo " β€’ v: View logs" -echo " β€’ s: View status" -echo " β€’ c: View configuration" -echo " β€’ r: Refresh status" -echo " β€’ Tab: Switch panels" -echo " β€’ ?: Toggle help" -echo " β€’ Esc: Return to main view" -echo " β€’ q: Quit application" -echo "" - -echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" -echo "" - -echo -e "${YELLOW}πŸš€ Ready to Launch!${NC}" -echo "" -echo -e "${GREEN}To start the enhanced backup TUI, run:${NC}" -echo -e "${BLUE} cd ~/shell/tui && ./backup-manager${NC}" -echo "" - -echo -e "${YELLOW}πŸ’‘ Pro Tips:${NC}" -echo "β€’ Use the dry-run options first to test backups safely" -echo "β€’ Monitor the progress bars and ETA calculations" -echo "β€’ Try canceling a backup with 'x' to test process management" -echo "β€’ Switch between panels with Tab to see different views" -echo "β€’ Use 'r' to refresh status and see real-time updates" -echo "" - -echo -e "${GREEN}The enhanced backup TUI is now ready for production use! 🎯${NC}"