From 0631a73ec27530f8fcc88988a0a02ca75e32c5ba Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:25:39 +0000 Subject: [PATCH 01/18] feat: use tokio CancellationToken In docker exec mode, replace use of Arc with a CancellationToken --- Cargo.lock | 1 + Cargo.toml | 1 + src/exec.rs | 60 ++++++++++++++++++++++++++++++----------------------- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a8ea256..55aa956 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -855,6 +855,7 @@ dependencies = [ "parking_lot", "ratatui", "tokio", + "tokio-util", "tracing", "tracing-subscriber", "uuid", diff --git a/Cargo.toml b/Cargo.toml index 12b1974..298cbd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ futures-util = "0.3" parking_lot = { version = "0.12" } ratatui = "0.26" tokio = { version = "1.37", features = ["full"] } +tokio-util = "0.7.10" tracing = "0.1" tracing-subscriber = "0.3" uuid = { version = "1.8", features = ["fast-rng", "v4"] } diff --git a/src/exec.rs b/src/exec.rs index 06b51e1..37c6df8 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -1,6 +1,6 @@ use std::{ io::{Read, Stdout, Write}, - sync::{atomic::AtomicBool, Arc}, + sync::{atomic::AtomicBool, mpsc::Sender, Arc}, }; use bollard::{ @@ -11,7 +11,11 @@ use crossterm::terminal::enable_raw_mode; use futures_util::StreamExt; use parking_lot::Mutex; use ratatui::{backend::CrosstermBackend, Terminal}; -use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::{ + fs::File, + io::{AsyncReadExt, AsyncWriteExt}, +}; +use tokio_util::sync::CancellationToken; use crate::{ app_data::{AppData, ContainerId, State}, @@ -80,24 +84,32 @@ pub fn tty_readable() -> bool { .is_ok() } +async fn tty_read_loop(mut f: File, tx: Sender, cancel_token: CancellationToken) { + loop { + let mut buf = [0]; + if tokio::time::timeout(std::time::Duration::from_millis(10), f.read_exact(&mut buf)) + .await + .is_ok() + && tx.send(buf[0]).is_err() + { + cancel_token.cancel(); + } + } +} /// Async tty reading, spawned into its own tokio thread -fn tty(run: Arc) -> Option { +/// This should be a cancel token +fn tty(cancel_token: &CancellationToken) -> Option { if tty_readable() { let (tx, rx) = std::sync::mpsc::channel(); + let cancel_token = cancel_token.to_owned(); tokio::spawn(async move { - if let Ok(mut f) = tokio::fs::File::open(TTY).await { - while run.load(std::sync::atomic::Ordering::SeqCst) { - let mut buf = [0]; - if tokio::time::timeout( - std::time::Duration::from_millis(10), - f.read_exact(&mut buf), - ) - .await - .is_ok() - && tx.send(buf[0]).is_err() - { - run.store(false, std::sync::atomic::Ordering::SeqCst); - } + if let Ok(f) = tokio::fs::File::open(TTY).await { + let c_1 = cancel_token.clone(); + let c_2 = cancel_token.clone(); + + tokio::select! { + () = c_1.cancelled() => (), + () = tty_read_loop(f, tx, c_2) => (), } } }); @@ -217,7 +229,7 @@ impl ExecMode { docker: &Arc, terminal_size: Option, ) -> Result<(), AppError> { - let run = Arc::new(AtomicBool::new(true)); + let cancel_token = CancellationToken::new(); if let Ok(exec_result) = docker .create_exec( @@ -246,21 +258,17 @@ impl ExecMode { ) .await { - if let Some(async_tty) = tty(Arc::clone(&run)) { - let run_thread = Arc::clone(&run); + if let Some(async_tty) = tty(&cancel_token) { tokio::spawn(async move { enable_raw_mode().ok(); let mut stdout = std::io::stdout(); stdout.write_all(CURSOR_POS.as_bytes()).ok(); stdout.flush().ok(); - - while run_thread.load(std::sync::atomic::Ordering::SeqCst) { - while let Some(Ok(x)) = output.next().await { - stdout.write_all(&x.into_bytes()).ok(); - stdout.flush().ok(); - } - run_thread.store(false, std::sync::atomic::Ordering::SeqCst); + while let Some(Ok(x)) = output.next().await { + stdout.write_all(&x.into_bytes()).ok(); + stdout.flush().ok(); } + cancel_token.cancel(); }); if let Some(terminal_size) = terminal_size { From 07e293ac2ce2e7deb5735154fcdb24ef83a19b67 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:26:34 +0000 Subject: [PATCH 02/18] chore: dependencies updated --- Cargo.lock | 189 ++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 93 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55aa956..6095aea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "autocfg" @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" [[package]] name = "cfg-if" @@ -240,15 +240,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -284,7 +284,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -376,9 +376,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "equivalent" @@ -424,7 +424,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -552,9 +552,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "hyper" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -718,13 +718,12 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -913,7 +912,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -942,18 +941,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -990,9 +989,9 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcb12f8fbf6c62614b0d56eb352af54f6a22410c3b079eb53ee93c7b97dd31d8" +checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" dependencies = [ "bitflags 2.5.0", "cassowary", @@ -1019,9 +1018,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -1036,9 +1035,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" @@ -1054,29 +1053,29 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -1085,13 +1084,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -1189,12 +1188,12 @@ dependencies = [ [[package]] name = "stability" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1205,9 +1204,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -1228,25 +1227,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.57", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "syn", ] [[package]] name = "syn" -version = "2.0.57" +version = "2.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" dependencies = [ "proc-macro2", "quote", @@ -1270,7 +1258,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -1285,9 +1273,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -1306,9 +1294,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -1356,7 +1344,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -1421,7 +1409,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] [[package]] @@ -1582,7 +1570,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.57", + "syn", "wasm-bindgen-shared", ] @@ -1604,7 +1592,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1643,7 +1631,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1661,7 +1649,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1681,17 +1669,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1702,9 +1691,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1714,9 +1703,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1726,9 +1715,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1738,9 +1733,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1750,9 +1745,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1762,9 +1757,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1774,9 +1769,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zerocopy" @@ -1795,5 +1790,5 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn", ] diff --git a/Cargo.toml b/Cargo.toml index 298cbd9..7085340 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ futures-util = "0.3" parking_lot = { version = "0.12" } ratatui = "0.26" tokio = { version = "1.37", features = ["full"] } -tokio-util = "0.7.10" +tokio-util = "0.7" tracing = "0.1" tracing-subscriber = "0.3" uuid = { version = "1.8", features = ["fast-rng", "v4"] } From 4628803b2b9fe63522d033b192763ed6ff5b57dd Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:10:33 +0000 Subject: [PATCH 03/18] fix: header display when width changes Only show header when the cumulative header widths is less than the header section width --- src/ui/draw_blocks.rs | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index a48312d..f37fd17 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -498,13 +498,7 @@ pub fn heading_bar( (Header::Tx, data.columns.net_tx.1), ]; - let header_data = header_meta - .iter() - .map(|i| { - let header_block = gen_header(&i.0, i.1.into()); - (header_block.0, i.0, Constraint::Max(header_block.1)) - }) - .collect::>(); + // Need to add widths to this let suffix = if data.help_visible { "exit" } else { "show" }; let info_text = format!("( h ) {suffix} help {MARGIN}",); @@ -526,7 +520,26 @@ pub fn heading_bar( .direction(Direction::Horizontal) .constraints(splits) .split(area); + if data.has_containers { + let header_section_width = split_bar[1].width; + + let mut counter = 0; + + // Only show a header if the header cumulative header width is less than the header section width + let header_data = header_meta + .iter() + .filter_map(|i| { + let header_block = gen_header(&i.0, i.1.into()); + counter += header_block.1; + if counter <= header_section_width { + Some((header_block.0, i.0, Constraint::Max(header_block.1))) + } else { + None + } + }) + .collect::>(); + // Draw loading icon, or not, and a prefix with a single space let loading_paragraph = Paragraph::new(format!("{:>2}", data.loading_icon)) .block(block(Color::White)) @@ -539,7 +552,6 @@ pub fn heading_bar( .constraints(container_splits) .split(split_bar[1]); - // draw the actual header blocks for (index, (paragraph, header, _)) in header_data.into_iter().enumerate() { let rect = headers_section[index]; gui_state From aa0947405393db2c306e86986183514cbc0f5a75 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:19:11 +0000 Subject: [PATCH 04/18] tests: reduced header section test --- src/ui/draw_blocks.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index f37fd17..002c6ef 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -2311,6 +2311,38 @@ mod tests { } } + #[test] + /// Only show the headings that fit the reduced-in-size header section + fn test_draw_blocks_headers_some_containers_reduced_width() { + let (w, h) = (80, 1); + let mut setup = test_setup(w, h, true, true); + let fd = FrameData::from((setup.app_data.lock(), setup.gui_state.lock())); + + let expected = + " name state status cpu ( h ) show help "; + setup + .terminal + .draw(|f| { + super::heading_bar(setup.area, f, &fd, &setup.gui_state); + }) + .unwrap(); + + let result = &setup.terminal.backend().buffer().content; + for (index, expected_char) in expected.chars().enumerate() { + let result_cell = &result[index]; + + assert_eq!(result_cell.symbol(), expected_char.to_string()); + assert_eq!(result_cell.bg, Color::Magenta); + assert_eq!( + result_cell.fg, + match index { + (2..=62) => Color::Black, + _ => Color::White, + } + ); + } + } + #[test] /// Test all combination of headers & sort by fn test_draw_blocks_headers_sort_containers() { From bf33776e9a61684032a80d22d995ba7e0446620e Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:14:28 +0000 Subject: [PATCH 05/18] refactor: impl AsyncTTY move methods inside of AsyncTTY --- src/exec.rs | 71 +++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/exec.rs b/src/exec.rs index 37c6df8..8af447b 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -84,43 +84,44 @@ pub fn tty_readable() -> bool { .is_ok() } -async fn tty_read_loop(mut f: File, tx: Sender, cancel_token: CancellationToken) { - loop { - let mut buf = [0]; - if tokio::time::timeout(std::time::Duration::from_millis(10), f.read_exact(&mut buf)) - .await - .is_ok() - && tx.send(buf[0]).is_err() - { - cancel_token.cancel(); - } - } + +struct AsyncTTY { + rx: std::sync::mpsc::Receiver, } -/// Async tty reading, spawned into its own tokio thread -/// This should be a cancel token -fn tty(cancel_token: &CancellationToken) -> Option { - if tty_readable() { - let (tx, rx) = std::sync::mpsc::channel(); - let cancel_token = cancel_token.to_owned(); - tokio::spawn(async move { - if let Ok(f) = tokio::fs::File::open(TTY).await { - let c_1 = cancel_token.clone(); - let c_2 = cancel_token.clone(); - - tokio::select! { - () = c_1.cancelled() => (), - () = tty_read_loop(f, tx, c_2) => (), - } + +impl AsyncTTY { + /// Use an async timeout to read data from the file, and send to the "main" thread + async fn read_loop(mut f: File, tx: Sender) { + loop { + let mut buf = [0]; + if tokio::time::timeout(std::time::Duration::from_millis(10), f.read_exact(&mut buf)) + .await + .is_ok() + && tx.send(buf[0]).is_err() + { + break; } - }); - Some(AsyncTTY { rx }) - } else { - None + } } -} -struct AsyncTTY { - rx: std::sync::mpsc::Receiver, + /// Async tty reading, spawned into its own tokio thread + fn get(cancel_token: &CancellationToken) -> Option { + if tty_readable() { + let (tx, rx) = std::sync::mpsc::channel(); + let cancel_token = cancel_token.to_owned(); + tokio::spawn(async move { + if let Ok(f) = tokio::fs::File::open(TTY).await { + tokio::select! { + () = cancel_token.cancelled() => (), + () = Self::read_loop(f, tx) => cancel_token.cancel(), + } + } + }); + Some(Self { rx }) + } else { + None + } + } } /// This is used to set the terminal size when exec via the Internal method @@ -258,7 +259,7 @@ impl ExecMode { ) .await { - if let Some(async_tty) = tty(&cancel_token) { + if let Some(tty) = AsyncTTY::get(&cancel_token) { tokio::spawn(async move { enable_raw_mode().ok(); let mut stdout = std::io::stdout(); @@ -284,7 +285,7 @@ impl ExecMode { .ok(); } - while let Ok(x) = async_tty.rx.recv() { + while let Ok(x) = tty.rx.recv() { input.write_all(&[x]).await.ok(); } From 0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Fri, 19 Apr 2024 19:30:57 +0200 Subject: [PATCH 06/18] Allow closing dialogs with `Escape` --- src/input_handler/mod.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index 77e79bc..2cb4f8e 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -305,7 +305,7 @@ impl InputHandler { } } - /// Change the the "next" seletable panel + /// Change the the "next" selectable panel fn tab_key(&mut self) { let is_containers = self.gui_state.lock().get_selected_panel() == SelectablePanel::Containers; @@ -354,7 +354,7 @@ impl InputHandler { } /// Handle keyboard button events - async fn button_press(&mut self, key_code: KeyCode, key_modififer: KeyModifiers) { + async fn button_press(&mut self, key_code: KeyCode, key_modifier: KeyModifiers) { let contains_delete = self .gui_state .lock() @@ -370,25 +370,30 @@ impl InputHandler { // Always just quit on Ctrl + c/C or q/Q let is_c = || key_code == KeyCode::Char('c') || key_code == KeyCode::Char('C'); let is_q = || key_code == KeyCode::Char('q') || key_code == KeyCode::Char('Q'); - if key_modififer == KeyModifiers::CONTROL && is_c() || is_q() { + if key_modifier == KeyModifiers::CONTROL && is_c() || is_q() { self.quit().await; } if contains_error { - if let KeyCode::Char('c' | 'C') = key_code { - self.app_data.lock().remove_error(); - self.gui_state.lock().status_del(Status::Error); + match key_code { + KeyCode::Esc | KeyCode::Char('c' | 'C') => { + self.app_data.lock().remove_error(); + self.gui_state.lock().status_del(Status::Error); + } + _ => (), } } else if contains_help { match key_code { - KeyCode::Char('h' | 'H') => self.gui_state.lock().status_del(Status::Help), + KeyCode::Esc | KeyCode::Char('h' | 'H') => { + self.gui_state.lock().status_del(Status::Help); + } KeyCode::Char('m' | 'M') => self.m_key(), _ => (), } } else if contains_delete { match key_code { KeyCode::Char('y' | 'Y') => self.confirm_delete().await, - KeyCode::Char('n' | 'N') => self.clear_delete(), + KeyCode::Esc | KeyCode::Char('n' | 'N') => self.clear_delete(), _ => (), } } else { From 397972c8a79b16ff5c6d74e25111ba4b85cfe266 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Sat, 20 Apr 2024 12:31:06 +0000 Subject: [PATCH 07/18] docs: README.md updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be6a8ca..23ef5d5 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ In application controls | ```( m )``` | Toggle mouse capture - if disabled, text on screen can be selected.| | ```( q )``` | Quit.| | ```( s )``` | Save logs to `$HOME/[container_name]_[timestamp].log`, or the directory set by `--save-dir`.| - +| ```( esc )``` | Close dialog.| Available command line arguments | argument|result| From 808397bc2e8058b7a7ac349aac3b88166c3c8efb Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 22 Apr 2024 19:23:18 +0000 Subject: [PATCH 08/18] docs: changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 913806d..8b07a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +### Chores ++ Sependencies updated, [07e293ac2ce2e7deb5735154fcdb24ef83a19b67] + +### Features ++ Allow closing dialogs with `Escape`, thanks[](), [0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315] + +### Fixes ++ header display when width changes, [4628803b2b9fe63522d033b192763ed6ff5b57dd] + +### Refactors ++ use tokio CancellationToken, [0631a73ec27530f8fcc88988a0a02ca75e32c5ba] ++ impl AsyncTTY, [bf33776e9a61684032a80d22d995ba7e0446620e] + +### Test ++ reduced header section test, [aa0947405393db2c306e86986183514cbc0f5a75] + # v0.6.2 ### 2024-03-31 From 1c3c736fca25f71748beb078240ced484606f6bc Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Thu, 2 May 2024 13:38:23 +0000 Subject: [PATCH 09/18] chore: dependencies updated --- Cargo.lock | 98 ++++++++++++++++++++++++------------------------------ Cargo.toml | 4 +-- 2 files changed, 45 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6095aea..afc8849 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -127,21 +127,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -155,7 +143,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0aed08d3adb6ebe0eff737115056652670ae290f177759aac19c30456135f94c" dependencies = [ - "base64 0.22.0", + "base64", "bollard-stubs", "bytes", "futures-core", @@ -228,9 +216,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.94" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" [[package]] name = "cfg-if" @@ -324,7 +312,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.5.0", + "bitflags", "crossterm_winapi", "libc", "mio", @@ -478,9 +466,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -670,7 +658,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -712,9 +700,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libredox" @@ -722,15 +710,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags", "libc", ] [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -748,7 +736,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -862,9 +850,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -872,15 +860,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -993,7 +981,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" dependencies = [ - "bitflags 2.5.0", + "bitflags", "cassowary", "compact_str", "crossterm", @@ -1009,11 +997,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] @@ -1053,18 +1041,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", @@ -1107,11 +1095,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64", "chrono", "hex", "indexmap 1.9.3", @@ -1154,9 +1142,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -1178,9 +1166,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1232,9 +1220,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.59" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -1243,18 +1231,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", @@ -1491,9 +1479,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "url" diff --git a/Cargo.toml b/Cargo.toml index 7085340..8ea9987 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,9 @@ categories = ["command-line-utilities"] unsafe_code = "forbid" [lints.clippy] +nursery = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } expect_used = "warn" -nursery = "warn" -pedantic = "warn" todo = "warn" unused_async = "warn" unwrap_used = "warn" From 93d857eb04e94e7696de5758793e6d6646a2206d Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Thu, 2 May 2024 13:38:37 +0000 Subject: [PATCH 10/18] chore: Rust 1.78.0 linting --- src/app_data/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs index d0acb9b..d6d8e92 100644 --- a/src/app_data/mod.rs +++ b/src/app_data/mod.rs @@ -804,11 +804,11 @@ mod tests { assert_eq!(result, &containers); if let Some(i) = app_data.get_container_by_id(&ContainerId::from("2")) { - i.status = "Exited (0) 10 minutes ago".to_owned(); + "Exited (0) 10 minutes ago".clone_into(&mut i.status); } if let Some(i) = app_data.get_container_by_id(&ContainerId::from("3")) { - i.status = "Up 2 hours (Paused)".to_owned(); + "Up 2 hours (Paused)".clone_into(&mut i.status); } // Sort by status From 8bc328040e0901db3dec0bfd228ffc6204bbd78d Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Thu, 2 May 2024 13:39:02 +0000 Subject: [PATCH 11/18] fix: install.sh use `uname -m` instead of `arch` --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f6be0a8..f53c55e 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,7 @@ #!/bin/bash -case "$(arch)" in +UNAME_CMD="$(uname -m)" +case "$UNAME_CMD" in x86_64) SUFFIX="x86_64" ;; aarch64) SUFFIX="aarch64" ;; armv6l) SUFFIX="armv6" ;; From 7f2f7c34a1d174d46bb8e44c238a572a1d8917b9 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Thu, 2 May 2024 13:57:02 +0000 Subject: [PATCH 12/18] feat: "esc" key function in help box --- src/exec.rs | 3 +-- src/ui/draw_blocks.rs | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/exec.rs b/src/exec.rs index 8af447b..2f3a9d2 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -84,13 +84,12 @@ pub fn tty_readable() -> bool { .is_ok() } - struct AsyncTTY { rx: std::sync::mpsc::Receiver, } impl AsyncTTY { - /// Use an async timeout to read data from the file, and send to the "main" thread + /// Use an async timeout to read data from the file, and send to the "main" thread async fn read_loop(mut f: File, tx: Sender) { loop { let mut buf = [0]; diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 002c6ef..ce4188a 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -705,6 +705,11 @@ impl HelpInfo { button_item("1 - 9"), button_desc("sort by header - or click header"), ]), + Line::from(vec![ + space(), + button_item("esc"), + button_desc("close dialog"), + ]), Line::from(vec![ space(), button_item("q"), From 27d72c547e738f6816cd4b353ac881e454a0be70 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Tue, 7 May 2024 18:04:39 +0000 Subject: [PATCH 13/18] chore: dependencies updated --- Cargo.lock | 96 +++++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index afc8849..e3c64f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,47 +52,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -100,15 +101,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" @@ -216,9 +217,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -283,9 +284,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "compact_str" @@ -443,9 +444,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -668,6 +669,12 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -784,9 +791,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -873,9 +880,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -929,9 +936,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -1017,21 +1024,21 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" @@ -1220,9 +1227,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", @@ -1231,18 +1238,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", @@ -1337,16 +1344,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -1763,18 +1769,18 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", From ff839af4ef68193149d6456e70fee189228c4a44 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Tue, 7 May 2024 18:14:09 +0000 Subject: [PATCH 14/18] tests: test_draw_blocks_help() with esc text --- src/ui/draw_blocks.rs | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index ce4188a..44f9abf 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -2459,7 +2459,7 @@ mod tests { /// This will cause issues once the version has more than the current 5 chars (0.5.0) // Help popup is drawn correctly fn test_draw_blocks_help() { - let (w, h) = (87, 30); + let (w, h) = (87, 32); let mut setup = test_setup(w, h, true, true); setup @@ -2468,39 +2468,39 @@ mod tests { super::help_box(f); }) .unwrap(); - let expected = [ - " ".to_owned(), - format!(" ╭ {VERSION} ────────────────────────────────────────────────────────────────────────────╮ "), - " │ │ ".to_owned(), - " │ 88 │ ".to_owned(), - " │ 88 │ ".to_owned(), - " │ 88 │ ".to_owned(), - " │ ,adPPYba, 8b, ,d8 88 ,d8 ,adPPYba, 8b,dPPYba, │ ".to_owned(), - r#" │ a8" "8a `Y8, ,8P' 88 ,a8" a8P_____88 88P' "Y8 │ "#.to_owned(), - r#" │ 8b d8 )888( 8888[ 8PP""""""" 88 │ "#.to_owned(), - r#" │ "8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 │ "#.to_owned(), - r#" │ `"YbbdP"' 8P' `Y8 88 `Y8a `"Ybbd8"' 88 │ "#.to_owned(), - " │ │ ".to_owned(), - " │ A simple tui to view & control docker containers │ ".to_owned(), - " │ │ ".to_owned(), - " │ ( tab ) or ( shift+tab ) change panels │ ".to_owned(), - " │ ( ↑ ↓ ) or ( j k ) or ( PgUp PgDown ) or ( Home End ) change selected line │ ".to_owned(), - " │ ( enter ) send docker container command │ ".to_owned(), - " │ ( e ) exec into a container │ ".to_owned(), - " │ ( h ) toggle this help information │ ".to_owned(), - " │ ( s ) save logs to file │ ".to_owned(), - " │ ( m ) toggle mouse capture - if disabled, text on screen can be selected & copied │ ".to_owned(), - " │ ( 0 ) stop sort │ ".to_owned(), - " │ ( 1 - 9 ) sort by header - or click header │ ".to_owned(), - " │ ( q ) quit at any time │ ".to_owned(), - " │ │ ".to_owned(), - " │ currently an early work in progress, all and any input appreciated │ ".to_owned(), - " │ https://github.com/mrjackwills/oxker │ ".to_owned(), - " │ │ ".to_owned(), - " ╰───────────────────────────────────────────────────────────────────────────────────╯ ".to_owned(), - " ".to_owned(), - ]; + " ".to_owned(), + format!(" ╭ {VERSION} ────────────────────────────────────────────────────────────────────────────╮ "), + " │ │ ".to_owned(), + " │ 88 │ ".to_owned(), + " │ 88 │ ".to_owned(), + " │ 88 │ ".to_owned(), + " │ ,adPPYba, 8b, ,d8 88 ,d8 ,adPPYba, 8b,dPPYba, │ ".to_owned(), + r#" │ a8" "8a `Y8, ,8P' 88 ,a8" a8P_____88 88P' "Y8 │ "#.to_owned(), + r#" │ 8b d8 )888( 8888[ 8PP""""""" 88 │ "#.to_owned(), + r#" │ "8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 │ "#.to_owned(), + r#" │ `"YbbdP"' 8P' `Y8 88 `Y8a `"Ybbd8"' 88 │ "#.to_owned(), + " │ │ ".to_owned(), + " │ A simple tui to view & control docker containers │ ".to_owned(), + " │ │ ".to_owned(), + " │ ( tab ) or ( shift+tab ) change panels │ ".to_owned(), + " │ ( ↑ ↓ ) or ( j k ) or ( PgUp PgDown ) or ( Home End ) change selected line │ ".to_owned(), + " │ ( enter ) send docker container command │ ".to_owned(), + " │ ( e ) exec into a container │ ".to_owned(), + " │ ( h ) toggle this help information │ ".to_owned(), + " │ ( s ) save logs to file │ ".to_owned(), + " │ ( m ) toggle mouse capture - if disabled, text on screen can be selected & copied │ ".to_owned(), + " │ ( 0 ) stop sort │ ".to_owned(), + " │ ( 1 - 9 ) sort by header - or click header │ ".to_owned(), + " │ ( esc ) close dialog │ ".to_owned(), + " │ ( q ) quit at any time │ ".to_owned(), + " │ │ ".to_owned(), + " │ currently an early work in progress, all and any input appreciated │ ".to_owned(), + " │ https://github.com/mrjackwills/oxker │ ".to_owned(), + " │ │ ".to_owned(), + " │ │ ".to_owned(), + " ╰───────────────────────────────────────────────────────────────────────────────────╯ ".to_owned(), + ]; for (row_index, row) in expected.iter().enumerate() { let mut bracket_key = vec![]; From 465c60c211a50eb88dd6b4f08ed484382cc442fa Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Tue, 7 May 2024 18:15:04 +0000 Subject: [PATCH 15/18] docs: changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b07a18..5af4519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ ### Chores -+ Sependencies updated, [07e293ac2ce2e7deb5735154fcdb24ef83a19b67] ++ Dependencies updated, [07e293ac2ce2e7deb5735154fcdb24ef83a19b67], [27d72c547e738f6816cd4b353ac881e454a0be70] ### Features -+ Allow closing dialogs with `Escape`, thanks[](), [0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315] ++ Allow closing dialogs with `Escape`, thanks [JCQuintas](https://github.com/JCQuintas), [0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315] ### Fixes + header display when width changes, [4628803b2b9fe63522d033b192763ed6ff5b57dd] @@ -13,6 +13,7 @@ ### Test + reduced header section test, [aa0947405393db2c306e86986183514cbc0f5a75] ++ test_draw_blocks_help() with add esc text, [ff839af4ef68193149d6456e70fee189228c4a44] # v0.6.2 ### 2024-03-31 From 0445b39f9ee5e4eb49eae7257fcf17f00e57dede Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Tue, 7 May 2024 19:44:38 +0000 Subject: [PATCH 16/18] docs: typo --- containerised/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containerised/Dockerfile b/containerised/Dockerfile index 7c12c96..5cceeca 100644 --- a/containerised/Dockerfile +++ b/containerised/Dockerfile @@ -37,7 +37,7 @@ RUN cargo build --target $(cat /.platform) --release # Now copy in the rest of the sources COPY src /usr/src/oxker/src/ -## Touch main.rs to prevent cached release build +# Touch main.rs to prevent cached release build RUN touch /usr/src/oxker/src/main.rs # This is the actual application build From b810e368f5d92bea47e5f862e21f41781312af4c Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Tue, 7 May 2024 19:58:31 +0000 Subject: [PATCH 17/18] docs: changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af4519..72de281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,13 @@ + Allow closing dialogs with `Escape`, thanks [JCQuintas](https://github.com/JCQuintas), [0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315] ### Fixes -+ header display when width changes, [4628803b2b9fe63522d033b192763ed6ff5b57dd] ++ correct header display when terminal width changes, [4628803b2b9fe63522d033b192763ed6ff5b57dd] ### Refactors + use tokio CancellationToken, [0631a73ec27530f8fcc88988a0a02ca75e32c5ba] + impl AsyncTTY, [bf33776e9a61684032a80d22d995ba7e0446620e] -### Test +### Tests + reduced header section test, [aa0947405393db2c306e86986183514cbc0f5a75] + test_draw_blocks_help() with add esc text, [ff839af4ef68193149d6456e70fee189228c4a44] From fc0e42beb688c900af5033aa283167910da221ea Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Tue, 7 May 2024 20:07:53 +0000 Subject: [PATCH 18/18] chore: release v0.6.3 --- .github/release-body.md | 21 ++++++++++++++++----- CHANGELOG.md | 17 ++++++++++------- Cargo.lock | 2 +- Cargo.toml | 2 +- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/release-body.md b/.github/release-body.md index a78efaf..e97c63f 100644 --- a/.github/release-body.md +++ b/.github/release-body.md @@ -1,9 +1,20 @@ -### 2024-03-31 +### 2024-05-07 ### Chores -+ .devcontainer updated, [82a7f84ed94a9bad6cc5fe078bfadbda65c8ea8f] -+ Rust 1.77 linting, [dfd4948d9c43cfbffb091c303d3cb2a05522047a] -+ platform.sh formatted, [7953e68f3067ac3c9d4fe67e9f934c25036c0833] -+ dependencies updated, [8e6c3ca6d83768f043923ccf6836397beaaae639] ++ Dependencies updated, [07e293ac2ce2e7deb5735154fcdb24ef83a19b67], [27d72c547e738f6816cd4b353ac881e454a0be70] + +### Features ++ Allow closing dialogs with `Escape`, thanks [JCQuintas](https://github.com/JCQuintas), [0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315] + +### Fixes ++ correct header display when terminal width changes, [4628803b2b9fe63522d033b192763ed6ff5b57dd] + +### Refactors ++ use tokio CancellationToken, [0631a73ec27530f8fcc88988a0a02ca75e32c5ba] ++ impl AsyncTTY, [bf33776e9a61684032a80d22d995ba7e0446620e] + +### Tests ++ reduced header section test, [aa0947405393db2c306e86986183514cbc0f5a75] ++ test_draw_blocks_help() with add esc text, [ff839af4ef68193149d6456e70fee189228c4a44] see CHANGELOG.md for more details diff --git a/CHANGELOG.md b/CHANGELOG.md index 72de281..a132c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,22 @@ +# v0.6.3 +### 2024-05-07 + ### Chores -+ Dependencies updated, [07e293ac2ce2e7deb5735154fcdb24ef83a19b67], [27d72c547e738f6816cd4b353ac881e454a0be70] ++ Dependencies updated, [07e293ac](https://github.com/mrjackwills/oxker/commit/07e293ac2ce2e7deb5735154fcdb24ef83a19b67), [27d72c54](https://github.com/mrjackwills/oxker/commit/27d72c547e738f6816cd4b353ac881e454a0be70) ### Features -+ Allow closing dialogs with `Escape`, thanks [JCQuintas](https://github.com/JCQuintas), [0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315] ++ Allow closing dialogs with `Escape`, thanks [JCQuintas](https://github.com/JCQuintas), [0e4c3cea](https://github.com/mrjackwills/oxker/commit/0e4c3ceab933458d40b54d5fcff7e6cf7a3ab315) ### Fixes -+ correct header display when terminal width changes, [4628803b2b9fe63522d033b192763ed6ff5b57dd] ++ correct header display when terminal width changes, [4628803b](https://github.com/mrjackwills/oxker/commit/4628803b2b9fe63522d033b192763ed6ff5b57dd) ### Refactors -+ use tokio CancellationToken, [0631a73ec27530f8fcc88988a0a02ca75e32c5ba] -+ impl AsyncTTY, [bf33776e9a61684032a80d22d995ba7e0446620e] ++ use tokio CancellationToken, [0631a73e](https://github.com/mrjackwills/oxker/commit/0631a73ec27530f8fcc88988a0a02ca75e32c5ba) ++ impl AsyncTTY, [bf33776e](https://github.com/mrjackwills/oxker/commit/bf33776e9a61684032a80d22d995ba7e0446620e) ### Tests -+ reduced header section test, [aa0947405393db2c306e86986183514cbc0f5a75] -+ test_draw_blocks_help() with add esc text, [ff839af4ef68193149d6456e70fee189228c4a44] ++ reduced header section test, [aa094740](https://github.com/mrjackwills/oxker/commit/aa0947405393db2c306e86986183514cbc0f5a75) ++ test_draw_blocks_help() with add esc text, [ff839af4](https://github.com/mrjackwills/oxker/commit/ff839af4ef68193149d6456e70fee189228c4a44) # v0.6.2 ### 2024-03-31 diff --git a/Cargo.lock b/Cargo.lock index e3c64f2..ad757bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -837,7 +837,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "oxker" -version = "0.6.2" +version = "0.6.3" dependencies = [ "anyhow", "bollard", diff --git a/Cargo.toml b/Cargo.toml index 8ea9987..47aecec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oxker" -version = "0.6.2" +version = "0.6.3" edition = "2021" authors = ["Jack Wills "] description = "A simple tui to view & control docker containers"