From d8e8e063e5fe82cbbc478300d634d9b16b260fcd Mon Sep 17 00:00:00 2001 From: Dmytro Vovk Date: Wed, 2 Oct 2024 20:07:23 +0100 Subject: [PATCH] display peername, small fixes --- .../PeersStatistics/PeerDetailsPopup.tsx | 5 +++-- .../PeersStatistics/PeerDetailsTable.tsx | 20 ++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/components/PeersStatistics/PeerDetailsPopup.tsx b/src/app/components/PeersStatistics/PeerDetailsPopup.tsx index 394468d..f1adfab 100644 --- a/src/app/components/PeersStatistics/PeerDetailsPopup.tsx +++ b/src/app/components/PeersStatistics/PeerDetailsPopup.tsx @@ -97,6 +97,7 @@ export const PeerDetailsPopup = ({ peerId, onClose, ...props }: PeerDetailsPopup {renderMainInfoRow("ID", peer.id)} + {renderMainInfoRow("Name", peer.name)} {renderMainInfoRow("protocols", peer.protocols)} {renderMainInfoRow("enr", peer.enr)} {renderMainInfoRow("Enode", peer.enode)} @@ -128,9 +129,9 @@ export const PeerDetailsPopup = ({ peerId, onClose, ...props }: PeerDetailsPopup return ( <>
-
+
{/*content*/} -
+
{/*header*/}

Peer Details

{/*body*/} diff --git a/src/app/components/PeersStatistics/PeerDetailsTable.tsx b/src/app/components/PeersStatistics/PeerDetailsTable.tsx index 535a73f..25695e7 100644 --- a/src/app/components/PeersStatistics/PeerDetailsTable.tsx +++ b/src/app/components/PeersStatistics/PeerDetailsTable.tsx @@ -7,6 +7,7 @@ import SortIcon from "@mui/icons-material/Sort"; enum SortColumn { Id = "Id", + Name = "Name", Type = "Type", Status = "Status", TotalIn = "TotalIn", @@ -41,6 +42,8 @@ export const PeersDetailsTable = ({ peers, onPeerClicked }: PeersDetailsTablePro let sortedPeers = prs.sort((a, b) => { if (sotOpt.column === SortColumn.Id) { return compareStrings(a.id, b.id, sotOpt.descending); + } else if (sotOpt.column === SortColumn.Name) { + return compareStrings(a.name, b.name, sotOpt.descending); } else if (sotOpt.column === SortColumn.Type) { return compareStrings(a.type, b.type, sotOpt.descending); } else if (sotOpt.column === SortColumn.Status) { @@ -100,7 +103,7 @@ export const PeersDetailsTable = ({ peers, onPeerClicked }: PeersDetailsTablePro return (
- +
+ +
{ + sortPeers(visiblePeers, { + column: SortColumn.Name, + descending: !currentSortState.descending + }); + }} + > +
+ peer Name + {getArrowIcon(SortColumn.Name)} +
+
{ @@ -214,6 +231,7 @@ export const PeersDetailsTable = ({ peers, onPeerClicked }: PeersDetailsTablePro }} > {peer.id}{peer.name} {getPeerType(peer)} {peer.active ? "active" : ""} {multipleBytes(peer.network.bytesIn)}