Skip to content

Commit

Permalink
Merge branch 'master' into pk910/trigger-el-requests
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Nov 22, 2024
2 parents f911987 + ff6fef0 commit 7909de3
Show file tree
Hide file tree
Showing 6 changed files with 405 additions and 944 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ require (
github.com/tdewolff/minify v2.3.6+incompatible
github.com/timandy/routine v1.1.4
github.com/urfave/negroni v1.0.0
golang.org/x/crypto v0.28.0
golang.org/x/crypto v0.29.0
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
golang.org/x/text v0.19.0
golang.org/x/time v0.7.0
golang.org/x/text v0.20.0
golang.org/x/time v0.8.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down Expand Up @@ -138,8 +138,8 @@ require (
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI=
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down Expand Up @@ -532,8 +532,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -566,16 +566,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand All @@ -585,10 +585,10 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
Expand Down
63 changes: 43 additions & 20 deletions templates/clients/clients_cl.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-server mx-2"></i>Consensus clients<
<div class="accordion" id="network-accordion">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button btn-secondary" style="box-shadow: none;" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<button id="peerGraphToggler" class="accordion-button btn-secondary collapsed" style="box-shadow: none;" type="button" data-bs-toggle="collapse" data-bs-target="#peerGraph" aria-expanded="true" aria-controls="peerGraph">
<i class="fa-solid fa-circle-nodes" style="margin-right:5px"></i> Client graph
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#network-accordion">
<div id="peerGraph" class="accordion-collapse collapse" data-bs-parent="#network-accordion">
<div class="accordion-body peer-nodemap-wrapper">
<div class="card-body px-0 peer-nodemap" id="nodemap">
<div id="nodemap-loading" class="spinner-border" role="status">
Expand All @@ -51,10 +51,10 @@ <h2 class="accordion-header">
<div class="card-body px-0 peer-nodemap-menu">
<div class="btn-group btn-group-sm" role="group" aria-label="Network layouts" style="position: absolute; bottom: 5px; right: 10px;">
<button type="button" class="btn btn-secondary" disabled>Layouts</button>
<button type="button" data-toggle="tooltip" data-placement="top" title="CoSE" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.fcose(data.nodes.length))'><i class="fa-solid fa-share-alt"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Circle" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.circle())'><i class="fa-solid fa-circle"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Grid" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.grid())'><i class="fa-solid fa-th"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Concentric" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.concentric(data.nodes.length))'><i class="fa-solid fa-sun"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="CoSE" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.fcose(data.nodes.length))'><i class="fa-solid fa-share-alt"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Circle" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.circle())'><i class="fa-solid fa-circle"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Grid" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.grid())'><i class="fa-solid fa-th"></i></button>
<button type="button" data-toggle="tooltip" data-placement="top" title="Concentric" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.concentric(data.nodes.length))'><i class="fa-solid fa-sun"></i></button>
</div>
</div>
</div>
Expand Down Expand Up @@ -263,13 +263,7 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we
<td>{{ $client.Index }}</td>
<td>
<svg class="client-node-icon" data-jdenticon-value="{{ $client.PeerID }}"></svg>
<span
id="clientRow-{{ $client.Name }}"
style="cursor:pointer;"
onclick="$_network.isolateNode(cy, '{{ $client.PeerID}}');
$('.collapse.peerInfo').collapse('hide');
$('#peerInfo-{{ $client.PeerID }}').collapse('show');
">
<span id="clientRow-{{ $client.Name }}" style="cursor:pointer;" class="client-row" data-peerid="{{ $client.PeerID}}">
<a href="#name={{ $client.Name }}">{{ $client.Name }}</a>
</span>
</td>
Expand Down Expand Up @@ -532,12 +526,28 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we
<script src="https://cytoscape.org/cytoscape.js-cxtmenu/cytoscape-cxtmenu.js"></script>
<script src="/js/cytoscape-network-aux.js"></script>
<script type="text/javascript">
var container = document.getElementById("nodemap");
var data = {{ .PeerMap }};
var cy = $_network.create(container, data);
var peerGraphData = {{ .PeerMap }};
var peerGraph, peerGraphRendered = false;

var nodes = {{ .Nodes }};

function renderPeerGraph() {
var container = document.getElementById("nodemap");
peerGraph = $_network.create(container, peerGraphData);
}

if(peerGraphData.nodes.filter(function(node) { return node.group == "internal" }).length <= 100) {
$('#peerGraph').addClass('show');
$('#peerGraphToggler').removeClass('collapsed');
renderPeerGraph();
} else {
$('#peerGraph').on('shown.bs.collapse', function () {
if(peerGraphRendered) return;
renderPeerGraph();
peerGraphRendered = true;
});
}

