@@ -34,12 +34,14 @@ const ASCII_BANNER: [&str; 7] = [
34 " ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝",
34 " ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝",
37+const INFO_LINE_COUNT: u16 = 5;
38#[derive(Debug, Clone)]
39#[derive(Debug, Clone)]
39pub struct VmInfo {
40pub struct VmInfo {
41 pub max_memory_mb: u64,
41 pub max_memory_mb: u64,
42 pub cpu_cores: usize,
42 pub cpu_cores: usize,
43+ pub system_name: String,
44+ pub auto_shutdown_ms: u64,
45#[derive(Debug)]
47#[derive(Debug)]
@@ -155,10 +157,14 @@ fn compute_page_layout(app: &AppState, width: u16) -> PageLayout {
155fn header_height() -> u16 {
157fn header_height() -> u16 {
156 let banner_height = ASCII_BANNER.len() as u16;
158 let banner_height = ASCII_BANNER.len() as u16;
157 let welcome_height = 1;
159 let welcome_height = 1;
158− let info_height = 4;
160+ let info_height = info_block_height();
159 welcome_height + banner_height + info_height
161 welcome_height + banner_height + info_height
164+fn info_block_height() -> u16 {
165+ INFO_LINE_COUNT.saturating_add(1)
162pub fn render_tui_once(app: &mut AppState) -> Result<()> {
168pub fn render_tui_once(app: &mut AppState) -> Result<()> {
163 let (width, _) = crossterm::terminal::size()?;
169 let (width, _) = crossterm::terminal::size()?;
164 if width == 0 {
170 if width == 0 {
@@ -532,13 +538,15 @@ fn render_header(buffer: &mut Buffer, area: Rect, app: &AppState) {
532 .constraints([
538 .constraints([
533 Constraint::Length(1),
539 Constraint::Length(1),
534 Constraint::Length(ASCII_BANNER.len() as u16),
540 Constraint::Length(ASCII_BANNER.len() as u16),
535− Constraint::Length(4),
541+ Constraint::Length(info_block_height()),
537 .split(area);
543 .split(area);
545+ let version = env!("CARGO_PKG_VERSION");
539 let welcome = Line::from(vec![
547 let welcome = Line::from(vec![
540 Span::raw("Welcome to Vibebox v"),
548 Span::raw("Welcome to Vibebox v"),
541− Span::styled(&app.vm_info.version, Style::default().fg(Color::Yellow)),
549+ Span::styled(version, Style::default().fg(Color::Yellow)),
544 Paragraph::new(welcome).render(header_chunks[0], buffer);
552 Paragraph::new(welcome).render(header_chunks[0], buffer);
@@ -557,8 +565,8 @@ fn render_header(buffer: &mut Buffer, area: Rect, app: &AppState) {
557 Span::styled(app.cwd.to_string_lossy(), Style::default().fg(Color::Cyan)),
565 Span::styled(app.cwd.to_string_lossy(), Style::default().fg(Color::Cyan)),
559 Line::from(vec![
567 Line::from(vec![
560− Span::raw("VM Version: "),
568+ Span::raw("System: "),
561− Span::styled(&app.vm_info.version, Style::default().fg(Color::Green)),
569+ Span::styled(&app.vm_info.system_name, Style::default().fg(Color::Green)),
563 Line::from(vec![
571 Line::from(vec![
564 Span::raw("CPU / Memory: "),
572 Span::raw("CPU / Memory: "),
@@ -570,6 +578,13 @@ fn render_header(buffer: &mut Buffer, area: Rect, app: &AppState) {
570 Style::default().fg(Color::Green),
578 Style::default().fg(Color::Green),
582+ Span::raw("Auto Shutdown: "),
584+ format!("{} ms", app.vm_info.auto_shutdown_ms),
585+ Style::default().fg(Color::Green),
575 Paragraph::new(info_lines)
590 Paragraph::new(info_lines)