From 8f8cca54ace4d03229c05df48ae8aa3b4aa9ee9f Mon Sep 17 00:00:00 2001 From: Rain Date: Mon, 5 Feb 2024 18:07:44 -0800 Subject: [PATCH] [wicket] update to ratatui 0.26 (#4991) Just a couple small updates. --- Cargo.lock | 83 ++++++++++++++++++++++++------- Cargo.toml | 4 +- wicket/src/ui/panes/update.rs | 13 ++--- wicket/src/ui/widgets/ignition.rs | 43 ++++++++-------- 4 files changed, 93 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c00f0c17f6..ad6502d26e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -466,7 +466,7 @@ source = "git+https://github.com/oxidecomputer/propolis?rev=ff6c4df2e816eee6e7b2 dependencies = [ "bhyve_api_sys", "libc", - "strum", + "strum 0.25.0", ] [[package]] @@ -475,7 +475,7 @@ version = "0.0.0" source = "git+https://github.com/oxidecomputer/propolis?rev=ff6c4df2e816eee6e7b2b0488777d30ef35ee217#ff6c4df2e816eee6e7b2b0488777d30ef35ee217" dependencies = [ "libc", - "strum", + "strum 0.25.0", ] [[package]] @@ -830,6 +830,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "castaway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +dependencies = [ + "rustversion", +] + [[package]] name = "cbc" version = "0.1.2" @@ -1049,6 +1058,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "ryu", + "static_assertions", +] + [[package]] name = "console" version = "0.15.8" @@ -4313,7 +4335,7 @@ dependencies = [ "serde_json", "sled-agent-client", "steno", - "strum", + "strum 0.25.0", "thiserror", "uuid", ] @@ -4385,7 +4407,7 @@ dependencies = [ "slog", "static_assertions", "steno", - "strum", + "strum 0.25.0", "subprocess", "swrite", "term", @@ -4448,7 +4470,7 @@ dependencies = [ "serde_json", "sled-agent-client", "slog", - "strum", + "strum 0.25.0", "thiserror", "tokio", "uuid", @@ -4537,7 +4559,7 @@ dependencies = [ "serde_json", "sled-agent-client", "steno", - "strum", + "strum 0.25.0", "thiserror", "uuid", ] @@ -4854,7 +4876,7 @@ dependencies = [ "serde_urlencoded", "serde_with", "slog", - "strum", + "strum 0.25.0", "test-strategy", "thiserror", "tokio", @@ -5057,7 +5079,7 @@ dependencies = [ "slog-term", "sp-sim", "steno", - "strum", + "strum 0.25.0", "subprocess", "tempfile", "term", @@ -5110,7 +5132,7 @@ dependencies = [ "sled-agent-client", "slog", "slog-error-chain", - "strum", + "strum 0.25.0", "subprocess", "tabled", "textwrap 0.16.0", @@ -5145,7 +5167,7 @@ dependencies = [ "slog-bunyan", "slog-term", "smf", - "strum", + "strum 0.25.0", "swrite", "tar", "thiserror", @@ -5669,7 +5691,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "strum", + "strum 0.25.0", "thiserror", "trybuild", "uuid", @@ -5722,7 +5744,7 @@ dependencies = [ "slog-async", "slog-dtrace", "slog-term", - "strum", + "strum 0.25.0", "subprocess", "thiserror", "tokio", @@ -5764,7 +5786,7 @@ dependencies = [ "slog-term", "sqlformat", "sqlparser", - "strum", + "strum 0.25.0", "tabled", "tempfile", "thiserror", @@ -6850,19 +6872,20 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5659e52e4ba6e07b2dad9f1158f578ef84a73762625ddb51536019f34d180eb" +checksum = "154b85ef15a5d1719bcaa193c3c81fe645cd120c156874cd660fe49fd21d1373" dependencies = [ "bitflags 2.4.0", "cassowary", + "compact_str", "crossterm", "indoc 2.0.3", "itertools 0.12.1", "lru", "paste", "stability", - "strum", + "strum 0.26.1", "unicode-segmentation", "unicode-width", ] @@ -6959,7 +6982,7 @@ dependencies = [ "nu-ansi-term", "serde", "strip-ansi-escapes", - "strum", + "strum 0.25.0", "strum_macros 0.25.2", "thiserror", "unicode-segmentation", @@ -8663,6 +8686,15 @@ dependencies = [ "strum_macros 0.25.2", ] +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +dependencies = [ + "strum_macros 0.26.1", +] + [[package]] name = "strum_macros" version = "0.24.3" @@ -8689,6 +8721,19 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.48", +] + [[package]] name = "subprocess" version = "0.2.9" @@ -9597,9 +9642,9 @@ dependencies = [ [[package]] name = "tui-tree-widget" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136011b328c4f392499a02c4b5b78d509fb297bf9c10f2bda5d11d65cb946e4c" +checksum = "5c317bb061f42d943a2eb118b5de0ee98fc2443f0631e54b24a19de014a28810" dependencies = [ "ratatui", "unicode-width", diff --git a/Cargo.toml b/Cargo.toml index 6e4799d184..b368bd114b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -314,7 +314,7 @@ propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev proptest = "1.4.0" quote = "1.0" rand = "0.8.5" -ratatui = "0.25.0" +ratatui = "0.26.0" rayon = "1.8" rcgen = "0.12.1" reedline = "0.28.0" @@ -400,7 +400,7 @@ trust-dns-server = "0.22" trybuild = "1.0.89" tufaceous = { path = "tufaceous" } tufaceous-lib = { path = "tufaceous-lib" } -tui-tree-widget = "0.16.0" +tui-tree-widget = "0.17.0" unicode-width = "0.1.11" update-common = { path = "update-common" } update-engine = { path = "update-engine" } diff --git a/wicket/src/ui/panes/update.rs b/wicket/src/ui/panes/update.rs index be21984997..c009d597c8 100644 --- a/wicket/src/ui/panes/update.rs +++ b/wicket/src/ui/panes/update.rs @@ -1435,12 +1435,13 @@ impl UpdatePane { Constraint::Length(cell_width), Constraint::Length(cell_width), ]; - let header_table = Table::new(std::iter::empty(), &width_constraints) - .header( - Row::new(vec!["COMPONENT", "VERSION", "TARGET", "STATUS"]) - .style(header_style), - ) - .block(block.clone().title("OVERVIEW (* = active)")); + let header_table = + Table::new(std::iter::empty::(), &width_constraints) + .header( + Row::new(vec!["COMPONENT", "VERSION", "TARGET", "STATUS"]) + .style(header_style), + ) + .block(block.clone().title("OVERVIEW (* = active)")); frame.render_widget(header_table, self.table_headers_rect); // For the selected item, draw the version table. diff --git a/wicket/src/ui/widgets/ignition.rs b/wicket/src/ui/widgets/ignition.rs index cef942d2c7..1e04c4d02b 100644 --- a/wicket/src/ui/widgets/ignition.rs +++ b/wicket/src/ui/widgets/ignition.rs @@ -61,29 +61,26 @@ impl IgnitionPopup { format!("IGNITION: {}", component.to_string_uppercase()), style::header(true), )]), - body: Text { - lines: vec![ - Line::from(vec![Span::styled( - "Power On", - style::line( - self.selected_command == IgnitionCommand::PowerOn, - ), - )]), - Line::from(vec![Span::styled( - "Power Off", - style::line( - self.selected_command == IgnitionCommand::PowerOff, - ), - )]), - Line::from(vec![Span::styled( - "Power Reset", - style::line( - self.selected_command - == IgnitionCommand::PowerReset, - ), - )]), - ], - }, + body: Text::from(vec![ + Line::from(vec![Span::styled( + "Power On", + style::line( + self.selected_command == IgnitionCommand::PowerOn, + ), + )]), + Line::from(vec![Span::styled( + "Power Off", + style::line( + self.selected_command == IgnitionCommand::PowerOff, + ), + )]), + Line::from(vec![Span::styled( + "Power Reset", + style::line( + self.selected_command == IgnitionCommand::PowerReset, + ), + )]), + ]), buttons: vec![ButtonText::new("Close", "Esc")], } }