chore: release v0.1.9

This commit is contained in:
Jack Wills
2022-12-05 14:06:22 +00:00
parent 552c26bc5c
commit e71802fe21
8 changed files with 36 additions and 33 deletions
+4 -4
View File
@@ -370,16 +370,16 @@ pub struct ContainerItem {
pub state: State,
pub status: String,
pub tx: ByteStats,
pub is_oxker: bool
pub is_oxker: bool,
}
impl ContainerItem {
/// Create a new container item
pub fn new(
created: u64,
created: u64,
id: ContainerId,
image: String,
is_oxker: bool,
is_oxker: bool,
name: String,
state: State,
status: String,
@@ -394,7 +394,7 @@ impl ContainerItem {
docker_controls,
id,
image,
is_oxker,
is_oxker,
last_updated: 0,
logs,
mem_limit: ByteStats::default(),
+15 -11
View File
@@ -171,13 +171,13 @@ impl AppData {
output
}
/// Check if the selected container is a dockerised version of oxker
/// So that can disallow commands to be send
/// Is a poor way of implementing this
pub fn selected_container_is_oxker(&self) -> bool {
/// Check if the selected container is a dockerised version of oxker
/// So that can disallow commands to be send
/// Is a poor way of implementing this
pub fn selected_container_is_oxker(&self) -> bool {
if let Some(index) = self.containers.state.selected() {
if let Some(x) = self.containers.items.get(index) {
return x.is_oxker
return x.is_oxker;
}
}
false
@@ -445,10 +445,10 @@ impl AppData {
pub fn update_containers(&mut self, all_containers: &mut [ContainerSummary]) {
let all_ids = self.get_all_ids();
// Only sort it no containers currently set, as afterwards the order is fixed
if self.containers.items.is_empty() {
all_containers.sort_by(|a, b| a.created.cmp(&b.created));
}
// Only sort it no containers currently set, as afterwards the order is fixed
if self.containers.items.is_empty() {
all_containers.sort_by(|a, b| a.created.cmp(&b.created));
}
if !all_containers.is_empty() && self.containers.state.selected().is_none() {
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 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 {
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);
}
}