34 lines
1.1 KiB
Rust
34 lines
1.1 KiB
Rust
use std::{process::exit, time::Duration};
|
|
|
|
use ratatui::{
|
|
layout::{self, Constraint, Layout},
|
|
prelude::Stylize,
|
|
widgets::{Block, Borders},
|
|
};
|
|
mod data_graph;
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
ratatui::run(|terminal| loop {
|
|
terminal.draw(|frame| {
|
|
let layout = frame.area().layout_vec(&Layout::vertical([
|
|
Constraint::Percentage(33),
|
|
Constraint::Percentage(33),
|
|
Constraint::Percentage(33),
|
|
]));
|
|
let middle = layout[1].layout_vec(&Layout::horizontal([
|
|
Constraint::Percentage(33),
|
|
Constraint::Percentage(33),
|
|
Constraint::Percentage(33),
|
|
]));
|
|
let widget = Block::new()
|
|
.border_type(ratatui::widgets::BorderType::Rounded)
|
|
.borders(Borders::ALL)
|
|
.title("Mroew");
|
|
frame.render_widget(widget, middle[1]);
|
|
})?;
|
|
if crossterm::event::read().unwrap().is_key_press() {
|
|
break Ok(());
|
|
};
|
|
})
|
|
}
|