Implement rebuild progress indicator with host persistence

- Add blue circular arrow (↻) status icon during SystemRebuild commands
- Keep rebuilding hosts visible in dashboard even when temporarily offline
- Extend connection timeout to 5 minutes for hosts undergoing rebuild
- Prevent host switching during rebuild operations
- Update status bar to show rebuild progress immediately when R key pressed
This commit is contained in:
2025-10-25 10:16:39 +02:00
parent 71671a8901
commit c48a105c28
3 changed files with 84 additions and 44 deletions

View File

@@ -28,16 +28,18 @@ All keyboard navigation and service selection features successfully implemented:
-**Smart Panel Switching**: Only cycles through panels with data (backup panel conditional)
-**Scroll Support**: All panels support content scrolling with proper overflow indicators
**Current Status - October 23, 2025:**
**Current Status - October 24, 2025:**
- All keyboard navigation features working correctly ✅
- Service selection cursor implemented with focus-aware highlighting ✅
- Panel scrolling fixed for System, Services, and Backup panels ✅
- Build display working: "Build: 25.05.20251004.3bcc93c" ✅
- Configuration hash display implemented: "Config: d16f0d0" ✅
**Layout Achieved:**
```
NixOS:
Build: 25.05.20251004.3bcc93c # Target (currently shows "unknown")
Build: 25.05.20251004.3bcc93c
Config: d16f0d0 # Shows actual nixosbox config hash
Active users: cm, simon
CPU:
● Load: 0.02 0.31 0.86 • 3000MHz
@@ -50,12 +52,10 @@ Storage:
└─ ● 18% 167.4GB/928.2GB
```
**Current Status - October 23, 2025:**
- System panel layout fully implemented with blue tree symbols ✅
- Backup panel layout restructured per specification ✅
- Tree symbols now use consistent blue theming across all panels ✅
- Overflow handling restored for all widgets ("... and X more") ✅
- Agent hash display working correctly ✅
**System panel layout fully implemented with blue tree symbols ✅**
**Tree symbols now use consistent blue theming across all panels ✅**
**Overflow handling restored for all widgets ("... and X more") ✅**
**Agent hash display working correctly ✅**
### Current Keyboard Navigation Implementation
@@ -77,28 +77,24 @@ Storage:
- **Focus-Aware Selection**: Selection highlighting only visible when Services panel focused
- **Dynamic Statusbar**: Context-aware shortcuts based on focused panel
### Current Priority: Visual Feedback Implementation
### Remote Command Execution - WORKING ✅
**Remote Command Execution - PARTIALLY WORKING** ⚠️
Core infrastructure implemented but issues remain:
**All Issues Resolved (as of 2025-10-24):**
-**ZMQ Command Protocol**: Extended with ServiceControl and SystemRebuild variants
-**Agent Handlers**: systemctl and nixos-rebuild execution with maintenance mode
-**Dashboard Integration**: Existing keyboard shortcuts now execute commands
- ⚠️ **Service Control**: systemctl commands work but Space key toggle needs fixing
- **System Rebuild**: nixos-rebuild still failing with permission denied
**Current Issues (as of 2025-10-23):**
1. **Service Toggle Bug**: Space key always sends "Start" instead of toggling start/stop
2. **nixos-rebuild Permissions**: Still getting permission denied despite sudo config updates
3. **No Command Completion**: Visual feedback shows ⏳ but never completes (missing response protocol)
-**Dashboard Integration**: Keyboard shortcuts execute commands
- **Service Control**: Fixed toggle logic - replaced with separate 's' (start) and 'S' (stop)
- **System Rebuild**: Fixed permission issues and sandboxing problems
-**Git Clone Approach**: Implemented for nixos-rebuild to avoid directory permissions
-**Visual Feedback**: Directional arrows for service status (↑ starting, ↓ stopping, ↻ restarting)
**Keyboard Controls Status:**
- **Services Panel**:
- R (restart) ✅ Working
- Space (start/stop) ❌ Always starts, doesn't toggle
- **System Panel**: R (nixos-rebuild) ❌ Permission denied
- **Backup Panel**: B (trigger backup) ❓ Not tested
- s (start) ✅ Working
- S (stop) ✅ Working
- **System Panel**: R (nixos-rebuild) ✅ Working with --option sandbox false
- **Backup Panel**: B (trigger backup) ❓ Not implemented
**Visual Feedback Implementation - IN PROGRESS:**
@@ -126,26 +122,21 @@ Latest backup: → Latest backup:
**Next Session Priority Tasks:**
**Critical Fixes Needed:**
1. **Fix Service Toggle Logic**: Debug why Space key service status detection isn't working
- Check systemd metric format (`systemd_{service}_status`)
- Test service status parsing logic
- Ensure toggle detects active vs inactive correctly
2. **Resolve nixos-rebuild Permissions**:
- Verify sudo rules are actually applied after NixOS rebuild
- Test `sudo -u cm-agent sudo nixos-rebuild --help` manually
- May need different approach for nixos-rebuild access
3. **Implement Command Response Protocol**:
**Remaining Features:**
1. **Command Response Protocol**:
- Agent sends command completion/failure back to dashboard via ZMQ
- Dashboard updates UI status from ⏳ to ● when commands complete
- Clear success/failure status after timeout
**Secondary Tasks:**
2. **Backup Panel Features**:
- Implement backup trigger functionality (B key)
- Complete visual feedback for backup operations
- Add backup progress indicators
**Enhancement Tasks:**
- Add confirmation dialogs for destructive actions (stop/restart/rebuild)
- Complete visual feedback for System and Backup panels
- Test backup trigger functionality
- Implement command history/logging
- Add keyboard shortcuts help overlay
**Future Enhanced Navigation:**
- Add Page Up/Down for faster scrolling through long service lists
@@ -155,7 +146,7 @@ Latest backup: → Latest backup:
**Future Advanced Features:**
- Service dependency visualization
- Historical service status tracking
- Backup trigger functionality with progress indication
- Real-time log viewing integration
## Core Architecture Principles - CRITICAL