Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ neo4rs = "0.8.0"
bytes = "1.10.1"
rand = "0.9.0"
indoc = "2.0.6"
owo-colors = "4.2.0"
17 changes: 13 additions & 4 deletions src/setup/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use crate::prelude::*;

use indenter::indented;
use owo_colors::{AnsiColors, OwoColorize};
use std::fmt::Debug;
use std::fmt::{Display, Write};
use std::hash::Hash;
Expand Down Expand Up @@ -274,14 +275,17 @@ impl<K, S, C: ResourceSetupStatusCheck> std::fmt::Display for ResourceSetupInfo<
Some(SetupChangeType::Invalid) => "INVALID",
None => "USER MANAGED",
};
writeln!(f, "[ {:^9} ] {}", status_code, self.description)?;
let status_str = format!("[ {:^9} ]", status_code);
let status_full = status_str.color(AnsiColors::Cyan);
let desc_colored = self.description.color(AnsiColors::BrightWhite);
writeln!(f, "{} {}", status_full, desc_colored)?;
if let Some(status_check) = &self.status_check {
let changes = status_check.describe_changes();
if !changes.is_empty() {
let mut f = indented(f).with_str(INDENT);
writeln!(f, "TODO:")?;
writeln!(f, "{}", "TODO:".color(AnsiColors::BrightBlack))?;
for change in changes {
writeln!(f, " - {}", change)?;
writeln!(f, " - {}", change.color(AnsiColors::BrightBlack))?;
}
writeln!(f)?;
}
Expand Down Expand Up @@ -385,7 +389,12 @@ impl std::fmt::Display for FormattedFlowSetupStatusCheck<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let flow_ssc = self.1;

write!(f, "{} Flow: {}\n", ObjectSetupStatusCode(flow_ssc), self.0)?;
write!(
f,
"{} {}\n",
ObjectSetupStatusCode(flow_ssc).to_string().color(AnsiColors::Cyan),
format!("Flow: {}", self.0).color(AnsiColors::White)
)?;

let mut f = indented(f).with_str(INDENT);
write!(f, "{}", flow_ssc.tracking_table)?;
Expand Down