diff --git a/.github/release-body.md b/.github/release-body.md index fb102b3..a9b7b47 100644 --- a/.github/release-body.md +++ b/.github/release-body.md @@ -1,13 +1,15 @@ -### 2023-06-04 +### 2023-08-28 ### Chores -+ github workflow ubuntu latest, build for x86 musl, [4fa841e6e74e3e10e3d3e82eac1a1ca1338814cf] -+ dependencies updated, [0caa92f6a4728d50d8b2d8f15d96a21112732ec5], [1fd1dfc75d6fa4e84451ebc845b9e1c730381f41] -+ `Spans` -> `Line`, ratatui 0.21 update, [4679ddc885a9b35c901f3600b63fd9e86118264c], [0d37ac55018038363e5f92dc4215996f8cff7b2e] -+ `create_release.sh` updated, [7dec5f14a381d237c5e72fbf9551bcf398f93f3e] ++ dependencies updated, [8ce5a1877a8c56d9bbab560c97e2596ea87cc4c0], [94a20584e6ef0701c9f36838b0dfbcd911698dbe], [29e02e0d1faae4a836c7e5cfd0d791338ff586e3], [8e4c2e686761df56920df2267b765ab1297c9972] ++ `_typos.toml` added, [84ba1020939606abf4a287cbd1de1f3a10d3f0c0] -### Fixes -+ workflow additional image fix, closes #29, [47cda44b8213cfb8c3807df6c43e3f5dc2452b57] +### Features ++ Custom hostname. `oxker` will use `$DOCKER_HOST` env if set, or one can use the cli argument `--host`, which takes priority over the `$DOCKER_HOST`, closes #30, [10950787649d2b66fc1e8cd8b85526df51479857] + +### Refactors ++ `set_error()` takes `gui_state` and error enum, to make sure app_data & gui_state is in sync [62c78dfaa50a8d8c084f7fbf7e203b50aaa731ae] ++ `fn loading_spin` doesn't need to be async, [2e27462d1b3f0bdb27d7646511e36d0c9af07f3e] see CHANGELOG.md for more details diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e7342d..a9a4390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,16 @@ +# v0.3.2 +### 2023-08-28 + ### Chores -+ dependencies updated, [8ce5a1877a8c56d9bbab560c97e2596ea87cc4c0], [94a20584e6ef0701c9f36838b0dfbcd911698dbe], [29e02e0d1faae4a836c7e5cfd0d791338ff586e3], [8e4c2e686761df56920df2267b765ab1297c9972] -+ `_typos.toml` added, [84ba1020939606abf4a287cbd1de1f3a10d3f0c0] ++ dependencies updated, [8ce5a187](https://github.com/mrjackwills/oxker/commit/8ce5a1877a8c56d9bbab560c97e2596ea87cc4c0), [94a20584](https://github.com/mrjackwills/oxker/commit/94a20584e6ef0701c9f36838b0dfbcd911698dbe), [29e02e0d](https://github.com/mrjackwills/oxker/commit/29e02e0d1faae4a836c7e5cfd0d791338ff586e3), [8e4c2e68](https://github.com/mrjackwills/oxker/commit/8e4c2e686761df56920df2267b765ab1297c9972) ++ `_typos.toml` added, [84ba1020](https://github.com/mrjackwills/oxker/commit/84ba1020939606abf4a287cbd1de1f3a10d3f0c0) ### Features -+ Custom hostname. `oxker` will use `$DOCKER_HOST` env if set, or one can use the cli argument `--host`, which takes priority over the `$DOCKER_HOST`, closes #30, [10950787649d2b66fc1e8cd8b85526df51479857] ++ Custom hostname. `oxker` will use `$DOCKER_HOST` env if set, or one can use the cli argument `--host`, which takes priority over the `$DOCKER_HOST`, closes [#30](https://github.com/mrjackwills/oxker/issues/30), [10950787](https://github.com/mrjackwills/oxker/commit/10950787649d2b66fc1e8cd8b85526df51479857) ### Refactors -+ `set_error()` takes `gui_state` and error enum, to make sure app_data & gui_state is in sync [62c78dfaa50a8d8c084f7fbf7e203b50aaa731ae] -+ `fn loading_spin` doesn't need to be async, [2e27462d1b3f0bdb27d7646511e36d0c9af07f3e] ++ `set_error()` takes `gui_state` and error enum, to make sure app_data & gui_state is in sync [62c78dfa](https://github.com/mrjackwills/oxker/commit/62c78dfaa50a8d8c084f7fbf7e203b50aaa731ae) ++ `fn loading_spin` doesn't need to be async, [2e27462d](https://github.com/mrjackwills/oxker/commit/2e27462d1b3f0bdb27d7646511e36d0c9af07f3e) # v0.3.1 ### 2023-06-04 diff --git a/Cargo.lock b/Cargo.lock index 5480832..04fab78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -696,7 +696,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "oxker" -version = "0.3.1" +version = "0.3.2" dependencies = [ "anyhow", "bollard", diff --git a/Cargo.toml b/Cargo.toml index 9af1e29..9f84284 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oxker" -version = "0.3.1" +version = "0.3.2" edition = "2021" authors = ["Jack Wills "] description = "A simple tui to view & control docker containers" diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs index 4298523..0d5db00 100644 --- a/src/app_data/mod.rs +++ b/src/app_data/mod.rs @@ -1,12 +1,20 @@ use bollard::models::ContainerSummary; -use parking_lot::Mutex; use core::fmt; +use parking_lot::Mutex; use ratatui::widgets::{ListItem, ListState}; -use std::{time::{SystemTime, UNIX_EPOCH}, sync::Arc}; +use std::{ + sync::Arc, + time::{SystemTime, UNIX_EPOCH}, +}; mod container_state; -use crate::{app_error::AppError, parse_args::CliArgs, ui::{log_sanitizer, Status, GuiState}, ENTRY_POINT}; +use crate::{ + app_error::AppError, + parse_args::CliArgs, + ui::{log_sanitizer, GuiState, Status}, + ENTRY_POINT, +}; pub use container_state::*; /// Global app_state, stored in an Arc @@ -391,7 +399,7 @@ impl AppData { /// insert single app_state error pub fn set_error(&mut self, error: AppError, gui_state: &Arc>, status: Status) { - gui_state.lock().status_push(status); + gui_state.lock().status_push(status); self.error = Some(error); } diff --git a/src/docker_data/mod.rs b/src/docker_data/mod.rs index 03f0e7c..51d5437 100644 --- a/src/docker_data/mod.rs +++ b/src/docker_data/mod.rs @@ -333,7 +333,9 @@ impl DockerData { error: DockerControls, gui_state: &Arc>, ) { - app_data.lock().set_error(AppError::DockerCommand(error), gui_state, Status::Error); + app_data + .lock() + .set_error(AppError::DockerCommand(error), gui_state, Status::Error); } /// Handle incoming messages, container controls & all container information update diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index c6e0c36..4341e86 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -93,16 +93,22 @@ impl InputHandler { .lock() .set_info_box("✖ mouse capture disabled".to_owned()); } else { - self.app_data - .lock() - .set_error(AppError::MouseCapture(false), &self.gui_state, Status::Error); + self.app_data.lock().set_error( + AppError::MouseCapture(false), + &self.gui_state, + Status::Error, + ); } } else if Ui::enable_mouse_capture().is_ok() { self.gui_state .lock() .set_info_box("✓ mouse capture enabled".to_owned()); } else { - self.app_data.lock().set_error(AppError::MouseCapture(true), &self.gui_state, Status::Error); + self.app_data.lock().set_error( + AppError::MouseCapture(true), + &self.gui_state, + Status::Error, + ); }; // If the info box sleep handle is currently being executed, as in 'm' is pressed twice within a 4000ms window diff --git a/src/main.rs b/src/main.rs index 9bfc04c..125a333 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,10 +105,14 @@ async fn docker_init( is_running, )); } else { - app_data.lock().set_error(AppError::DockerConnect, gui_state, Status::DockerConnect); + app_data + .lock() + .set_error(AppError::DockerConnect, gui_state, Status::DockerConnect); } } else { - app_data.lock().set_error(AppError::DockerConnect, gui_state, Status::DockerConnect); + app_data + .lock() + .set_error(AppError::DockerConnect, gui_state, Status::DockerConnect); } }