From 1d1b42516fc48aa6de788ee8962d1a2ccc8c86be Mon Sep 17 00:00:00 2001 From: Daniel Boll Date: Mon, 30 Oct 2023 10:04:16 -0300 Subject: [PATCH 1/8] refactor(draw_blocks.rs): remove unnecessary .as_ref() calls on constraints method to improve code readability refactor(mod.rs): remove unnecessary .as_ref() calls on constraints method to improve code readability --- src/ui/draw_blocks.rs | 14 +++++++------- src/ui/mod.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 4080966..874fdda 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -25,13 +25,13 @@ use super::gui_state::{BoxLocation, DeleteButton, Region}; use super::{GuiState, SelectablePanel}; const NAME_TEXT: &str = r#" - 88 - 88 - 88 + 88 + 88 + 88 ,adPPYba, 8b, ,d8 88 ,d8 ,adPPYba, 8b,dPPYba, a8" "8a `Y8, ,8P' 88 ,a8" a8P_____88 88P' "Y8 -8b d8 )888( 8888[ 8PP""""""" 88 -"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 +8b d8 )888( 8888[ 8PP""""""" 88 +"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 `"YbbdP"' 8P' `Y8 88 `Y8a `"Ybbd8"' 88 "#; const NAME: &str = env!("CARGO_PKG_NAME"); @@ -445,7 +445,7 @@ pub fn heading_bar( let split_bar = Layout::default() .direction(Direction::Horizontal) - .constraints(splits.as_ref()) + .constraints(splits) .split(area); if has_containers { // Draw loading icon, or not, and a prefix with a single space @@ -458,7 +458,7 @@ pub fn heading_bar( let container_splits = header_data.iter().map(|i| i.2).collect::>(); let headers_section = Layout::default() .direction(Direction::Horizontal) - .constraints(container_splits.as_ref()) + .constraints(container_splits) .split(split_bar[1]); // draw the actual header blocks diff --git a/src/ui/mod.rs b/src/ui/mod.rs index c8b8da6..8ec882b 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -250,7 +250,7 @@ fn draw_frame( // Containers + docker commands let top_panel = Layout::default() .direction(Direction::Horizontal) - .constraints(top_split.as_ref()) + .constraints(top_split) .split(upper_main[0]); let lower_split = if has_containers { @@ -262,7 +262,7 @@ fn draw_frame( // Split into 2, logs, and optional charts let lower_main = Layout::default() .direction(Direction::Vertical) - .constraints(lower_split.as_ref()) + .constraints(lower_split) .split(upper_main[1]); draw_blocks::containers(app_data, top_panel[0], f, gui_state, &column_widths); From 67770a10588005ce8342b7e26e1ee7be399df8e3 Mon Sep 17 00:00:00 2001 From: Daniel Boll Date: Tue, 31 Oct 2023 11:55:06 -0300 Subject: [PATCH 2/8] chore(draw_blocks.rs): format code using rustfmt to improve code readability chore(draw_blocks.rs): remove unnecessary indentation in NAME_TEXT constant to improve code readability --- src/ui/draw_blocks.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 874fdda..3172c4d 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -24,14 +24,15 @@ use crate::{ use super::gui_state::{BoxLocation, DeleteButton, Region}; use super::{GuiState, SelectablePanel}; +#[rustfmt::skip] const NAME_TEXT: &str = r#" - 88 - 88 - 88 + 88 + 88 + 88 ,adPPYba, 8b, ,d8 88 ,d8 ,adPPYba, 8b,dPPYba, a8" "8a `Y8, ,8P' 88 ,a8" a8P_____88 88P' "Y8 -8b d8 )888( 8888[ 8PP""""""" 88 -"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 +8b d8 )888( 8888[ 8PP""""""" 88 +"8a, ,a8" ,d8" "8b, 88`"Yba, "8b, ,aa 88 `"YbbdP"' 8P' `Y8 88 `Y8a `"Ybbd8"' 88 "#; const NAME: &str = env!("CARGO_PKG_NAME"); From 2c22ab4c57f1943b66fea3ee2cbdad1fc02b88d2 Mon Sep 17 00:00:00 2001 From: Daniel Boll Date: Tue, 31 Oct 2023 14:07:48 -0300 Subject: [PATCH 3/8] chore(draw_blocks.rs): remove unnecessary fmt skip directive Signed-off-by: Daniel Boll --- src/ui/draw_blocks.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index 3172c4d..9bba583 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -24,7 +24,6 @@ use crate::{ use super::gui_state::{BoxLocation, DeleteButton, Region}; use super::{GuiState, SelectablePanel}; -#[rustfmt::skip] const NAME_TEXT: &str = r#" 88 88 From 1702414f922d87ff1cb6654128c09c0074870123 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:41:18 +0000 Subject: [PATCH 4/8] fix: Bollard dependency fix --- Cargo.lock | 10 ++++++---- Cargo.toml | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa369d4..ee3802a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,7 +146,8 @@ checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bollard" version = "0.15.0" -source = "git+https://www.github.com/fussybeaver/bollard.git?rev=cef1cd5#cef1cd568684d0c3c497ce56221ff22ca18334f4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f03db470b3c0213c47e978da93200259a1eb4dae2e5512cba9955e2b540a6fc6" dependencies = [ "base64", "bollard-stubs", @@ -174,7 +175,8 @@ dependencies = [ [[package]] name = "bollard-stubs" version = "1.43.0-rc.2" -source = "git+https://www.github.com/fussybeaver/bollard.git?rev=cef1cd5#cef1cd568684d0c3c497ce56221ff22ca18334f4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58071e8fd9ec1e930efd28e3a90c1251015872a2ce49f81f36421b86466932e" dependencies = [ "serde", "serde_repr", @@ -1418,9 +1420,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58fe91d841bc04822c9801002db4ea904b9e4b8e6bbad25127b46eff8dc516b" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom", "rand", diff --git a/Cargo.toml b/Cargo.toml index 9ce8d4a..82175a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,8 +27,7 @@ similar_names = "allow" [dependencies] anyhow = "1.0" -# bollard = "0.15" -bollard = { git = "https://www.github.com/fussybeaver/bollard.git", rev = "cef1cd5" } +bollard = "0.15" cansi = "2.2" clap = { version = "4.4", features = ["derive", "unicode", "color"] } crossterm = "0.27" From ae4ce3b549c40cc8bd713f375f030b185179a6e2 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:42:19 +0000 Subject: [PATCH 5/8] fix: GitHub workflow, cargo publish before create release, --- .../workflows/create_release_and_build.yml | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/create_release_and_build.yml b/.github/workflows/create_release_and_build.yml index 6acc896..051cbf6 100644 --- a/.github/workflows/create_release_and_build.yml +++ b/.github/workflows/create_release_and_build.yml @@ -6,11 +6,28 @@ on: jobs: + ######################### + ## Publish to crates.io # + ######################### + + cargo_publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: publish to crates.io + uses: katyo/publish-crates@v1 + with: + registry-token: ${{ secrets.CRATES_IO_TOKEN }} + + ################################################# ## Cross platform binary build for release page # ################################################# cross_platform_build: + needs: [cargo_publish] strategy: matrix: platform: @@ -88,28 +105,14 @@ jobs: **/oxker_*.zip **/oxker_*.tar.gz - ######################### - ## Publish to crates.io # - ######################### - - cargo_publish: - needs: [create_release] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: publish to crates.io - uses: katyo/publish-crates@v1 - with: - registry-token: ${{ secrets.CRATES_IO_TOKEN }} ######################################### ## Build images for Dockerhub & ghcr.io # ######################################### image_build: - needs: [cargo_publish] + needs: [create_release] runs-on: ubuntu-latest steps: - name: Checkout code From 838fa9c497e0a115aea617cc5ecc73bb746742db Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:44:09 +0000 Subject: [PATCH 6/8] docs: changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e420888..2ff86af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### Fixes ++ Bollard dependency fix, [1702414f922d87ff1cb6654128c09c0074870123] ++ GitHub workflow, cargo publish before create release, [ae4ce3b549c40cc8bd713f375f030b185179a6e2] ++ `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [77fbaa8b1669286369b6ec1edd80220c808b628f] + +See [https://github.com/mrjackwills/oxker/releases/tag/v0.4.0](https://github.com/mrjackwills/oxker/releases/tag/v0.4.0) for v0.4.0 release notes + # v0.4.0 ### 2023-11-20 @@ -12,7 +19,6 @@ + Export logs feature, press `s` to save logs, use `--save-dir` cli-arg to customise output location, closes [#1](https://github.com/mrjackwills/oxker/issues/1), [a15da5ed](https://github.com/mrjackwills/oxker/commit/a15da5ed43d07852504a4dd1884a189e3f5b9d84) ### Fixes -+ `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [0e06c9c1](https://github.com/mrjackwills/oxker/commit/0e06c9c172629dc7f7e7766f5372da9466e786d8) + sorted created_at clash, closes [#22](https://github.com/mrjackwills/oxker/issues/22), [3a648939](https://github.com/mrjackwills/oxker/commit/3a6489396e87702ce94b349a7f47028ece7922f6) # v0.3.3 From ba2780c86fd278e39ff85a8fa1d63a135c0d02fa Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:44:42 +0000 Subject: [PATCH 7/8] docs: changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ff86af..db081cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ -### Fixes +### (Quick) Fixes + Bollard dependency fix, [1702414f922d87ff1cb6654128c09c0074870123] + GitHub workflow, cargo publish before create release, [ae4ce3b549c40cc8bd713f375f030b185179a6e2] + `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [77fbaa8b1669286369b6ec1edd80220c808b628f] -See [https://github.com/mrjackwills/oxker/releases/tag/v0.4.0](https://github.com/mrjackwills/oxker/releases/tag/v0.4.0) for v0.4.0 release notes +See [https://github.com/mrjackwills/oxker/releases/tag/v0.4.0](https://github.com/mrjackwills/oxker/releases/tag/v0.4.0) for more detailed v0.4.0 release notes # v0.4.0 ### 2023-11-20 From 7346ca1f1e069abb7e068863805e8439e8842c61 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:53:39 +0000 Subject: [PATCH 8/8] chore: release v0.4.1 --- .github/release-body.md | 17 +++++------------ CHANGELOG.md | 9 ++++++--- Cargo.lock | 2 +- Cargo.toml | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/release-body.md b/.github/release-body.md index ff13266..380fac8 100644 --- a/.github/release-body.md +++ b/.github/release-body.md @@ -1,17 +1,10 @@ ### 2023-11-20 -### Chores -+ workflow dependencies updated, [6a4cf6490d08b976734e2bc8186d94c095700558] -+ dependencies updated, [e301b51891e03ea40b2f904583119da3bc4daf53], [81d5b326db8881263f2c9072e1426948e41b4a0f], [294cc2684f42daab9d51601e235a384f55617678] -+ lints moved from main.rs to Cargo.toml, [2de76e2f358be9c1500ca3dc4f9df0979ed8ed28] -+ .devcontainer updated, [37d2ee915625806dd11c2cc816a892aae12a777c] +### (Quick) Fixes ++ Bollard dependency fix, [1702414f922d87ff1cb6654128c09c0074870123] ++ GitHub workflow, cargo publish before create release, [ae4ce3b549c40cc8bd713f375f030b185179a6e2] ++ `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [77fbaa8b1669286369b6ec1edd80220c808b628f] -### Features -+ Docker exec mode - you are now able to attempt to exec into a container by pressing the `e` key, closes #28, [c8077bca0b673478cfbb417e677a885136ba9eff], [0e5ee143b008c9d0ee0b681231a1568be227150b], [0e5ee143b008c9d0ee0b681231a1568be227150b] -+ Export logs feature, press `s` to save logs, use `--save-dir` cli-arg to customise output location, closes #1, [a15da5ed43d07852504a4dd1884a189e3f5b9d84] - -### Fixes -+ `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [0e06c9c172629dc7f7e7766f5372da9466e786d8] -+ sorted created_at clash, closes #22, [3a6489396e87702ce94b349a7f47028ece7922f6] +See [https://github.com/mrjackwills/oxker/releases/tag/v0.4.0](https://github.com/mrjackwills/oxker/releases/tag/v0.4.0) for more detailed v0.4.0 release notes see CHANGELOG.md for more details diff --git a/CHANGELOG.md b/CHANGELOG.md index db081cc..f0a56c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ +# v0.4.1 +### 2023-11-20 + ### (Quick) Fixes -+ Bollard dependency fix, [1702414f922d87ff1cb6654128c09c0074870123] -+ GitHub workflow, cargo publish before create release, [ae4ce3b549c40cc8bd713f375f030b185179a6e2] -+ `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [77fbaa8b1669286369b6ec1edd80220c808b628f] ++ Bollard dependency fix, [1702414f](https://github.com/mrjackwills/oxker/commit/1702414f922d87ff1cb6654128c09c0074870123) ++ GitHub workflow, cargo publish before create release, [ae4ce3b5](https://github.com/mrjackwills/oxker/commit/ae4ce3b549c40cc8bd713f375f030b185179a6e2) ++ `as_ref()` fixed, thanks [Daniel-Boll](https://github.com/Daniel-Boll), [77fbaa8b](https://github.com/mrjackwills/oxker/commit/77fbaa8b1669286369b6ec1edd80220c808b628f) See [https://github.com/mrjackwills/oxker/releases/tag/v0.4.0](https://github.com/mrjackwills/oxker/releases/tag/v0.4.0) for more detailed v0.4.0 release notes diff --git a/Cargo.lock b/Cargo.lock index ee3802a..5ede08f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -783,7 +783,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "oxker" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "bollard", diff --git a/Cargo.toml b/Cargo.toml index 82175a1..0983633 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oxker" -version = "0.4.0" +version = "0.4.1" edition = "2021" authors = ["Jack Wills "] description = "A simple tui to view & control docker containers"