var showPeerDetailsModal = function(peerID){
jdenticon.update("#peerDetailsModalTitleImage", peerID);
$('#peerDetailsModalTitle').html(`${nodes[peerID].alias}`);
Expand Down Expand Up @@ -683,7 +693,8 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we
$('.dastablenode').hover(
function() {
hoverTimeout = setTimeout(() => {
const searchText = $('#searchDASTablePeers').val().trim().toLowerCase();
var searchText = $('#searchDASTablePeers').val();
if(searchText) searchText = searchText.trim().toLowerCase();

if (!searchText && lastClickedNode == null) {
const $target = $(this);
Expand All @@ -695,7 +706,8 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we
},
function() {
clearTimeout(hoverTimeout); // Clear the timeout if the mouse leaves before 2 seconds
const searchText = $('#searchDASTablePeers').val().trim().toLowerCase();
var searchText = $('#searchDASTablePeers').val();
if(searchText) searchText = searchText.trim().toLowerCase();

if (!searchText && lastClickedNode == null) {
const $target = $(this);
Expand Down Expand Up @@ -736,7 +748,8 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we

// Event listener to remove highlight when clicking outside
$(document).on('click', function(event) {
const searchText = $('#searchDASTablePeers').val().trim().toLowerCase();
var searchText = $('#searchDASTablePeers').val();
if(searchText) searchText = searchText.trim().toLowerCase();

if (!searchText && !$(event.target).closest('.dastablenode').length) {
// Remove highlight and blur when clicking outside a .dastablenode element
Expand All @@ -747,7 +760,8 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we

// PeerDASTable search
$('#searchDASTablePeers').on('input', function() {
const searchText = $(this).val().trim().toLowerCase();
var searchText = $(this).val();
if(searchText) searchText = searchText.trim().toLowerCase();

if (searchText) {
$('.dastablenode').each(function() {
Expand All @@ -769,6 +783,15 @@ <h5 class="modal-title" id="peerDasWarningsModal">👀 PeerDAS: Some problems we
$('#searchDASTablePeers').val(''); // Clear the input
});

$('.client-row').on('click', function() {
var peerId = $(this).data('peerid');
if(peerGraph) {
$_network.isolateNode(peerGraph, peerId);
}
$('.collapse.peerInfo').collapse('hide');
$('#peerInfo-' + peerId).collapse('show');
});

</script>
{{ end }}
{{ define "css" }}
Expand Down
52 changes: 36 additions & 16 deletions templates/clients/clients_el.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-server mx-2"></i>Execution clients<
<div class="accordion" id="network-accordion">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button btn-secondary" style="box-shadow: none;" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<button id="peerGraphToggler" class="accordion-button btn-secondary collapsed" style="box-shadow: none;" type="button" data-bs-toggle="collapse" data-bs-target="#peerGraph" aria-expanded="true" aria-controls="peerGraph">
<i class="fa-solid fa-circle-nodes" style="margin-right:5px"></i> Client graph
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#network-accordion">
<div id="peerGraph" class="accordion-collapse collapse" data-bs-parent="#network-accordion">
<div class="accordion-body peer-nodemap-wrapper">
<div class="card-body px-0 peer-nodemap" id="nodemap">
<div id="nodemap-loading" class="spinner-border" role="status">
Expand All @@ -27,10 +27,10 @@ <h2 class="accordion-header">
<div class="card-body px-0 peer-nodemap-menu">
<div class="btn-group btn-group-sm" role="group" aria-label="Network layouts" style="position: absolute; bottom: 5px; right: 10px;">
<button type="button" class="btn btn-secondary" disabled>Layouts</button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Cose" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.fcose(data.nodes.length))'><i class="fa-solid fa-share-alt"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Circle" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.circle())'><i class="fa-solid fa-circle"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Grid" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.grid())'><i class="fa-solid fa-th"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Concentric" class="btn btn-secondary" onclick='$_network.fitAnimated(cy,$_network.layouts.concentric(data.nodes.length))'><i class="fa-solid fa-sun"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Cose" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.fcose(data.nodes.length))'><i class="fa-solid fa-share-alt"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Circle" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.circle())'><i class="fa-solid fa-circle"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Grid" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.grid())'><i class="fa-solid fa-th"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Concentric" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.concentric(data.nodes.length))'><i class="fa-solid fa-sun"></i></button>
</div>
</div>
</div>
Expand Down Expand Up @@ -67,13 +67,7 @@ <h2 class="accordion-header">
<td>{{ $client.Index }}</td>
<td>
<svg class="client-node-icon" data-jdenticon-value="{{ $client.PeerID }}"></svg>
<span
id="clientRow-{{ $client.Name }}"
style="cursor:pointer;"
onclick="$_network.isolateNode(cy, '{{ $client.PeerID}}');
$('.collapse.peerInfo').collapse('hide');
$('#peerInfo-{{ $client.PeerID }}').collapse('show');
">
<span id="clientRow-{{ $client.Name }}" style="cursor:pointer;" class="client-row" data-peerid="{{ $client.PeerID}}">
<a href="#name={{ $client.Name }}">{{ $client.Name }}</a>
</span>
</td>
Expand Down Expand Up @@ -279,9 +273,35 @@ <h2 class="accordion-header">
<script src="/js/vendor/cytoscape-fcose.js"></script>
<script src="/js/cytoscape-network-aux.js"></script>
<script type="text/javascript">
var container = document.getElementById("nodemap");
var data = {{ .PeerMap }};
var cy = $_network.create(container, data);
var peerGraphData = {{ .PeerMap }};
var peerGraph, peerGraphRendered = false;

function renderPeerGraph() {
var container = document.getElementById("nodemap");
peerGraph = $_network.create(container, peerGraphData);
}

if(peerGraphData.nodes.filter(function(node) { return node.group == "internal" }).length <= 100) {
$('#peerGraph').addClass('show');
$('#peerGraphToggler').removeClass('collapsed');
renderPeerGraph();
} else {
$('#peerGraph').on('shown.bs.collapse', function () {
if(peerGraphRendered) return;
renderPeerGraph();
peerGraphRendered = true;
});
}

$('.client-row').on('click', function() {
var peerId = $(this).data('peerid');
if(peerGraph) {
$_network.isolateNode(peerGraph, peerId);
}
$('.collapse.peerInfo').collapse('hide');
$('#peerInfo-' + peerId).collapse('show');
});

</script>
{{ end }}
{{ define "css" }}
Expand Down
Loading

0 comments on commit 7909de3

Please sign in to comment.