diff --git a/.github/release-body.md b/.github/release-body.md
index f83c62b..91c0fff 100644
--- a/.github/release-body.md
+++ b/.github/release-body.md
@@ -1,21 +1,20 @@
-### 2022-10-07
-
+### 2022-10-16
### Chores
-+ Update clap to v4, [15597dbe6942ec053541398ce0e9dedc10a4d3ea]
++ Cargo update, [c3e72ae7369a25d903f39e55a4349cb005671dd4]
++ create_release.sh v0.1.0, [3c8d59c666bd4cda9ca54989b2f1b48bba17bc57]
++ uuid updated to version 1.2, [438ad770f4a5ecb5f4bbc308066ad9e808f66514]
-### Docs
-+ readme.md updated, [a05bf561cc6d96237f683ab0b3c782d6841974d9]
+### Fixes
++ loading icon shifting error fix, also make icon white, closes #15, [59797685dffa29752a48c98e6cf465884d6d9df6]
### Features
-+ use newtype construct for container id, [41cbb84f2896f8be2c37eba87e390d998aff7382]
++ Show container name in log panel title, closes #16, [9cb0c414afc284947fc2b8494504387e4e7edd87]
++ use gui_state HashSet to keep track of application gui state, [9e9d51559a13944622abf4fcbd3bd63766d11467]
++ terminal.clear() after run_app finished, [67c49575682cb271fac0998ff377a6504cd0bc86]
### Refactors
-+ Impl Copy where able to, [e76878f424d72b943713ef84e95e25fada77d79e]
-+ replace async fn with just fn, [17dc604befac75cb9dc0311a0e43f9927fe0ca30]
-+ remove pointless clone()'s & variable declarations, [6731002ee42c9460042c2c38aff5101b1bcebbe6]
-+ replace String::from("") with String::new(), [62fb22478697cc9a7ab9fb562a724965b437233a]
-+ replace map_or_else with map_or, [3e26f292c7dc5e13af4580952767ebe821aa5183], [5660b34d5149dce27706ff6daa90b854e6f84e14]
++ CpuStats & MemStats use tuple struct, [a060d032586a0707ac91cb13d922aae0850449c5]
see CHANGELOG.md for more details
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0ac02d8..98600cc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,25 @@
+# v0.1.6
+### 2022-10-16
+
+### Chores
++ Cargo update, [c3e72ae7](https://github.com/mrjackwills/oxker/commit/c3e72ae7369a25d903f39e55a4349cb005671dd4),
++ create_release.sh v0.1.0, [3c8d59c6](https://github.com/mrjackwills/oxker/commit/3c8d59c666bd4cda9ca54989b2f1b48bba17bc57),
++ uuid updated to version 1.2, [438ad770](https://github.com/mrjackwills/oxker/commit/438ad770f4a5ecb5f4bbc308066ad9e808f66514),
+
+### Fixes
++ loading icon shifting error fix, also make icon white, closes [#15](https://github.com/mrjackwills/oxker/issues/15), [59797685](https://github.com/mrjackwills/oxker/commit/59797685dffa29752a48c98e6cf465884d6d9df6),
+
+### Features
++ Show container name in log panel title, closes [#16](https://github.com/mrjackwills/oxker/issues/16), [9cb0c414](https://github.com/mrjackwills/oxker/commit/9cb0c414afc284947fc2b8494504387e4e7edd87),
++ use gui_state HashSet to keep track of application gui state, [9e9d5155](https://github.com/mrjackwills/oxker/commit/9e9d51559a13944622abf4fcbd3bd63766d11467),
++ terminal.clear() after run_app finished, [67c49575](https://github.com/mrjackwills/oxker/commit/67c49575682cb271fac0998ff377a6504cd0bc86),
+
+### Refactors
++ CpuStats & MemStats use tuple struct, [a060d032](https://github.com/mrjackwills/oxker/commit/a060d032586a0707ac91cb13d922aae0850449c5),
+
# v0.1.5
### 2022-10-07
-
### Chores
+ Update clap to v4, [15597dbe](https://github.com/mrjackwills/oxker/commit/15597dbe6942ec053541398ce0e9dedc10a4d3ea),
@@ -16,13 +34,13 @@
+ replace async fn with just fn, [17dc604b](https://github.com/mrjackwills/oxker/commit/17dc604befac75cb9dc0311a0e43f9927fe0ca30),
+ remove pointless clone()'s & variable declarations, [6731002e](https://github.com/mrjackwills/oxker/commit/6731002ee42c9460042c2c38aff5101b1bcebbe6),
+ replace String::from("") with String::new(), [62fb2247](https://github.com/mrjackwills/oxker/commit/62fb22478697cc9a7ab9fb562a724965b437233a),
-+ replace map_or_else with map_or, [3e26f292](https://github.com/mrjackwills/oxker/commit/3e26f292c7dc5e13af4580952767ebe821aa5183),, [5660b34d](https://github.com/mrjackwills/oxker/commit/5660b34d5149dce27706ff6daa90b854e6f84e14),
++ replace map_or_else with map_or, [3e26f292](https://github.com/mrjackwills/oxker/commit/3e26f292c7dc5e13af4580952767ebe821aa5183), [5660b34d](https://github.com/mrjackwills/oxker/commit/5660b34d5149dce27706ff6daa90b854e6f84e14),
# v0.1.4
### 2022-09-07
### Chores
-+ dependencies updated, [a3168daa](https://github.com/mrjackwills/oxker/commit/a3168daa3f769a6747dfbe61103073a7e80a1485),, [78e59160](https://github.com/mrjackwills/oxker/commit/78e59160bb6a978ee80e3a99eb72f051fb64e737),
++ dependencies updated, [a3168daa](https://github.com/mrjackwills/oxker/commit/a3168daa3f769a6747dfbe61103073a7e80a1485),[78e59160](https://github.com/mrjackwills/oxker/commit/78e59160bb6a978ee80e3a99eb72f051fb64e737),
### Features
+ 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),
@@ -138,9 +156,9 @@
### 2022-04-29
### Features
-+ allow toggling of mouse caputre, to select & copy text with mouse, closes #2, [aec184ea](https://github.com/mrjackwills/oxker/commit/aec184ea22b289e91942a4c3e6a415685884bc47),
++ allow toggling of mouse caputre, to select & copy text with mouse, closes [#2](https://github.com/mrjackwills/oxker/issues/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),
++ draw_popup, using enum to draw in one of 9 areas, closes [#6](https://github.com/mrjackwills/oxker/issues/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
diff --git a/Cargo.lock b/Cargo.lock
index da58232..c7b84a8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -101,9 +101,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "4.0.10"
+version = "4.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b1a0a4208c6c483b952ad35c6eed505fc13b46f08f631b81e828084a9318d74"
+checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f"
dependencies = [
"atty",
"bitflags",
@@ -118,9 +118,9 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.0.10"
+version = "4.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce"
+checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad"
dependencies = [
"heck",
"proc-macro-error",
@@ -433,9 +433,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.134"
+version = "0.2.135"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb"
+checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
[[package]]
name = "lock_api"
@@ -514,7 +514,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "oxker"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"anyhow",
"bollard",
@@ -623,9 +623,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.46"
+version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
+checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
dependencies = [
"unicode-ident",
]
@@ -712,9 +712,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.85"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
+checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074"
dependencies = [
"itoa",
"ryu",
@@ -1034,9 +1034,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
[[package]]
name = "unicode-ident"
-version = "1.0.4"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
+checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
[[package]]
name = "unicode-normalization"
@@ -1072,9 +1072,9 @@ dependencies = [
[[package]]
name = "uuid"
-version = "1.1.2"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f"
+checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83"
dependencies = [
"getrandom",
"rand",
diff --git a/Cargo.toml b/Cargo.toml
index bb371ca..08497fc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "oxker"
-version = "0.1.5"
+version = "0.1.6"
edition = "2021"
authors = ["Jack Wills "]
description = "A simple tui to view & control docker containers"
@@ -23,7 +23,7 @@ tokio = {version = "1.21", features=["full"]}
tracing = "0.1"
tracing-subscriber = "0.3"
tui = "0.19"
-uuid = {version = "1.1", features = ["v4", "fast-rng"]}
+uuid = {version = "1.2", features = ["v4", "fast-rng"]}
[dev-dependencies]
diff --git a/containerised/platform.sh b/containerised/platform.sh
index 393769a..86eab51 100644
--- a/containerised/platform.sh
+++ b/containerised/platform.sh
@@ -4,15 +4,15 @@
case $TARGETARCH in
"amd64")
- echo "x86_64-unknown-linux-musl" > /.platform
- echo "" > /.compiler
- ;;
+ echo "x86_64-unknown-linux-musl" > /.platform
+ echo "" > /.compiler
+ ;;
"arm64")
- echo "aarch64-unknown-linux-musl" > /.platform
- echo "gcc-aarch64-linux-gnu" > /.compiler
- ;;
+ echo "aarch64-unknown-linux-musl" > /.platform
+ echo "gcc-aarch64-linux-gnu" > /.compiler
+ ;;
"arm")
- echo "arm-unknown-linux-musleabihf" > /.platform
- echo "gcc-arm-linux-gnueabihf" > /.compiler
- ;;
+ echo "arm-unknown-linux-musleabihf" > /.platform
+ echo "gcc-arm-linux-gnueabihf" > /.compiler
+ ;;
esac
\ No newline at end of file
diff --git a/create_release.sh b/create_release.sh
index 3adbf36..268acaf 100755
--- a/create_release.sh
+++ b/create_release.sh
@@ -1,9 +1,8 @@
#!/bin/bash
# rust create_release
-# v0.0.15
+# v0.1.2
-PACKAGE_NAME='oxker'
STAR_LINE='****************************************'
CWD=$(pwd)
@@ -20,11 +19,6 @@ error_close() {
exit 1
}
-if [ -z "$PACKAGE_NAME" ]
-then
- error_close "No package name"
-fi
-
# $1 string - question to ask
ask_yn () {
printf "%b%s? [y/N]:%b " "${GREEN}" "$1" "${RESET}"
@@ -114,8 +108,8 @@ update_release_body_and_changelog () {
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 - comma included!
- # "closes [#1]," -> "closes [#1](https:/www.../issues/1),""
- sed -i -r -E "s=closes \[#([0-9]+)\],=closes [#\1](${GIT_REPO_URL}/issues/\1),=g" ./CHANGELOG.md
+ # "closes #1," -> "closes [#1](https:/www.../issues/1),""
+ sed -i -r -E "s=closes \#([0-9]+)\,=closes [#\1](${GIT_REPO_URL}/issues/\1),=g" ./CHANGELOG.md
}
# update version in cargo.toml, to match selected current version
@@ -193,34 +187,66 @@ cargo_build () {
ask_continue
}
+# $1 text to colourise
+release_continue () {
+ echo -e "\n${PURPLE}$1${RESET}"
+ ask_continue
+
+}
# Full flow to create a new release
release_flow() {
check_git
get_git_remote_url
cargo_test
cargo_build
+
cd "${CWD}" || error_close "Can't find ${CWD}"
check_tag
NEW_TAG_WITH_V="v${MAJOR}.${MINOR}.${PATCH}"
printf "\nnew tag chosen: %s\n\n" "${NEW_TAG_WITH_V}"
+
RELEASE_BRANCH=release-$NEW_TAG_WITH_V
echo -e
ask_changelog_update
+
+ release_continue "checkout ${RELEASE_BRANCH}"
git checkout -b "$RELEASE_BRANCH"
- update_version_number_in_files
- cargo fmt
- git add .
- git commit -m "chore: release $NEW_TAG_WITH_V"
+ release_continue "update_version_number_in_files"
+ update_version_number_in_files
+
+ echo -e "\ncargo fmt"
+ cargo fmt
+
+ release_continue "git add ."
+ git add .
+
+ release_continue "git commit -m \"chore: release \"${NEW_TAG_WITH_V}\""
+ git commit -m "chore: release ${NEW_TAG_WITH_V}"
+
+ release_continue "git checkout main"
git checkout main
+
+ release_continue "git merge --no-ff \"${RELEASE_BRANCH}\" -m \"chore: merge ${RELEASE_BRANCH} into main\""
git merge --no-ff "$RELEASE_BRANCH" -m "chore: merge ${RELEASE_BRANCH} into main"
+
+ release_continue "git tag -am \"${RELEASE_BRANCH}\" \"$NEW_TAG_WITH_V\""
git tag -am "${RELEASE_BRANCH}" "$NEW_TAG_WITH_V"
- echo "git tag -am \"${RELEASE_BRANCH}\" \"$NEW_TAG_WITH_V\""
+
+ release_continue "git push --atomic origin main \"$NEW_TAG_WITH_V\""
git push --atomic origin main "$NEW_TAG_WITH_V"
+
+ release_continue "git checkout dev"
git checkout dev
- git merge --no-ff main -m 'chore: merge main into dev'
+
+ release_continue "git merge --no-ff main -m \"chore: merge main into dev\""
+ git merge --no-ff main -m "chore: merge main into dev"
+
+ release_continue "git push origin dev"
git push origin dev
+
+ release_continue "git branch -d \"$RELEASE_BRANCH\""
git branch -d "$RELEASE_BRANCH"
}
diff --git a/src/app_data/container_state.rs b/src/app_data/container_state.rs
index b8b32b9..5f7ed01 100644
--- a/src/app_data/container_state.rs
+++ b/src/app_data/container_state.rs
@@ -107,6 +107,7 @@ impl StatefulList {
}
}
+ /// Return the current status of the select list, e.g. 2/5,
pub fn get_state_title(&self) -> String {
if self.items.is_empty() {
String::new()
@@ -254,13 +255,11 @@ pub trait Stats {
/// So can use custom display formatter
/// Use trait Stats for use as generic in draw_chart function
#[derive(Debug, Default, Clone, Copy)]
-pub struct CpuStats {
- value: f64,
-}
+pub struct CpuStats(f64);
impl CpuStats {
pub const fn new(value: f64) -> Self {
- Self { value }
+ Self(value)
}
}
@@ -268,21 +267,21 @@ impl Eq for CpuStats {}
impl PartialEq for CpuStats {
fn eq(&self, other: &Self) -> bool {
- self.value == other.value
+ self.0 == other.0
}
}
impl PartialOrd for CpuStats {
fn partial_cmp(&self, other: &Self) -> Option {
- self.value.partial_cmp(&other.value)
+ self.0.partial_cmp(&other.0)
}
}
impl Ord for CpuStats {
fn cmp(&self, other: &Self) -> Ordering {
- if self.value > other.value {
+ if self.0 > other.0 {
Ordering::Greater
- } else if (self.value - other.value).abs() < 0.01 {
+ } else if (self.0 - other.0).abs() < 0.01 {
Ordering::Equal
} else {
Ordering::Less
@@ -292,13 +291,13 @@ impl Ord for CpuStats {
impl Stats for CpuStats {
fn get_value(&self) -> f64 {
- self.value
+ self.0
}
}
impl fmt::Display for CpuStats {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let disp = format!("{:05.2}%", self.value);
+ let disp = format!("{:05.2}%", self.0);
write!(f, "{:>x$}", disp, x = f.width().unwrap_or(1))
}
}
@@ -307,41 +306,39 @@ impl fmt::Display for CpuStats {
/// So can use custom display formatter
/// Use trait Stats for use as generic in draw_chart function
#[derive(Debug, Default, Clone, Copy, Eq)]
-pub struct ByteStats {
- value: u64,
-}
+pub struct ByteStats(u64);
impl PartialEq for ByteStats {
fn eq(&self, other: &Self) -> bool {
- self.value == other.value
+ self.0 == other.0
}
}
impl PartialOrd for ByteStats {
fn partial_cmp(&self, other: &Self) -> Option {
- self.value.partial_cmp(&other.value)
+ self.0.partial_cmp(&other.0)
}
}
impl Ord for ByteStats {
fn cmp(&self, other: &Self) -> Ordering {
- self.value.cmp(&other.value)
+ self.0.cmp(&other.0)
}
}
impl ByteStats {
pub const fn new(value: u64) -> Self {
- Self { value }
+ Self(value)
}
pub fn update(&mut self, value: u64) {
- self.value = value;
+ self.0 = value;
}
}
#[allow(clippy::cast_precision_loss)]
impl Stats for ByteStats {
fn get_value(&self) -> f64 {
- self.value as f64
+ self.0 as f64
}
}
@@ -353,7 +350,7 @@ impl fmt::Display for ByteStats {
x if x >= ONE_GB => format!("{y:.2} GB", y = as_f64 / ONE_GB),
x if x >= ONE_MB => format!("{y:.2} MB", y = as_f64 / ONE_MB),
x if x >= ONE_KB => format!("{y:.2} kB", y = as_f64 / ONE_KB),
- _ => format!("{} B", self.value),
+ _ => format!("{} B", self.0),
};
write!(f, "{:>x$}", p, x = f.width().unwrap_or(1))
}
@@ -426,7 +423,7 @@ impl ContainerItem {
self.cpu_stats
.iter()
.enumerate()
- .map(|i| (i.0 as f64, i.1.value as f64))
+ .map(|i| (i.0 as f64, i.1 .0 as f64))
.collect::>()
}
@@ -436,7 +433,7 @@ impl ContainerItem {
self.mem_stats
.iter()
.enumerate()
- .map(|i| (i.0 as f64, i.1.value as f64))
+ .map(|i| (i.0 as f64, i.1 .0 as f64))
.collect::>()
}
diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs
index abb6f8b..cf7887a 100644
--- a/src/app_data/mod.rs
+++ b/src/app_data/mod.rs
@@ -14,10 +14,8 @@ pub struct AppData {
args: CliArgs,
error: Option,
logs_parsed: bool,
- pub containers: StatefulList,
- pub init: bool,
- pub show_error: bool,
sorted_by: Option<(Header, SortedOrder)>,
+ pub containers: StatefulList,
}
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
@@ -79,9 +77,7 @@ impl AppData {
args,
containers: StatefulList::new(vec![]),
error: None,
- init: false,
logs_parsed: false,
- show_error: false,
sorted_by: None,
}
}
@@ -257,11 +253,20 @@ impl AppData {
}
/// Get the title for log panel for selected container
- /// will be "logs x/x"
+ /// will be either
+ /// 1) "logs x/x - container_name" where container_name is 32 chars max
+ /// 2) "logs - container_name" when no logs found, again 32 chars max
pub fn get_log_title(&self) -> String {
self.get_selected_log_index()
.map_or("".to_owned(), |index| {
- self.containers.items[index].logs.get_state_title()
+ let logs_len = self.containers.items[index].logs.get_state_title();
+ let mut name = self.containers.items[index].name.clone();
+ name.truncate(32);
+ if logs_len.is_empty() {
+ format!("- {} ", name)
+ } else {
+ format!("{} - {}", logs_len, name)
+ }
})
}
diff --git a/src/docker_data/mod.rs b/src/docker_data/mod.rs
index d0a3e47..f80c516 100644
--- a/src/docker_data/mod.rs
+++ b/src/docker_data/mod.rs
@@ -3,7 +3,7 @@ use bollard::{
service::ContainerSummary,
Docker,
};
-use futures_util::StreamExt;
+use futures_util::{Future, StreamExt};
use parking_lot::Mutex;
use std::{
collections::HashMap,
@@ -19,7 +19,7 @@ use crate::{
app_data::{AppData, ContainerId, DockerControls},
app_error::AppError,
parse_args::CliArgs,
- ui::GuiState,
+ ui::{GuiState, Status},
};
mod message;
pub use message::DockerMessage;
@@ -316,8 +316,9 @@ impl DockerData {
self.gui_state.lock().remove_loading(loading_uuid);
}
- // 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) {
+ self.gui_state.lock().status_push(Status::Init);
let loading_uuid = Uuid::new_v4();
let loading_spin = self.loading_spin(loading_uuid).await;
@@ -336,65 +337,62 @@ impl DockerData {
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
self.initialised = self.app_data.lock().initialised(&all_ids);
}
- self.app_data.lock().init = true;
+ self.gui_state.lock().status_del(Status::Init);
self.stop_loading_spin(&loading_spin, loading_uuid);
}
+ /// Set the global error as the docker error, and set gui_state to error
+ fn set_error(&mut self, error: DockerControls) {
+ self.app_data
+ .lock()
+ .set_error(AppError::DockerCommand(error));
+ self.gui_state.lock().status_push(Status::Error);
+ }
+
+ /// Execute a docker command, will start and stop the loading spinner, and set correct error
+ async fn exec_docker(
+ &mut self,
+ docker_fn: impl Future