xfer
This commit is contained in:
		@@ -52,8 +52,8 @@ impl TableViewItem<PeerTableColumn> for PeerTableData {
 | 
			
		||||
        match column {
 | 
			
		||||
            PeerTableColumn::NodeId => self
 | 
			
		||||
                .node_ids
 | 
			
		||||
                .best()
 | 
			
		||||
                .map(|n| n.value.encode())
 | 
			
		||||
                .first()
 | 
			
		||||
                .cloned()
 | 
			
		||||
                .unwrap_or_else(|| "???".to_owned()),
 | 
			
		||||
            PeerTableColumn::Address => format!(
 | 
			
		||||
                "{:?}:{}",
 | 
			
		||||
@@ -78,21 +78,7 @@ impl TableViewItem<PeerTableColumn> for PeerTableData {
 | 
			
		||||
        Self: Sized,
 | 
			
		||||
    {
 | 
			
		||||
        match column {
 | 
			
		||||
            PeerTableColumn::NodeId => {
 | 
			
		||||
                let n1 = self
 | 
			
		||||
                    .node_ids
 | 
			
		||||
                    .best()
 | 
			
		||||
                    .map(|n| n.value.encode())
 | 
			
		||||
                    .unwrap_or_else(|| "???".to_owned());
 | 
			
		||||
 | 
			
		||||
                let n2 = other
 | 
			
		||||
                    .node_ids
 | 
			
		||||
                    .best()
 | 
			
		||||
                    .map(|n| n.value.encode())
 | 
			
		||||
                    .unwrap_or_else(|| "???".to_owned());
 | 
			
		||||
 | 
			
		||||
                n1.cmp(&n2)
 | 
			
		||||
            }
 | 
			
		||||
            PeerTableColumn::NodeId => self.to_column(column).cmp(&other.to_column(column)),
 | 
			
		||||
            PeerTableColumn::Address => self.to_column(column).cmp(&other.to_column(column)),
 | 
			
		||||
            PeerTableColumn::LatencyAvg => self
 | 
			
		||||
                .peer_stats
 | 
			
		||||
 
 | 
			
		||||
@@ -753,7 +753,7 @@ impl UI {
 | 
			
		||||
            .full_screen();
 | 
			
		||||
 | 
			
		||||
        let peers_table_view = PeersTableView::new()
 | 
			
		||||
            .column(PeerTableColumn::NodeId, "Node Id", |c| c.width(43))
 | 
			
		||||
            .column(PeerTableColumn::NodeId, "Node Id", |c| c.width(48))
 | 
			
		||||
            .column(PeerTableColumn::Address, "Address", |c| c)
 | 
			
		||||
            .column(PeerTableColumn::LatencyAvg, "Ping", |c| c.width(8))
 | 
			
		||||
            .column(PeerTableColumn::TransferDownAvg, "Down", |c| c.width(8))
 | 
			
		||||
 
 | 
			
		||||
@@ -1551,7 +1551,7 @@ impl NetworkManager {
 | 
			
		||||
                    if let Some(nr) = routing_table.lookup_node_ref(k) {
 | 
			
		||||
                        let peer_stats = nr.peer_stats();
 | 
			
		||||
                        let peer = PeerTableData {
 | 
			
		||||
                            node_ids: nr.node_ids(),
 | 
			
		||||
                            node_ids: nr.node_ids().iter().map(|x| x.to_string()).collect(),
 | 
			
		||||
                            peer_address: v.last_connection.remote(),
 | 
			
		||||
                            peer_stats,
 | 
			
		||||
                        };
 | 
			
		||||
 
 | 
			
		||||
@@ -267,7 +267,7 @@ pub struct VeilidStateAttachment {
 | 
			
		||||
)]
 | 
			
		||||
#[archive_attr(repr(C), derive(CheckBytes))]
 | 
			
		||||
pub struct PeerTableData {
 | 
			
		||||
    pub node_ids: TypedKeySet,
 | 
			
		||||
    pub node_ids: Vec<String>,
 | 
			
		||||
    pub peer_address: PeerAddress,
 | 
			
		||||
    pub peer_stats: PeerStats,
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user