From 6f5cb678cc0b84e4def52aaf5577eaee9f788740 Mon Sep 17 00:00:00 2001 From: giing <33764485+ExperiBass@users.noreply.github.com> Date: Sat, 9 Nov 2024 18:03:25 -0500 Subject: [PATCH] [/peers] add transport protocol table field --- views/peers.pug | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/views/peers.pug b/views/peers.pug index f24f62e14..13a00e87e 100644 --- a/views/peers.pug +++ b/views/peers.pug @@ -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") @@ -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 @@ -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 @@ -110,6 +110,8 @@ 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 + span.border-dotted(data-bs-toggle="tooltip", title="P2P transport protocol") P2P if (peerIpSummary && peerIpSummary.ips) th.text-card-highlight.text-uppercase.fw-light Location @@ -148,6 +150,7 @@ block content | 0x#{item.services.replace(/^0+/, '')} td #{item.connection_type} + td #{item.transport_protocol_type} if (peerIpSummary.ips) td @@ -156,9 +159,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 @@ -167,7 +170,7 @@ block content - var ipAddr = null; td #{lastSendAgo} / #{lastRecvAgo} - + +pageTab("JSON") @@ -183,15 +186,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") @@ -236,6 +239,3 @@ block endOfBody - var ipDetailsPopupHtml = ipDetailsPopupHtml + ipDetails.country_name + " "; script L.marker([#{ipDetails.latitude}, #{ipDetails.longitude}]).addTo(mymap).bindPopup("!{ipDetailsPopupHtml}"); - - -