Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Swap tui crate for ratatui #18225

Merged
merged 3 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ qwe
raboof
rande
RANDFILE
ratatui
rawconfig
rawstring
rdkafka
Expand Down
48 changes: 17 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ itertools = { version = "0.11.0", default-features = false, optional = true }
crossterm = { version = "0.26.1", default-features = false, features = ["event-stream"], optional = true }
num-format = { version = "0.4.4", default-features = false, features = ["with-num-bigint"], optional = true }
number_prefix = { version = "0.4.0", default-features = false, features = ["std"], optional = true }
tui = { version = "0.19.0", optional = true, default-features = false, features = ["crossterm"] }
ratatui = { version = "0.22.0", optional = true, default-features = false, features = ["crossterm"] }
Fixed Show fixed Hide fixed

# Datadog Pipelines

Expand Down Expand Up @@ -443,7 +443,7 @@ api-client = [
"dep:crossterm",
"dep:num-format",
"dep:number_prefix",
"dep:tui",
"dep:ratatui",
Fixed Show fixed Hide fixed
"vector-core/api",
"dep:vector-api-client",
]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ rand_chacha,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Proj
rand_distr,https://github.com/rust-random/rand,MIT OR Apache-2.0,The Rand Project Developers
rand_hc,https://github.com/rust-random/rand,MIT OR Apache-2.0,The Rand Project Developers
rand_xorshift,https://github.com/rust-random/rngs,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
ratatui,https://github.com/tui-rs-revival/ratatui,MIT,"Florian Dehau <work@fdehau.com>, The Ratatui Developers"
raw-cpuid,https://github.com/gz/rust-cpuid,MIT,Gerd Zellweger <mail@gerdzellweger.com>
raw-window-handle,https://github.com/rust-windowing/raw-window-handle,MIT OR Apache-2.0 OR Zlib,Osspial <osspial@gmail.com>
rdkafka,https://github.com/fede1024/rust-rdkafka,MIT,Federico Giraud <giraud.federico@gmail.com>
Expand Down Expand Up @@ -568,7 +569,6 @@ treediff,https://github.com/Byron/treediff-rs,MIT OR Apache-2.0,Sebastian Thiel
trust-dns-proto,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
trust-dns-resolver,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur <sean@seanmonstar.com>
tui,https://github.com/fdehau/tui-rs,MIT,Florian Dehau <work@fdehau.com>
tungstenite,https://github.com/snapview/tungstenite-rs,MIT OR Apache-2.0,"Alexey Galakhov, Daniel Abramov"
twox-hash,https://github.com/shepmaster/twox-hash,MIT,Jake Goulding <jake.goulding@gmail.com>
typed-builder,https://github.com/idanarye/rust-typed-builder,MIT OR Apache-2.0,"IdanArye <idanarye@gmail.com>, Chris Morgan <me@chrismorgan.info>"
Expand Down
14 changes: 7 additions & 7 deletions src/top/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ use crossterm::{
};
use num_format::{Locale, ToFormattedString};
use number_prefix::NumberPrefix;
use std::io::stdout;
use tokio::sync::oneshot;
use tui::{
use ratatui::{
Fixed Show fixed Hide fixed
backend::{Backend, CrosstermBackend},
layout::{Alignment, Constraint, Layout, Rect},
style::{Color, Modifier, Style},
text::{Span, Spans},
text::{Line, Span},
widgets::{Block, Borders, Cell, Paragraph, Row, Table, Wrap},
Frame, Terminal,
};
use std::io::stdout;
use tokio::sync::oneshot;

use super::{
events::capture_key_press,
Expand Down Expand Up @@ -180,7 +180,7 @@ impl<'a> Widgets<'a> {
];
text.extend(connection_status.as_ui_spans());

let text = vec![Spans::from(text)];
let text = vec![Line::from(text)];

let block = Block::default().borders(Borders::ALL).title(Span::styled(
self.title,
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<'a> Widgets<'a> {
.into_iter()
.map(Cell::from)
.collect::<Vec<_>>();
data[1] = Cell::from(id.as_ref());
data[1] = Cell::from(id.as_str());
data[5] = Cell::from(sent_events_metric);
items.push(Row::new(data).style(Style::default()));
}
Expand Down Expand Up @@ -312,7 +312,7 @@ impl<'a> Widgets<'a> {

/// Renders a box showing instructions on how to exit from `vector top`.
fn quit_box<B: Backend>(&self, f: &mut Frame<B>, area: Rect) {
let text = vec![Spans::from("To quit, press ESC or 'q'")];
let text = vec![Line::from("To quit, press ESC or 'q'")];

let block = Block::default()
.borders(Borders::ALL)
Expand Down
4 changes: 2 additions & 2 deletions src/top/state.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::collections::{BTreeMap, HashMap};

use chrono::{DateTime, Local};
use tokio::sync::mpsc;
use tui::{
use ratatui::{
Fixed Show fixed Hide fixed
style::{Color, Style},
text::Span,
};
use tokio::sync::mpsc;
use vector_core::internal_event::DEFAULT_OUTPUT;

use crate::config::ComponentKey;
Expand Down