Skip to content

Commit

Permalink
[/peers] add transport protocol table field
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf0xx0 committed Nov 10, 2024
1 parent 7ce0570 commit 53010c1
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions views/peers.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ block headContent

block content
+pageTitle(`${peerSummary.getpeerinfo.length} Peer${peerSummary.getpeerinfo.length == 1 ? "" : "s"}`)

+pageTabs(["Details", "JSON"])

.tab-content
+pageTab("Details", true)

if (peerIpSummary && peerIpSummary.ips)
.mb-3(id="map")

Expand Down Expand Up @@ -57,7 +57,7 @@ block content
tr(class=(index >= 5 ? "services-hidden-rows" : false))
td.small.text-muted #{index + 1}

td
td
if (!peerSummary.serviceNamesAvailable)
| 0x

Expand Down Expand Up @@ -99,7 +99,7 @@ block content

td #{item[0]}
td.text-end #{item[1].toLocaleString()}


+contentSection(`${peerSummary.getpeerinfo.length.toLocaleString()} Peer${peerSummary.getpeerinfo.length == 1 ? "" : "s"}`)
table.table.table-borderless.table-striped.table-responsive-sm.data-table.mt-4
Expand All @@ -110,6 +110,7 @@ block content
th.text-card-highlight.text-uppercase.fw-light Address
th.text-card-highlight.text-uppercase.fw-light Services
th.text-card-highlight.text-uppercase.fw-light Conn. Type
th.text-card-highlight.text-uppercase.fw-light Trans. Protocol

if (peerIpSummary && peerIpSummary.ips)
th.text-card-highlight.text-uppercase.fw-light Location
Expand Down Expand Up @@ -148,6 +149,7 @@ block content
| 0x#{item.services.replace(/^0+/, '')}

td #{item.connection_type}
td #{item.transport_protocol_type}

if (peerIpSummary.ips)
td
Expand All @@ -156,9 +158,9 @@ block content
- var ipDetails = peerIpSummary.detailsByIp[ipAddr];
if (ipDetails)
if (ipDetails.city)
span #{ipDetails.city},
span #{ipDetails.city},
if (ipDetails.region_name)
span #{ipDetails.region_name},
span #{ipDetails.region_name},
if (ipDetails.country_name)
span #{ipDetails.country_name}
else
Expand All @@ -167,7 +169,7 @@ block content
- var ipAddr = null;

td #{lastSendAgo} / #{lastRecvAgo}



+pageTab("JSON")
Expand All @@ -183,15 +185,15 @@ block content
+contentSection("Peer Details")
pre
code.json #{JSON.stringify(item, null, 4)}


if (peerIpSummary && peerIpSummary.detailsByIp && peerIpSummary.detailsByIp[item.addr.substring(0, item.addr.lastIndexOf(":"))])
+contentSection("Location Info")
pre
code.json #{JSON.stringify(peerIpSummary.detailsByIp[item.addr.substring(0, item.addr.lastIndexOf(":"))], null, 4)}





block endOfBody
script(src=assetUrl("./js/jquery.dataTables.min.js"), integrity=assetIntegrity("jquery.dataTables.min.js"), crossorigin="anonymous")
script(src=assetUrl("./js/dataTables.bootstrap4.min.js"), integrity=assetIntegrity("dataTables.bootstrap4.min.js"), crossorigin="anonymous")
Expand Down Expand Up @@ -236,6 +238,3 @@ block endOfBody
- var ipDetailsPopupHtml = ipDetailsPopupHtml + ipDetails.country_name + " ";

script L.marker([#{ipDetails.latitude}, #{ipDetails.longitude}]).addTo(mymap).bindPopup("!{ipDetailsPopupHtml}");



0 comments on commit 53010c1

Please sign in to comment.