chore: merge main into dev
This commit is contained in:
@@ -1,13 +1,8 @@
|
|||||||
### 2022-12-05
|
### 2022-12-05
|
||||||
|
|
||||||
### Chores
|
### Fixes
|
||||||
+ dependencies updated, [e3aa4420cb510df0381e311d37e768937070387a]
|
+ disallow commands to be sent to a dockerised oxker container, closes #19, [160b8021b1de898064756b53c127d49b8096ce4d]
|
||||||
+ docker-compose.yml alpine bump, [911c6596684db4ccbe7a55aadd6f595a95f89bb0]
|
+ if no container created time, use 0, instead of system_time(), [1adb61ce3b029d4fcf51961958d483b2fae8825a]
|
||||||
+ github workflow use dtolnay/rust-toolchain, [57c18878690477a05d7330112a65d1d58a07901e]
|
|
||||||
|
|
||||||
### Features
|
|
||||||
+ Clicking a header now toggles between Ascending -> Descending -> Default. Use the containers created_time as the default order - maybe add created column in future version, closes #18, [cf14ba498987db587c0f5bef8a67cf4113ffcb1e], [d1de291473d8a1028f1936429832d3820d75df54]
|
|
||||||
+ `-s` flag for showing the oxker container when executing the docker image, [c93870e5fbbc7df35c69d32e4460d2104e521e33]
|
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
+6
-3
@@ -1,6 +1,9 @@
|
|||||||
|
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.9'>v0.1.9</a>
|
||||||
|
### 2022-12-05
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
+ disallow commands to be sent to a dockerised oxker container, closes #19, [160b8021b1de898064756b53c127d49b8096ce4d]
|
+ disallow commands to be sent to a dockerised oxker container, closes [#19](https://github.com/mrjackwills/oxker/issues/19), [160b8021](https://github.com/mrjackwills/oxker/commit/160b8021b1de898064756b53c127d49b8096ce4d)
|
||||||
+ if no container created time, use 0, instead of system_time(), [1adb61ce3b029d4fcf51961958d483b2fae8825a]
|
+ if no container created time, use 0, instead of system_time(), [1adb61ce](https://github.com/mrjackwills/oxker/commit/1adb61ce3b029d4fcf51961958d483b2fae8825a)
|
||||||
|
|
||||||
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.8'>v0.1.8</a>
|
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.8'>v0.1.8</a>
|
||||||
### 2022-12-05
|
### 2022-12-05
|
||||||
@@ -11,7 +14,7 @@
|
|||||||
+ github workflow use dtolnay/rust-toolchain, [57c18878](https://github.com/mrjackwills/oxker/commit/57c18878690477a05d7330112a65d1d58a07901e)
|
+ github workflow use dtolnay/rust-toolchain, [57c18878](https://github.com/mrjackwills/oxker/commit/57c18878690477a05d7330112a65d1d58a07901e)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
+ Clicking a header now toggles between Ascending -> Descending -> Default. Use the containers created_time as the default order - maybe add created column in future version, closes #18, [cf14ba49](https://github.com/mrjackwills/oxker/commit/cf14ba498987db587c0f5bef8a67cf4113ffcb1e), [d1de2914](https://github.com/mrjackwills/oxker/commit/d1de291473d8a1028f1936429832d3820d75df54)
|
+ Clicking a header now toggles between Ascending -> Descending -> Default. Use the containers created_time as the default order - maybe add created column in future version, closes [#18](https://github.com/mrjackwills/oxker/issues/18), [cf14ba49](https://github.com/mrjackwills/oxker/commit/cf14ba498987db587c0f5bef8a67cf4113ffcb1e), [d1de2914](https://github.com/mrjackwills/oxker/commit/d1de291473d8a1028f1936429832d3820d75df54)
|
||||||
+ `-s` flag for showing the oxker container when executing the docker image, [c93870e5](https://github.com/mrjackwills/oxker/commit/c93870e5fbbc7df35c69d32e4460d2104e521e33)
|
+ `-s` flag for showing the oxker container when executing the docker image, [c93870e5](https://github.com/mrjackwills/oxker/commit/c93870e5fbbc7df35c69d32e4460d2104e521e33)
|
||||||
|
|
||||||
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.7'>v0.1.7</a>
|
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.1.7'>v0.1.7</a>
|
||||||
|
|||||||
Generated
+1
-1
@@ -567,7 +567,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxker"
|
name = "oxker"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bollard",
|
"bollard",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "oxker"
|
name = "oxker"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
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"
|
||||||
|
|||||||
@@ -370,16 +370,16 @@ pub struct ContainerItem {
|
|||||||
pub state: State,
|
pub state: State,
|
||||||
pub status: String,
|
pub status: String,
|
||||||
pub tx: ByteStats,
|
pub tx: ByteStats,
|
||||||
pub is_oxker: bool
|
pub is_oxker: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ContainerItem {
|
impl ContainerItem {
|
||||||
/// Create a new container item
|
/// Create a new container item
|
||||||
pub fn new(
|
pub fn new(
|
||||||
created: u64,
|
created: u64,
|
||||||
id: ContainerId,
|
id: ContainerId,
|
||||||
image: String,
|
image: String,
|
||||||
is_oxker: bool,
|
is_oxker: bool,
|
||||||
name: String,
|
name: String,
|
||||||
state: State,
|
state: State,
|
||||||
status: String,
|
status: String,
|
||||||
@@ -394,7 +394,7 @@ impl ContainerItem {
|
|||||||
docker_controls,
|
docker_controls,
|
||||||
id,
|
id,
|
||||||
image,
|
image,
|
||||||
is_oxker,
|
is_oxker,
|
||||||
last_updated: 0,
|
last_updated: 0,
|
||||||
logs,
|
logs,
|
||||||
mem_limit: ByteStats::default(),
|
mem_limit: ByteStats::default(),
|
||||||
|
|||||||
+15
-11
@@ -171,13 +171,13 @@ impl AppData {
|
|||||||
output
|
output
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if the selected container is a dockerised version of oxker
|
/// Check if the selected container is a dockerised version of oxker
|
||||||
/// So that can disallow commands to be send
|
/// So that can disallow commands to be send
|
||||||
/// Is a poor way of implementing this
|
/// Is a poor way of implementing this
|
||||||
pub fn selected_container_is_oxker(&self) -> bool {
|
pub fn selected_container_is_oxker(&self) -> bool {
|
||||||
if let Some(index) = self.containers.state.selected() {
|
if let Some(index) = self.containers.state.selected() {
|
||||||
if let Some(x) = self.containers.items.get(index) {
|
if let Some(x) = self.containers.items.get(index) {
|
||||||
return x.is_oxker
|
return x.is_oxker;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
@@ -445,10 +445,10 @@ impl AppData {
|
|||||||
pub fn update_containers(&mut self, all_containers: &mut [ContainerSummary]) {
|
pub fn update_containers(&mut self, all_containers: &mut [ContainerSummary]) {
|
||||||
let all_ids = self.get_all_ids();
|
let all_ids = self.get_all_ids();
|
||||||
|
|
||||||
// Only sort it no containers currently set, as afterwards the order is fixed
|
// Only sort it no containers currently set, as afterwards the order is fixed
|
||||||
if self.containers.items.is_empty() {
|
if self.containers.items.is_empty() {
|
||||||
all_containers.sort_by(|a, b| a.created.cmp(&b.created));
|
all_containers.sort_by(|a, b| a.created.cmp(&b.created));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !all_containers.is_empty() && self.containers.state.selected().is_none() {
|
if !all_containers.is_empty() && self.containers.state.selected().is_none() {
|
||||||
self.containers.start();
|
self.containers.start();
|
||||||
@@ -485,7 +485,10 @@ impl AppData {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
let is_oxker = i.command.as_ref().map_or(false, |i|i.starts_with(ENTRY_POINT));
|
let is_oxker = i
|
||||||
|
.command
|
||||||
|
.as_ref()
|
||||||
|
.map_or(false, |i| i.starts_with(ENTRY_POINT));
|
||||||
|
|
||||||
let state = State::from(i.state.as_ref().map_or("dead".to_owned(), trim_owned));
|
let state = State::from(i.state.as_ref().map_or("dead".to_owned(), trim_owned));
|
||||||
let status = i.status.as_ref().map_or(String::new(), trim_owned);
|
let status = i.status.as_ref().map_or(String::new(), trim_owned);
|
||||||
@@ -522,7 +525,8 @@ impl AppData {
|
|||||||
};
|
};
|
||||||
// else container not known, so make new ContainerItem and push into containers Vec
|
// else container not known, so make new ContainerItem and push into containers Vec
|
||||||
} else {
|
} else {
|
||||||
let container = ContainerItem::new(created, id, image, is_oxker, name, state, status);
|
let container =
|
||||||
|
ContainerItem::new(created, id, image, is_oxker, name, state, status);
|
||||||
self.containers.items.push(container);
|
self.containers.items.push(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ use crate::{
|
|||||||
app_data::{AppData, ContainerId, DockerControls},
|
app_data::{AppData, ContainerId, DockerControls},
|
||||||
app_error::AppError,
|
app_error::AppError,
|
||||||
parse_args::CliArgs,
|
parse_args::CliArgs,
|
||||||
ui::{GuiState, Status}, ENTRY_POINT,
|
ui::{GuiState, Status},
|
||||||
|
ENTRY_POINT,
|
||||||
};
|
};
|
||||||
mod message;
|
mod message;
|
||||||
pub use message::DockerMessage;
|
pub use message::DockerMessage;
|
||||||
|
|||||||
@@ -250,10 +250,10 @@ impl InputHandler {
|
|||||||
|
|
||||||
if let Some(command) = option_command {
|
if let Some(command) = option_command {
|
||||||
let option_id = self.app_data.lock().get_selected_container_id();
|
let option_id = self.app_data.lock().get_selected_container_id();
|
||||||
// Poor way of disallowing commands to be sent to a containerised okxer
|
// Poor way of disallowing commands to be sent to a containerised okxer
|
||||||
if self.app_data.lock().selected_container_is_oxker() {
|
if self.app_data.lock().selected_container_is_oxker() {
|
||||||
return
|
return;
|
||||||
};
|
};
|
||||||
if let Some(id) = option_id {
|
if let Some(id) = option_id {
|
||||||
match command {
|
match command {
|
||||||
DockerControls::Pause => self
|
DockerControls::Pause => self
|
||||||
|
|||||||
Reference in New Issue
Block a user