Skip to content

Commit 1c63988

Browse files
authored
Merge pull request #539 from ethpandaops/bbusa/add-search-by-peerid
feat: add search by peerid/enr
2 parents 560bbb0 + 02b29b8 commit 1c63988

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

templates/clients/clients_cl.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we
227227
<div style="margin-bottom: 15px; padding: 0 15px;">
228228
<div class="input-group">
229229
<span class="input-group-text"><i class="fas fa-search"></i></span>
230-
<input type="text" class="form-control" id="clientSearchInput" placeholder="Search clients by name...">
230+
<input type="text" class="form-control" id="clientSearchInput" placeholder="Search by name, peer ID, or ENR...">
231231
<button class="btn btn-outline-secondary" type="button" id="clearClientSearch">Clear</button>
232232
</div>
233233
</div>
@@ -1069,9 +1069,17 @@ <h5 class="modal-title" id="specMismatchModalTitle">
10691069
$('#clients tbody tr').each(function() {
10701070
if (!$(this).hasClass('peerInfo')) {
10711071
var clientName = $(this).find('.client-row a').text().toLowerCase();
1072+
var peerId = $(this).find('.client-row').data('peerid') || '';
10721073
var peerInfoRow = $(this).next('.peerInfo');
1074+
var node = nodes[peerId] || {};
1075+
var enr = (node.enr || '').toLowerCase();
10731076

1074-
if (searchText === '' || clientName.includes(searchText)) {
1077+
var matches = searchText === '' ||
1078+
clientName.includes(searchText) ||
1079+
peerId.toLowerCase().includes(searchText) ||
1080+
enr.includes(searchText);
1081+
1082+
if (matches) {
10751083
$(this).show();
10761084
peerInfoRow.css('display', '');
10771085
} else {

0 commit comments

Comments
 (0)