diff --git a/bin/dnetview/src/main.rs b/bin/dnetview/src/main.rs index 9c0228157..6a05bd617 100644 --- a/bin/dnetview/src/main.rs +++ b/bin/dnetview/src/main.rs @@ -304,9 +304,9 @@ async fn parse_inbound(inbound: &Value, node_id: &String) -> DnetViewResult = Vec::new(); + let mut msg_log: Vec<(u64, String, String)> = Vec::new(); for msg in msg_values { - let msg: (String, String) = serde_json::from_value(msg.clone())?; + let msg: (u64, String, String) = serde_json::from_value(msg.clone())?; msg_log.push(msg); } let is_empty = false; @@ -411,9 +411,9 @@ async fn parse_outbound(outbound: &Value, node_id: &String) -> DnetViewResult = Vec::new(); + let mut msg_log: Vec<(u64, String, String)> = Vec::new(); for msg in msg_values { - let msg: (String, String) = serde_json::from_value(msg.clone())?; + let msg: (u64, String, String) = serde_json::from_value(msg.clone())?; msg_log.push(msg); } let is_empty = false; diff --git a/bin/dnetview/src/model.rs b/bin/dnetview/src/model.rs index 156e906f4..ba829a31f 100644 --- a/bin/dnetview/src/model.rs +++ b/bin/dnetview/src/model.rs @@ -20,7 +20,7 @@ pub enum SelectableObject { pub struct Model { pub ids: Mutex>, pub nodes: Mutex>, - pub msg_log: Mutex>>, + pub msg_log: Mutex>>, pub selectables: Mutex>, } @@ -28,7 +28,7 @@ impl Model { pub fn new( ids: Mutex>, nodes: Mutex>, - msg_log: Mutex>>, + msg_log: Mutex>>, selectables: Mutex>, ) -> Model { Model { ids, nodes, msg_log, selectables } @@ -81,7 +81,7 @@ pub struct ConnectInfo { pub addr: String, pub state: String, pub parent: String, - pub msg_log: Vec<(String, String)>, + pub msg_log: Vec<(u64, String, String)>, pub is_empty: bool, pub last_msg: String, pub last_status: String, @@ -93,7 +93,7 @@ impl ConnectInfo { addr: String, state: String, parent: String, - msg_log: Vec<(String, String)>, + msg_log: Vec<(u64, String, String)>, is_empty: bool, last_msg: String, last_status: String, diff --git a/bin/dnetview/src/view.rs b/bin/dnetview/src/view.rs index 25912e83a..13e7545cf 100644 --- a/bin/dnetview/src/view.rs +++ b/bin/dnetview/src/view.rs @@ -20,7 +20,7 @@ use log::debug; #[derive(Debug)] pub struct View { pub nodes: NodeInfoView, - pub msg_log: FxHashMap>, + pub msg_log: FxHashMap>, pub active_ids: IdListView, pub selectables: FxHashMap, } @@ -28,7 +28,7 @@ pub struct View { impl View { pub fn new( nodes: NodeInfoView, - msg_log: FxHashMap>, + msg_log: FxHashMap>, active_ids: IdListView, selectables: FxHashMap, ) -> View { @@ -38,7 +38,7 @@ impl View { pub fn update( &mut self, nodes: FxHashMap, - msg_log: FxHashMap>, + msg_log: FxHashMap>, selectables: FxHashMap, ) { self.update_nodes(nodes); @@ -73,7 +73,7 @@ impl View { } } - fn update_msg_log(&mut self, msg_log: FxHashMap>) { + fn update_msg_log(&mut self, msg_log: FxHashMap>) { for (id, msg) in msg_log { self.msg_log.insert(id, msg); } @@ -207,7 +207,7 @@ impl View { let log = self.msg_log.get(&connect.id); match log { Some(values) => { - for (k, v) in values { + for (t, k, v) in values { lines.push(Spans::from(match k.as_str() { "send" => Span::styled(format!("S: {}", v), style), "recv" => Span::styled(format!("R: {}", v), style),