Clean up UI code and improve agent hash display
- Remove unused imports and debug logging - Change agent display from 'Agent Hash: full' to 'Agent: short8' - Fix unused variable warnings
This commit is contained in:
parent
c5ec529210
commit
d0ce1726e8
@ -406,7 +406,7 @@ impl TuiApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_system_panel(&mut self, frame: &mut Frame, area: Rect, metric_store: &MetricStore) {
|
fn render_system_panel(&mut self, frame: &mut Frame, area: Rect, _metric_store: &MetricStore) {
|
||||||
let system_block = Components::widget_block("system");
|
let system_block = Components::widget_block("system");
|
||||||
let inner_area = system_block.inner(area);
|
let inner_area = system_block.inner(area);
|
||||||
frame.render_widget(system_block, area);
|
frame.render_widget(system_block, area);
|
||||||
|
|||||||
@ -8,8 +8,6 @@ pub mod services;
|
|||||||
pub mod system;
|
pub mod system;
|
||||||
|
|
||||||
pub use backup::BackupWidget;
|
pub use backup::BackupWidget;
|
||||||
pub use cpu::CpuWidget;
|
|
||||||
pub use memory::MemoryWidget;
|
|
||||||
pub use services::ServicesWidget;
|
pub use services::ServicesWidget;
|
||||||
pub use system::SystemWidget;
|
pub use system::SystemWidget;
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
use cm_dashboard_shared::{Metric, MetricValue, Status};
|
use cm_dashboard_shared::{Metric, MetricValue, Status};
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
layout::Rect,
|
layout::Rect,
|
||||||
style::Style,
|
|
||||||
text::{Line, Span, Text},
|
text::{Line, Span, Text},
|
||||||
widgets::{Block, Borders, Paragraph},
|
widgets::Paragraph,
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -299,10 +298,6 @@ impl Widget for SystemWidget {
|
|||||||
self.has_data = !metrics.is_empty();
|
self.has_data = !metrics.is_empty();
|
||||||
|
|
||||||
for metric in metrics {
|
for metric in metrics {
|
||||||
// Debug logging for NixOS metrics
|
|
||||||
if metric.name.starts_with("system_") {
|
|
||||||
tracing::debug!("SystemWidget received metric: {} = {:?}", metric.name, metric.value);
|
|
||||||
}
|
|
||||||
match metric.name.as_str() {
|
match metric.name.as_str() {
|
||||||
// NixOS metrics
|
// NixOS metrics
|
||||||
"system_nixos_build" => {
|
"system_nixos_build" => {
|
||||||
@ -405,8 +400,13 @@ impl Widget for SystemWidget {
|
|||||||
]));
|
]));
|
||||||
|
|
||||||
let agent_hash_text = self.agent_hash.as_deref().unwrap_or("unknown");
|
let agent_hash_text = self.agent_hash.as_deref().unwrap_or("unknown");
|
||||||
|
let short_hash = if agent_hash_text.len() > 8 && agent_hash_text != "unknown" {
|
||||||
|
&agent_hash_text[..8]
|
||||||
|
} else {
|
||||||
|
agent_hash_text
|
||||||
|
};
|
||||||
lines.push(Line::from(vec![
|
lines.push(Line::from(vec![
|
||||||
Span::styled(format!("Agent Hash: {}", agent_hash_text), Typography::secondary())
|
Span::styled(format!("Agent: {}", short_hash), Typography::secondary())
|
||||||
]));
|
]));
|
||||||
|
|
||||||
// CPU section
|
// CPU section
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user