Skip to content

Commit

Permalink
feat: use ratatui
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Mar 19, 2023
1 parent bcf98c9 commit d431f85
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 94 deletions.
170 changes: 86 additions & 84 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ parking_lot = {version= "0.12"}
tokio = {version = "1.26", features=["full"]}
tracing = "0.1"
tracing-subscriber = "0.3"
tui = "0.19"
ratatui = "0.20"
uuid = {version = "1.3", features = ["v4", "fast-rng"]}

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>

<p align="center">
Built in <a href='https://www.rust-lang.org/' target='_blank' rel='noopener noreferrer'>Rust</a>, making heavy use of <a href='https://github.com/fdehau/tui-rs' target='_blank' rel='noopener noreferrer'>tui-rs</a> & <a href='https://github.com/fussybeaver/bollard' target='_blank' rel='noopener noreferrer'>Bollard</a>
Built in <a href='https://www.rust-lang.org/' target='_blank' rel='noopener noreferrer'>Rust</a>, making heavy use of <a href='https://github.com/tui-rs-revival/ratatui' target='_blank' rel='noopener noreferrer'>ratatui</a> & <a href='https://github.com/fussybeaver/bollard' target='_blank' rel='noopener noreferrer'>Bollard</a>
</p>

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion src/app_data/container_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
fmt,
};

use tui::{
use ratatui::{
style::Color,
widgets::{ListItem, ListState},
};
Expand Down
2 changes: 1 addition & 1 deletion src/app_data/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bollard::models::ContainerSummary;
use core::fmt;
use std::time::{SystemTime, UNIX_EPOCH};
use tui::widgets::{ListItem, ListState};
use ratatui::widgets::{ListItem, ListState};

mod container_state;

Expand Down
2 changes: 1 addition & 1 deletion src/input_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tokio::{
sync::mpsc::{Receiver, Sender},
task::JoinHandle,
};
use tui::layout::Rect;
use ratatui::layout::Rect;

mod message;
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/color_match.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod log_sanitizer {

use cansi::{v3::categorise_text, Color as CansiColor, Intensity};
use tui::{
use ratatui::{
style::{Color, Modifier, Style},
text::{Span, Spans},
};
Expand Down
4 changes: 2 additions & 2 deletions src/ui/draw_blocks.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use parking_lot::Mutex;
use std::default::Default;
use std::{fmt::Display, sync::Arc};
use tui::{
use ratatui::{
backend::Backend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Color, Modifier, Style},
Expand Down Expand Up @@ -500,7 +500,7 @@ impl HelpInfo {
spans
.iter()
.flat_map(|x| x.0.iter())
.map(tui::text::Span::width)
.map(ratatui::text::Span::width)
.max()
.unwrap_or(1)
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/gui_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{
collections::{HashMap, HashSet},
fmt,
};
use tui::layout::{Constraint, Rect};
use ratatui::layout::{Constraint, Rect};
use uuid::Uuid;

use crate::app_data::Header;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::{
use std::{sync::atomic::AtomicBool, time::Instant};
use tokio::sync::mpsc::Sender;
use tracing::error;
use tui::{
use ratatui::{
backend::{Backend, CrosstermBackend},
layout::{Constraint, Direction, Layout},
Frame, Terminal,
Expand Down

0 comments on commit d431f85

Please sign in to comment.