feat: exec mode improvements

Use Bollard library to exec in pure Rust.

`--use-cli` cli arg, will then only try to exec into containers using
Docker.

Only try to exec into a container if the state == Running.
This commit is contained in:
Jack Wills
2023-11-17 02:49:30 +00:00
parent 28b0315dd7
commit 0e5ee143b0
15 changed files with 477 additions and 142 deletions
+7 -1
View File
@@ -83,7 +83,7 @@ impl AppData {
#[cfg(debug_assertions)]
#[allow(unused)]
pub fn set_debug_string(&mut self, x: &str) {
pub fn push_debug_string(&mut self, x: &str) {
self.debug_string.push_str(x);
}
@@ -506,6 +506,12 @@ impl AppData {
self.get_selected_container().map(|i| i.id.clone())
}
/// Get the Id and State for the currently selected container - used by the exec check method
pub fn get_selected_container_id_state(&self) -> Option<(ContainerId, State)> {
self.get_selected_container()
.map(|i| (i.id.clone(), i.state))
}
/// Update container mem, cpu, & network stats, in single function so only need to call .lock() once
/// Will also, if a sort is set, sort the containers
pub fn update_stats(