wip: logs broken

This commit is contained in:
Jack Wills
2022-07-22 21:23:09 +00:00
parent db7aa8dceb
commit 8cdfa2d6be
3 changed files with 13 additions and 26 deletions
+1 -1
View File
@@ -183,7 +183,6 @@ cargo_test () {
release_flow() { release_flow() {
check_git check_git
get_git_remote_url get_git_remote_url
cargo fmt
cargo_test cargo_test
cd "${CWD}" || error_close "Can't find ${CWD}" cd "${CWD}" || error_close "Can't find ${CWD}"
check_tag check_tag
@@ -195,6 +194,7 @@ release_flow() {
ask_changelog_update ask_changelog_update
git checkout -b "$RELEASE_BRANCH" git checkout -b "$RELEASE_BRANCH"
update_version_number_in_files update_version_number_in_files
cargo fmt
git add . git add .
git commit -m "chore: release $NEW_TAG_WITH_V" git commit -m "chore: release $NEW_TAG_WITH_V"
+9 -8
View File
@@ -117,15 +117,16 @@ impl State {
_ => Color::Red, _ => Color::Red,
} }
} }
pub fn as_text(&self) -> &'static str { // Dirty way to create order for the state, rather than impl Ord
pub fn order(&self) -> &'static str {
match self { match self {
Self::Dead => "dead", Self::Running => "a",
Self::Exited => "exited", Self::Paused => "b",
Self::Paused => "paused", Self::Restarting => "c",
Self::Removing => "removing", Self::Removing => "d",
Self::Restarting => "restarting", Self::Exited => "e",
Self::Running => "running", Self::Dead => "f",
Self::Unknown => "unknown", Self::Unknown => "g",
} }
} }
} }
+3 -17
View File
@@ -86,24 +86,10 @@ impl AppData {
init: false, init: false,
logs_parsed: false, logs_parsed: false,
show_error: false, show_error: false,
sorted_by: None, sorted_by: Some((Header::State, SortedOrder::Asc))
} }
} }
// fn heading_click(&self) {
// if let Some(data) = self
// .heading_map
// .iter()
// .filter(|i| i.1.intersects(rect))
// .collect::<Vec<_>>()
// .get(0)
// {
// // self.selected_panel = *data.0;
// }
// }
// Current time as unix timestamp // Current time as unix timestamp
fn get_systemtime(&self) -> u64 { fn get_systemtime(&self) -> u64 {
SystemTime::now() SystemTime::now()
@@ -199,11 +185,11 @@ impl AppData {
SortedOrder::Asc => self SortedOrder::Asc => self
.containers .containers
.items .items
.sort_by(|a, b| a.state.as_text().cmp(b.state.as_text())), .sort_by(|a, b| a.state.order().cmp(b.state.order())),
SortedOrder::Desc => self SortedOrder::Desc => self
.containers .containers
.items .items
.sort_by(|a, b| b.state.as_text().cmp(a.state.as_text())), .sort_by(|a, b| b.state.order().cmp(a.state.order())),
}, },
Header::Status => match so { Header::Status => match so {
SortedOrder::Asc => self SortedOrder::Asc => self