Com protocol
This commit is contained in:
@@ -20,7 +20,7 @@ impl PulseTradeApp {
|
||||
_ => {
|
||||
self.logs.lock().await.push(EventLog {
|
||||
kind: crate::ptc::LogKind::Err,
|
||||
name: "cmd",
|
||||
name: "cmd".to_string(),
|
||||
message: format!("Command '{}' not found", command),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,22 +12,15 @@ impl Formatted for InspectTarget {
|
||||
match self {
|
||||
Self::None => vec!["\x1b[2mnothing to inspect\x1b[0m".to_string()],
|
||||
|
||||
Self::Symbol(boxed) => {
|
||||
let (watch, overview) = &**boxed;
|
||||
vec![
|
||||
Property("Symbol", format!("\x1b[35m{}\x1b[0m", watch.symbol)),
|
||||
Property("Price", format!("\x1b[96m{}\x1b[0m", format_f64(watch.price))),
|
||||
Property("Trend", format!("{}", format_f64(watch.trend))),
|
||||
Property("Market", format!("{}", overview.trend)),
|
||||
Property("Volatility", format!("{}", overview.volatility)),
|
||||
Property(
|
||||
"Pressure",
|
||||
format!("{:+.2}%", overview.pressure * 100.0),
|
||||
),
|
||||
Property("Alerts", format!("{}", overview.alerts.len())),
|
||||
]
|
||||
.get_formatted()
|
||||
}
|
||||
Self::Symbol(watch) => vec![
|
||||
Property("Symbol", format!("\x1b[35m{}\x1b[0m", watch.symbol)),
|
||||
Property(
|
||||
"Price",
|
||||
format!("\x1b[96m{}\x1b[0m", format_f64(watch.price)),
|
||||
),
|
||||
Property("Trend", format!("{}", format_f64(watch.trend))),
|
||||
]
|
||||
.get_formatted(),
|
||||
|
||||
Self::Position(pos) => vec![
|
||||
Property("Symbol", format!("\x1b[35m{}\x1b[0m", pos.symbol)),
|
||||
|
||||
@@ -112,7 +112,7 @@ impl App for PulseTradeApp {
|
||||
|
||||
logs.push(EventLog {
|
||||
kind: ptc::LogKind::Warn,
|
||||
name: "pulse.init",
|
||||
name: "pulse.init".to_string(),
|
||||
message: "We're still not done yet ;)".to_string(),
|
||||
});
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
include!("../pc.rs");
|
||||
include!("../ptc.rs");
|
||||
|
||||
Reference in New Issue
Block a user