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"] }

# Datadog Pipelines

Expand Down Expand Up @@ -443,7 +443,7 @@ api-client = [
"dep:crossterm",
"dep:num-format",
"dep:number_prefix",
"dep:tui",
"dep:ratatui",
"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 <[email protected]>, The Ratatui Developers"
raw-cpuid,https://github.com/gz/rust-cpuid,MIT,Gerd Zellweger <[email protected]>
raw-window-handle,https://github.com/rust-windowing/raw-window-handle,MIT OR Apache-2.0 OR Zlib,Osspial <[email protected]>
rdkafka,https://github.com/fede1024/rust-rdkafka,MIT,Federico Giraud <[email protected]>
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 <[email protected]>
trust-dns-resolver,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <[email protected]>
try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur <[email protected]>
tui,https://github.com/fdehau/tui-rs,MIT,Florian Dehau <[email protected]>
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 <[email protected]>
typed-builder,https://github.com/idanarye/rust-typed-builder,MIT OR Apache-2.0,"IdanArye <[email protected]>, Chris Morgan <[email protected]>"
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::{
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::{
style::{Color, Style},
text::Span,
};
use tokio::sync::mpsc;
use vector_core::internal_event::DEFAULT_OUTPUT;

use crate::config::ComponentKey;
Expand Down