From c04c34893207f613868c6a2ae4374d03de809197 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Sun, 8 May 2022 15:57:28 +0000 Subject: [PATCH] refactor --- CHANGELOG.md | 14 +++++++------- create_release.sh | 5 ++++- src/ui/draw_blocks.rs | 27 +++++++++------------------ src/ui/mod.rs | 16 ++-------------- 4 files changed, 22 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fcde78..3a2a834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,15 @@ ### 2022-04-29 ### Features -+ allow toggling of mouse caputre, to select & copy text with mouse, closes #2, [aec184ea22b289e91942a4c3e6a415685884bc47](https://github.com/mrjackwills/oxker/commit/aec184ea22b289e91942a4c3e6a415685884bc47), -+ show id column, [b10f927481c9e38a48c1d4b94e744ec48e8b6ba6](https://github.com/mrjackwills/oxker/commit/b10f927481c9e38a48c1d4b94e744ec48e8b6ba6), -+ draw_popup, using enum to draw in one of 9 areas, closes #6, [1017850a6cc91328abc1127bdb117495f5e909d8](https://github.com/mrjackwills/oxker/commit/1017850a6cc91328abc1127bdb117495f5e909d8), -+ use a message rx/sx for all docker commands, remove update loop, wait for update message from gui instead, [9b70fdfad7b38361ebee301bdc2545d3f0dfcf9e](https://github.com/mrjackwills/oxker/commit/9b70fdfad7b38361ebee301bdc2545d3f0dfcf9e), ++ allow toggling of mouse caputre, to select & copy text with mouse, closes #2, [aec184ea](https://github.com/mrjackwills/oxker/commit/aec184ea22b289e91942a4c3e6a415685884bc47), ++ show id column, [b10f9274](https://github.com/mrjackwills/oxker/commit/b10f927481c9e38a48c1d4b94e744ec48e8b6ba6), ++ draw_popup, using enum to draw in one of 9 areas, closes #6, [1017850a](https://github.com/mrjackwills/oxker/commit/1017850a6cc91328abc1127bdb117495f5e909d8), ++ use a message rx/sx for all docker commands, remove update loop, wait for update message from gui instead, [9b70fdfa](https://github.com/mrjackwills/oxker/commit/9b70fdfad7b38361ebee301bdc2545d3f0dfcf9e), ### Fixes -+ readme.md typo, [589501f9a4a0bfabdb0654e68cc0c752c529d97a](https://github.com/mrjackwills/oxker/commit/589501f9a4a0bfabdb0654e68cc0c752c529d97a), -+ column heading mem > memory, [5e8e6b590b06f01a542fdd10bae8f14d303ab08a](https://github.com/mrjackwills/oxker/commit/5e8e6b590b06f01a542fdd10bae8f14d303ab08a), -+ cargo fmt added to create_release.sh, [bb29c0ebfafd6a9a036eb317a240954d1405966e](https://github.com/mrjackwills/oxker/commit/bb29c0ebfafd6a9a036eb317a240954d1405966e), ++ readme.md typo, [589501f9](https://github.com/mrjackwills/oxker/commit/589501f9a4a0bfabdb0654e68cc0c752c529d97a), ++ column heading mem > memory, [5e8e6b59](https://github.com/mrjackwills/oxker/commit/5e8e6b590b06f01a542fdd10bae8f14d303ab08a), ++ cargo fmt added to create_release.sh, [bb29c0eb](https://github.com/mrjackwills/oxker/commit/bb29c0ebfafd6a9a036eb317a240954d1405966e), # v0.0.1 ### 2022-04-25 diff --git a/create_release.sh b/create_release.sh index 5511264..35b981f 100755 --- a/create_release.sh +++ b/create_release.sh @@ -107,7 +107,10 @@ update_release_body_and_changelog () { echo -e "# ${NEW_TAG_VERSION}\n${DATE_SUBHEADING}${CHANGELOG_ADDITION}$(cat CHANGELOG.md)" > CHANGELOG.md # Update changelog to add links to commits [hex x40] - sed -i -E "s=(\s)\[([0-9a-f]{40})\](\n|\s|\,|\r)= [\2](${GIT_REPO_URL}/commit/\2),=g" ./CHANGELOG.md + # sed -i -E "s=(\s)\[([0-9a-f]{40})\](\n|\s|\,|\r)= [\2](${GIT_REPO_URL}/commit/\2),=g" ./CHANGELOG.md + + + sed -i -E "s=(\s)\[([0-9a-f]{8})([0-9a-f]{32})\]= [\2](${GIT_REPO_URL}/commit/\2\3),=g" ./CHANGELOG.md # Update changelog to add links to closed issues sed -i -r -E "s=closes \[#([0-9]+)\],=[#\1](${GIT_REPO_URL}/issues/\1),=g" ./CHANGELOG.md diff --git a/src/ui/draw_blocks.rs b/src/ui/draw_blocks.rs index ae5828f..eaeb134 100644 --- a/src/ui/draw_blocks.rs +++ b/src/ui/draw_blocks.rs @@ -23,15 +23,16 @@ use super::gui_state::BoxLocation; 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"); const VERSION: &str = env!("CARGO_PKG_VERSION"); const REPO: &str = env!("CARGO_PKG_REPOSITORY"); @@ -47,7 +48,7 @@ fn generate_block<'a>( gui_state: &Arc>, panel: SelectablePanel, ) -> Block<'a> { - gui_state.lock().insert_into_area_map(panel, area); + gui_state.lock().insert_into_area_map(panel, area); let mut block = Block::default() .borders(Borders::ALL) .border_type(BorderType::Rounded); @@ -122,12 +123,7 @@ pub fn draw_containers( gui_state: &Arc>, widths: &Columns, ) { - let block = generate_block( - app_data, - area, - gui_state, - SelectablePanel::Containers, - ); + let block = generate_block(app_data, area, gui_state, SelectablePanel::Containers); let items = app_data .lock() @@ -221,12 +217,7 @@ pub fn draw_logs( index: Option, loading_icon: String, ) { - let block = generate_block( - app_data, - area, - gui_state, - SelectablePanel::Logs, - ); + let block = generate_block(app_data, area, gui_state, SelectablePanel::Logs); let init = app_data.lock().init; if !init { diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 144c86d..fcec35d 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -191,22 +191,10 @@ fn ui( .constraints(lower_split.as_ref()) .split(upper_main[1]); - draw_containers( - app_data, - top_panel[0], - f, - gui_state, - &column_widths, - ); + draw_containers(app_data, top_panel[0], f, gui_state, &column_widths); if has_containers { - draw_commands( - app_data, - top_panel[1], - f, - gui_state, - log_index, - ); + draw_commands(app_data, top_panel[1], f, gui_state, log_index); } draw_logs(