From 712bfc1e3ee7aa3edb8906567798c91ce6b8a5db Mon Sep 17 00:00:00 2001 From: twisterarmy Date: Tue, 11 Jun 2024 13:05:28 +0300 Subject: [PATCH] implement connection info --- css/style.css | 1 + js/twister_network.js | 37 ++++++++++++++++++++++++++++++++ network.html | 12 +++++++++++ theme_nin/css/style.css | 1 + theme_nin_night/css/style.css | 1 + theme_nin_original/css/style.css | 1 + 6 files changed, 53 insertions(+) diff --git a/css/style.css b/css/style.css index 0f4ad24..1c7ba43 100644 --- a/css/style.css +++ b/css/style.css @@ -71,6 +71,7 @@ table { border-collapse: collapse; border-spacing: 0; + width: 100%; } html, body { diff --git a/js/twister_network.js b/js/twister_network.js index 5f2200d..4aa27ff 100644 --- a/js/twister_network.js +++ b/js/twister_network.js @@ -92,6 +92,43 @@ function requestNetInfo(cbFunc, cbArg) { function(args, ret) { console.log("Error connecting to local twister daemon."); }, {}); + + twisterRpc("getpeerinfo", [], + function(args, ret) { + + let connections = $(".connections > table > tbody"); + + connections.html(''); + + $.each(ret, function() { + connections.append( + $('').append( + $('').text( + this.addr + ) + ).append( + $('').text( + this.subver + ) + ).append( + $('').text( + this.startingheight + ) + ).append( + $('').text( + this.bytessent / 1000 + ) + ).append( + $('').text( + this.bytesrecv / 1000 + ) + ) + ); + }); + }, {cbFunc:cbFunc, cbArg:cbArg}, + function(args, ret) { + console.log("Error connecting to local twister daemon."); + }, {}); } function peerKeypress() { diff --git a/network.html b/network.html index 92ae3e6..2918d17 100644 --- a/network.html +++ b/network.html @@ -81,6 +81,18 @@
  • 0 + + + + + + + + + + + +
    AddressVersionHeightSent, KBReceived, KB
  • diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 6e17e66..17a87f9 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -244,6 +244,7 @@ ol, ul { table { border-collapse: collapse; border-spacing: 0; + width: 100%; } /* line 28, ../../../../../../var/lib/gems/2.1.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ diff --git a/theme_nin_night/css/style.css b/theme_nin_night/css/style.css index adaef02..52865e0 100644 --- a/theme_nin_night/css/style.css +++ b/theme_nin_night/css/style.css @@ -244,6 +244,7 @@ ol, ul { table { border-collapse: collapse; border-spacing: 0; + width: 100%; } /* line 28, ../../../../../../var/lib/gems/2.1.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ diff --git a/theme_nin_original/css/style.css b/theme_nin_original/css/style.css index b2c402f..32fac87 100644 --- a/theme_nin_original/css/style.css +++ b/theme_nin_original/css/style.css @@ -31,6 +31,7 @@ ol, ul { table { border-collapse: collapse; border-spacing: 0; + width: 100%; } caption, th, td {