chore: release v0.1.4

This commit is contained in:
Jack Wills
2022-09-07 14:53:01 +00:00
parent 56fc6f0a4b
commit 76677316fd
5 changed files with 49 additions and 35 deletions
+13 -5
View File
@@ -1,14 +1,22 @@
### 2022-08-04 ### 2022-09-07
### Chores ### Chores
+ dependencies updated, [d9801cdf372521fe5624a8d68fac83ed39ef81f4] + dependencies updated, [a3168daa3f769a6747dfbe61103073a7e80a1485], [78e59160bb6a978ee80e3a99eb72f051fb64e737]
+ linting: nursery, pedantic, unused_unwraps, [1bd61d4ce8b369d6d078201add3eea0f59fe0dea], [1263662bd9412afacddbc10721bf216ae3a843f1], [ca3315a69f593ad705eb637f227f195edd7781b2]
### Features ### Features
+ build all production targets on release, [44f8140eaec330abe5a94f3ddae9e8b223688aa8] + containerize self, github action to build and push to [Docker Hub](https://hub.docker.com/r/mrjackwills/oxker), [07f972022a69f22bac57925e6ad84234381f7890]
+ gui_state is_loading use a HashSet to enable multiple things be loading at the same time, [66583e1b037b7e2f3e47948d70d8a4c6f6a2f2d5]
+ github action publish to crates.io, [90b2e3f6db0d5f63840cd80888a30da6ecc22f20]
+ derive Eq where appropriate, [d7c2601f959bc12a64cd25cef59c837e1e8c2b2a]
+ ignore containers 'oxker' containers, [1be9f52ad4a68f93142784e9df630c59cdec0a79]
+ update container info if container is either running OR restarting, [5f12362db7cb61ca68f75b99ecfc9725380d87d2]
### Fixes ### Fixes
+ toml keywords, [dd2d82d114537e09dbeb12f360157f0e68e7846e] + devcontainer updated, [3bde4f5629539cab3dbb57556663ab81685f9d7a]
+ Use Binate enum to enable two cycles of cpu/mem update to be executed (for each container) at the same time, refactor hashmap spawn insertions, [7ec58e79a1316ad1f7e50a2781dea0fe8422c588]
### Refactors
+ improved way to remove leading '/' of container name, [832e9782d7765872cbb84df6b3703fc08cb353c9]
see <a href='https://github.com/mrjackwills/oxker/blob/main/CHANGELOG.md'>CHANGELOG.md</a> for more details see <a href='https://github.com/mrjackwills/oxker/blob/main/CHANGELOG.md'>CHANGELOG.md</a> for more details
+13 -10
View File
@@ -1,20 +1,23 @@
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.4'>v0.1.4</a>
### 2022-09-07
### Chores ### Chores
+ dependencies updated, [a3168daa3f769a6747dfbe61103073a7e80a1485], [78e59160bb6a978ee80e3a99eb72f051fb64e737] + dependencies updated, [a3168daa](https://github.com/mrjackwills/oxker/commit/a3168daa3f769a6747dfbe61103073a7e80a1485),, [78e59160](https://github.com/mrjackwills/oxker/commit/78e59160bb6a978ee80e3a99eb72f051fb64e737),
### Features ### Features
+ containerize self, github action to build and push to [Docker Hub](https://hub.docker.com/r/mrjackwills/oxker), [07f972022a69f22bac57925e6ad84234381f7890] + containerize self, github action to build and push to [Docker Hub](https://hub.docker.com/r/mrjackwills/oxker), [07f97202](https://github.com/mrjackwills/oxker/commit/07f972022a69f22bac57925e6ad84234381f7890),
+ gui_state is_loading use a HashSet to enable multiple things be loading at the same time, [66583e1b037b7e2f3e47948d70d8a4c6f6a2f2d5] + gui_state is_loading use a HashSet to enable multiple things be loading at the same time, [66583e1b](https://github.com/mrjackwills/oxker/commit/66583e1b037b7e2f3e47948d70d8a4c6f6a2f2d5),
+ github action publish to crates.io, [90b2e3f6db0d5f63840cd80888a30da6ecc22f20] + github action publish to crates.io, [90b2e3f6](https://github.com/mrjackwills/oxker/commit/90b2e3f6db0d5f63840cd80888a30da6ecc22f20),
+ derive Eq where appropriate, [d7c2601f959bc12a64cd25cef59c837e1e8c2b2a] + derive Eq where appropriate, [d7c2601f](https://github.com/mrjackwills/oxker/commit/d7c2601f959bc12a64cd25cef59c837e1e8c2b2a),
+ ignore containers 'oxker' containers, [1be9f52ad4a68f93142784e9df630c59cdec0a79] + ignore containers 'oxker' containers, [1be9f52a](https://github.com/mrjackwills/oxker/commit/1be9f52ad4a68f93142784e9df630c59cdec0a79),
+ update container info if container is either running OR restarting, [5f12362db7cb61ca68f75b99ecfc9725380d87d2] + update container info if container is either running OR restarting, [5f12362d](https://github.com/mrjackwills/oxker/commit/5f12362db7cb61ca68f75b99ecfc9725380d87d2),
### Fixes ### Fixes
+ devcontainer updated, [3bde4f5629539cab3dbb57556663ab81685f9d7a] + devcontainer updated, [3bde4f56](https://github.com/mrjackwills/oxker/commit/3bde4f5629539cab3dbb57556663ab81685f9d7a),
+ Use Binate enum to enable two cycles of cpu/mem update to be executed (for each container) at the same time, refactor hashmap spawn insertions, [7ec58e79a1316ad1f7e50a2781dea0fe8422c588] + Use Binate enum to enable two cycles of cpu/mem update to be executed (for each container) at the same time, refactor hashmap spawn insertions, [7ec58e79](https://github.com/mrjackwills/oxker/commit/7ec58e79a1316ad1f7e50a2781dea0fe8422c588),
### Refactors ### Refactors
+ improved way to remove leading '/' of container name, [832e9782d7765872cbb84df6b3703fc08cb353c9] + improved way to remove leading '/' of container name, [832e9782](https://github.com/mrjackwills/oxker/commit/832e9782d7765872cbb84df6b3703fc08cb353c9),
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.3'>v0.1.3</a> # <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.3'>v0.1.3</a>
### 2022-08-04 ### 2022-08-04
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "oxker" name = "oxker"
version = "0.1.3" version = "0.1.4"
edition = "2021" edition = "2021"
authors = ["Jack Wills <email@mrjackwills.com>"] authors = ["Jack Wills <email@mrjackwills.com>"]
description = "a simple tui to view & control docker containers" description = "a simple tui to view & control docker containers"
+15 -14
View File
@@ -5,7 +5,6 @@ use bollard::{
}; };
use futures_util::StreamExt; use futures_util::StreamExt;
use parking_lot::Mutex; use parking_lot::Mutex;
use uuid::Uuid;
use std::{ use std::{
collections::HashMap, collections::HashMap,
sync::{ sync::{
@@ -14,6 +13,7 @@ use std::{
}, },
}; };
use tokio::{sync::mpsc::Receiver, task::JoinHandle}; use tokio::{sync::mpsc::Receiver, task::JoinHandle};
use uuid::Uuid;
use crate::{ use crate::{
app_data::{AppData, DockerControls}, app_data::{AppData, DockerControls},
@@ -24,7 +24,6 @@ use crate::{
mod message; mod message;
pub use message::DockerMessage; pub use message::DockerMessage;
#[derive(Debug, Hash, Clone, PartialEq, Eq)] #[derive(Debug, Hash, Clone, PartialEq, Eq)]
enum SpawnId { enum SpawnId {
Stats((String, Binate)), Stats((String, Binate)),
@@ -37,7 +36,7 @@ enum SpawnId {
#[derive(Debug, Hash, Clone, PartialEq, Eq, Copy)] #[derive(Debug, Hash, Clone, PartialEq, Eq, Copy)]
enum Binate { enum Binate {
One, One,
Two Two,
} }
impl Binate { impl Binate {
@@ -58,7 +57,7 @@ pub struct DockerData {
receiver: Receiver<DockerMessage>, receiver: Receiver<DockerMessage>,
spawns: Arc<Mutex<HashMap<SpawnId, JoinHandle<()>>>>, spawns: Arc<Mutex<HashMap<SpawnId, JoinHandle<()>>>>,
timestamps: bool, timestamps: bool,
binate: Binate binate: Binate,
} }
impl DockerData { impl DockerData {
@@ -168,7 +167,7 @@ impl DockerData {
app_data, app_data,
*is_running, *is_running,
spawns, spawns,
spawn_key spawn_key,
)) ))
}); });
} }
@@ -265,9 +264,12 @@ impl DockerData {
let app_data = Arc::clone(&self.app_data); let app_data = Arc::clone(&self.app_data);
let spawns = Arc::clone(&self.spawns); let spawns = Arc::clone(&self.spawns);
let key = SpawnId::Log(id.clone()); let key = SpawnId::Log(id.clone());
self.spawns.lock().insert(key, tokio::spawn(Self::update_log( self.spawns.lock().insert(
docker, id, timestamps, 0, app_data, spawns, key,
))); tokio::spawn(Self::update_log(
docker, id, timestamps, 0, app_data, spawns,
)),
);
} }
} }
@@ -292,7 +294,6 @@ impl DockerData {
}); });
}; };
self.update_all_container_stats(&all_ids).await; self.update_all_container_stats(&all_ids).await;
} }
/// Animate the loading icon /// Animate the loading icon
@@ -314,7 +315,7 @@ impl DockerData {
// Initialize docker container data, before any messages are received // Initialize docker container data, before any messages are received
async fn initialise_container_data(&mut self) { async fn initialise_container_data(&mut self) {
let loading_uuid = Uuid::new_v4(); let loading_uuid = Uuid::new_v4();
let loading_spin = self.loading_spin(loading_uuid).await; let loading_spin = self.loading_spin(loading_uuid).await;
let all_ids = self.update_all_containers().await; let all_ids = self.update_all_containers().await;
@@ -341,7 +342,7 @@ impl DockerData {
while let Some(message) = self.receiver.recv().await { while let Some(message) = self.receiver.recv().await {
let docker = Arc::clone(&self.docker); let docker = Arc::clone(&self.docker);
let app_data = Arc::clone(&self.app_data); let app_data = Arc::clone(&self.app_data);
let loading_uuid = Uuid::new_v4(); let loading_uuid = Uuid::new_v4();
match message { match message {
DockerMessage::Pause(id) => { DockerMessage::Pause(id) => {
let loading_spin = self.loading_spin(loading_uuid).await; let loading_spin = self.loading_spin(loading_uuid).await;
@@ -390,8 +391,8 @@ impl DockerData {
.lock() .lock()
.set_error(AppError::DockerCommand(DockerControls::Unpause)); .set_error(AppError::DockerCommand(DockerControls::Unpause));
}; };
// loading sping take uuid to remove // loading sping take uuid to remove
// stop_loading_sping(uuid) // stop_loading_sping(uuid)
self.stop_loading_spin(&loading_spin, loading_uuid); self.stop_loading_spin(&loading_spin, loading_uuid);
self.update_everything().await; self.update_everything().await;
} }
@@ -427,7 +428,7 @@ impl DockerData {
spawns: Arc::new(Mutex::new(HashMap::new())), spawns: Arc::new(Mutex::new(HashMap::new())),
timestamps: args.timestamp, timestamps: args.timestamp,
is_running, is_running,
binate: Binate::One binate: Binate::One,
}; };
inner.initialise_container_data().await; inner.initialise_container_data().await;
+7 -5
View File
@@ -1,4 +1,7 @@
use std::{collections::{HashMap, HashSet}, fmt}; use std::{
collections::{HashMap, HashSet},
fmt,
};
use tui::layout::{Constraint, Rect}; use tui::layout::{Constraint, Rect};
use uuid::Uuid; use uuid::Uuid;
@@ -168,14 +171,13 @@ impl fmt::Display for Loading {
} }
} }
/// Global gui_state, stored in an Arc<Mutex> /// Global gui_state, stored in an Arc<Mutex>
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct GuiState { pub struct GuiState {
panel_map: HashMap<SelectablePanel, Rect>, panel_map: HashMap<SelectablePanel, Rect>,
heading_map: HashMap<Header, Rect>, heading_map: HashMap<Header, Rect>,
loading_icon: Loading, loading_icon: Loading,
is_loading: HashSet<Uuid>, is_loading: HashSet<Uuid>,
pub selected_panel: SelectablePanel, pub selected_panel: SelectablePanel,
pub show_help: bool, pub show_help: bool,
pub info_box_text: Option<String>, pub info_box_text: Option<String>,
@@ -245,14 +247,14 @@ impl GuiState {
/// Change to previous selectable panel /// Change to previous selectable panel
pub fn previous_panel(&mut self) { pub fn previous_panel(&mut self) {
self.selected_panel = self.selected_panel.prev(); self.selected_panel = self.selected_panel.prev();
} }
/// Advance loading animation /// Advance loading animation
pub fn next_loading(&mut self, uuid: Uuid) { pub fn next_loading(&mut self, uuid: Uuid) {
self.loading_icon = self.loading_icon.next(); self.loading_icon = self.loading_icon.next();
self.is_loading.insert(uuid); self.is_loading.insert(uuid);
} }
/// if is_loading, return loading animation frame, else single space /// if is_loading, return loading animation frame, else single space
pub fn get_loading(&mut self) -> String { pub fn get_loading(&mut self) -> String {