pub mod cpu_matrix_grid;
pub mod cpu_matrix_tile;
pub mod cpu_status;
pub mod gpu_matrix_tile;
pub mod gpu_panel;
pub mod help;
pub mod layout;
pub mod memory_bars;
pub mod ollama_panel;
pub mod process_browser;
pub mod selected_workload;
pub mod status_header;
use crate::app::{App, CpuView};
use ratatui::prelude::*;
pub fn draw(frame: &mut Frame<'_>, app: &App) {
let areas = layout::main(frame.area(), app.cpu.cores.len());
status_header::render(frame, areas.header, app);
let cpu_view = if layout::is_compact(frame.area()) {
CpuView::MicroHeatmap
} else {
app.cpu_view
};
match cpu_view {
CpuView::MatrixTiles => cpu_matrix_grid::render(frame, areas.cpu, app),
CpuView::MicroHeatmap => cpu_matrix_grid::render_micro(frame, areas.cpu, app),
}
selected_workload::render(frame, areas.workload, app);
memory_bars::render(frame, areas.memory, &app.memory);
gpu_panel::render(frame, areas.gpu, &app.gpu);
ollama_panel::render(frame, areas.ollama, &app.ollama);
if app.process_browser {
process_browser::render(frame, app);
}
if app.show_help {
help::render(frame, frame.area());
}
}