Skip to content

Conversation

@michelroegl-brunner
Copy link
Member

🚀 Container Running Status Feature

This PR adds real-time container running status indicators to the installed scripts tab with automatic refresh every 60 seconds.

✨ Features

  • Visual Status Indicators: Green/red dots next to container IDs showing running/stopped status
  • Auto-Refresh: Status updates automatically every 60 seconds
  • Multi-Server Support: Works with both local and SSH remote containers
  • Performance Optimized: Batches status checks per server (1 call per server vs 1 per container)
  • Responsive Design: Works on both desktop table and mobile card views
  • Manual Refresh: Added refresh button for on-demand status checking

🔧 Technical Implementation

  • Backend: New tRPC endpoint with batched processing
  • Frontend: Updated UI components with status indicators and auto-refresh logic
  • Performance: Optimized from N SSH calls to 1 call per server
  • TypeScript: Full type safety with updated interfaces

📊 Performance Impact

  • Before: 10 containers = 10 SSH calls
  • After: 10 containers on 1 server = 1 SSH call (10x faster)

🎯 User Experience

  • Status indicators appear immediately when switching to installed scripts tab
  • Real-time updates every 60 seconds
  • Clear visual feedback: 🟢 Running, 🔴 Stopped, ⚪ Unknown
  • Manual refresh option for immediate updates

🧪 Testing

  • Local container status checking
  • SSH remote container status checking
  • Auto-refresh functionality
  • UI responsiveness
  • Error handling and fallbacks

Resolves container status visibility in installed scripts tab.

- Add getContainerStatuses tRPC endpoint for checking container status
- Support both local and SSH remote container status checking
- Add 60-second auto-refresh for real-time status updates
- Display green/red dots next to container IDs showing running/stopped status
- Update both desktop table and mobile card views
- Add proper error handling and fallback to 'unknown' status
- Full TypeScript support with updated interfaces

Resolves container status visibility in installed scripts tab
- Change default sort field from 'script_name' to 'server_name'
- Implement multi-level sorting: server name first, then container ID
- Use numeric sorting for container IDs for proper ordering
- Maintain existing sorting behavior for other fields
- Improves organization by grouping related containers together
- Add multiple triggers for container status checks:
  - When component mounts (tab becomes active)
  - When scripts data loads
  - Every 60 seconds via interval
- Add manual 'Refresh Container Status' button for on-demand checking
- Add console logging for debugging status check triggers
- Ensure status checks happen reliably when switching to installed scripts tab

Fixes issue where status checks weren't triggering when tab loads
- Group containers by server and make one pct list call per server
- Replace individual container checks with batch processing
- Parse all container statuses from single pct list response per server
- Add proper TypeScript safety checks for undefined values
- Significantly reduce SSH calls from N containers to 1 call per server

This should dramatically speed up status loading for multiple containers on the same server
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner October 13, 2025 13:23
@michelroegl-brunner michelroegl-brunner self-assigned this Oct 13, 2025
- Fix React Hook dependency warnings by using useCallback and useMemo
- Fix TypeScript unsafe argument errors with proper Server type
- Fix nullish coalescing operator preferences
- Fix floating promise warnings with void operator
- All ESLint warnings and errors now resolved

Ensures clean code quality for PR merge
@michelroegl-brunner michelroegl-brunner merged commit 53b5074 into main Oct 13, 2025
4 checks passed
@michelroegl-brunner michelroegl-brunner deleted the feat/show_lxc_running_state branch October 14, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants