diff --git a/src/ui/components/header.rs b/src/ui/components/header.rs index a608b7a..c9b7b5b 100644 --- a/src/ui/components/header.rs +++ b/src/ui/components/header.rs @@ -14,10 +14,17 @@ pub fn render_header(frame: &mut Frame, area: Rect, state: &DashboardViewState) } else { format!("{} - {}", t("dashboard-header"), state.title) }; + let description = state + .descriptions + .as_ref() + .filter(|s| !s.trim().is_empty()) + .map(|s| format!(" - {}", s)) + .unwrap_or("".to_string()); let header = Paragraph::new(Line::from(vec![ Span::styled("📈 ", Style::default().fg(Color::Cyan)), Span::styled(title, Style::default().fg(Color::White).bold()), + Span::styled(description, Style::default().fg(Color::White).bold()), ])) .alignment(Alignment::Center) .block( diff --git a/src/ui/dashboard/model.rs b/src/ui/dashboard/model.rs index 24da417..f25df96 100644 --- a/src/ui/dashboard/model.rs +++ b/src/ui/dashboard/model.rs @@ -13,11 +13,9 @@ pub enum MonitorStatus { pub struct MonitorViewState { pub id: u64, pub name: String, - pub group_name: String, pub status: MonitorStatus, pub response_time: String, pub uptime_24h: String, - pub last_check: String, pub status_history: Vec, } @@ -118,20 +116,12 @@ fn add_monitor_view_state(group: UnifiedGroupData) -> Vec { .map(|u| u.get_perc_formated()) .unwrap_or_else(|| t("unknown").to_string()); - let last_check = monitor - .heartbeats - .last() - .map(|h| h.time.clone()) - .unwrap_or_else(|| t("never").to_string()); - monitors.push(MonitorViewState { id: monitor.monitor_info.id, name: monitor.monitor_info.name, - group_name: group.group_info.name.clone(), status, response_time, uptime_24h, - last_check, status_history, }); }