Skip to content

Commit 8838faf

Browse files
authored
chore(deps): Swap tui crate for ratatui (vectordotdev#18225)
* chore(deps): Swap tui crate for ratatui The `tui` crate is unmaintained and points to `ratatui` as the mantained fork. Signed-off-by: Jesse Szwedko <[email protected]> * Spelling Signed-off-by: Jesse Szwedko <[email protected]> * Regenerate license file Signed-off-by: Jesse Szwedko <[email protected]> --------- Signed-off-by: Jesse Szwedko <[email protected]>
1 parent 8bbe6a6 commit 8838faf

File tree

6 files changed

+30
-43
lines changed

6 files changed

+30
-43
lines changed

.github/actions/spelling/expect.txt

+1
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ qwe
869869
raboof
870870
rande
871871
RANDFILE
872+
ratatui
872873
rawconfig
873874
rawstring
874875
rdkafka

Cargo.lock

+17-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ itertools = { version = "0.11.0", default-features = false, optional = true }
229229
crossterm = { version = "0.26.1", default-features = false, features = ["event-stream"], optional = true }
230230
num-format = { version = "0.4.4", default-features = false, features = ["with-num-bigint"], optional = true }
231231
number_prefix = { version = "0.4.0", default-features = false, features = ["std"], optional = true }
232-
tui = { version = "0.19.0", optional = true, default-features = false, features = ["crossterm"] }
232+
ratatui = { version = "0.22.0", optional = true, default-features = false, features = ["crossterm"] }
233233

234234
# Datadog Pipelines
235235

@@ -443,7 +443,7 @@ api-client = [
443443
"dep:crossterm",
444444
"dep:num-format",
445445
"dep:number_prefix",
446-
"dep:tui",
446+
"dep:ratatui",
447447
"vector-core/api",
448448
"dep:vector-api-client",
449449
]

LICENSE-3rdparty.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ rand_chacha,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Proj
422422
rand_distr,https://github.com/rust-random/rand,MIT OR Apache-2.0,The Rand Project Developers
423423
rand_hc,https://github.com/rust-random/rand,MIT OR Apache-2.0,The Rand Project Developers
424424
rand_xorshift,https://github.com/rust-random/rngs,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
425+
ratatui,https://github.com/tui-rs-revival/ratatui,MIT,"Florian Dehau <[email protected]>, The Ratatui Developers"
425426
raw-cpuid,https://github.com/gz/rust-cpuid,MIT,Gerd Zellweger <[email protected]>
426427
raw-window-handle,https://github.com/rust-windowing/raw-window-handle,MIT OR Apache-2.0 OR Zlib,Osspial <[email protected]>
427428
rdkafka,https://github.com/fede1024/rust-rdkafka,MIT,Federico Giraud <[email protected]>
@@ -568,7 +569,6 @@ treediff,https://github.com/Byron/treediff-rs,MIT OR Apache-2.0,Sebastian Thiel
568569
trust-dns-proto,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <[email protected]>
569570
trust-dns-resolver,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <[email protected]>
570571
try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur <[email protected]>
571-
tui,https://github.com/fdehau/tui-rs,MIT,Florian Dehau <[email protected]>
572572
tungstenite,https://github.com/snapview/tungstenite-rs,MIT OR Apache-2.0,"Alexey Galakhov, Daniel Abramov"
573573
twox-hash,https://github.com/shepmaster/twox-hash,MIT,Jake Goulding <[email protected]>
574574
typed-builder,https://github.com/idanarye/rust-typed-builder,MIT OR Apache-2.0,"IdanArye <[email protected]>, Chris Morgan <[email protected]>"

src/top/dashboard.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ use crossterm::{
99
};
1010
use num_format::{Locale, ToFormattedString};
1111
use number_prefix::NumberPrefix;
12-
use std::io::stdout;
13-
use tokio::sync::oneshot;
14-
use tui::{
12+
use ratatui::{
1513
backend::{Backend, CrosstermBackend},
1614
layout::{Alignment, Constraint, Layout, Rect},
1715
style::{Color, Modifier, Style},
18-
text::{Span, Spans},
16+
text::{Line, Span},
1917
widgets::{Block, Borders, Cell, Paragraph, Row, Table, Wrap},
2018
Frame, Terminal,
2119
};
20+
use std::io::stdout;
21+
use tokio::sync::oneshot;
2222

2323
use super::{
2424
events::capture_key_press,
@@ -180,7 +180,7 @@ impl<'a> Widgets<'a> {
180180
];
181181
text.extend(connection_status.as_ui_spans());
182182

183-
let text = vec![Spans::from(text)];
183+
let text = vec![Line::from(text)];
184184

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

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

317317
let block = Block::default()
318318
.borders(Borders::ALL)

src/top/state.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::collections::{BTreeMap, HashMap};
22

33
use chrono::{DateTime, Local};
4-
use tokio::sync::mpsc;
5-
use tui::{
4+
use ratatui::{
65
style::{Color, Style},
76
text::Span,
87
};
8+
use tokio::sync::mpsc;
99
use vector_core::internal_event::DEFAULT_OUTPUT;
1010

1111
use crate::config::ComponentKey;

0 commit comments

Comments
 (0)