Implement real-time terminal popup for system rebuild operations
All checks were successful
Build and Release / build-and-release (push) Successful in 1m21s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m21s
- Add terminal popup UI component with 80% screen coverage and terminal styling - Extend ZMQ protocol with CommandOutputMessage for streaming output - Implement real-time output streaming in agent system rebuild handler - Add keyboard controls (ESC/Q to close, ↑↓ to scroll) for popup interaction - Fix system panel Build display to show actual NixOS build instead of config hash - Update service filters in README with wildcard patterns for better matching - Add periodic progress updates during nixos-rebuild execution - Integrate command output handling in dashboard main loop
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use anyhow::Result;
|
||||
use cm_dashboard_shared::{MessageEnvelope, MetricMessage};
|
||||
use cm_dashboard_shared::{CommandOutputMessage, MessageEnvelope, MetricMessage};
|
||||
use tracing::{debug, info};
|
||||
use zmq::{Context, Socket, SocketType};
|
||||
|
||||
@@ -65,6 +65,24 @@ impl ZmqHandler {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Publish command output message via ZMQ
|
||||
pub async fn publish_command_output(&self, message: &CommandOutputMessage) -> Result<()> {
|
||||
debug!(
|
||||
"Publishing command output for host {} (command: {}): {}",
|
||||
message.hostname,
|
||||
message.command_type,
|
||||
message.output_line
|
||||
);
|
||||
|
||||
let envelope = MessageEnvelope::command_output(message.clone())?;
|
||||
let serialized = serde_json::to_vec(&envelope)?;
|
||||
|
||||
self.publisher.send(&serialized, 0)?;
|
||||
|
||||
debug!("Command output published successfully");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Send heartbeat (placeholder for future use)
|
||||
|
||||
/// Try to receive a command (non-blocking)
|
||||
|
||||
Reference in New Issue
Block a user