1
0
mirror of https://github.com/twisterarmy/twister-html.git synced 2025-03-11 13:01:19 +00:00

implement connection info

This commit is contained in:
twisterarmy 2024-06-11 13:05:28 +03:00
parent 7bfe59d938
commit 712bfc1e3e
6 changed files with 53 additions and 0 deletions
css
js
network.html
theme_nin/css
theme_nin_night/css
theme_nin_original/css

@ -71,6 +71,7 @@ table
{
border-collapse: collapse;
border-spacing: 0;
width: 100%;
}
html, body
{

@ -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(
$('<tr/>').append(
$('<td/>').text(
this.addr
)
).append(
$('<td/>').text(
this.subver
)
).append(
$('<td/>').text(
this.startingheight
)
).append(
$('<td/>').text(
this.bytessent / 1000
)
).append(
$('<td/>').text(
this.bytesrecv / 1000
)
)
);
});
}, {cbFunc:cbFunc, cbArg:cbArg},
function(args, ret) {
console.log("Error connecting to local twister daemon.");
}, {});
}
function peerKeypress() {

@ -81,6 +81,18 @@
<li class="connections">
<label>Connections: </label>
<span class="connection-count">0</span>
<table>
<thead>
<tr>
<td>Address</td>
<td>Version</td>
<td>Height</td>
<td>Sent, KB</td>
<td>Received, KB</td>
</tr>
</thead>
<tbody></tbody>
</table>
</li>
<li>
<label>Known peers: </label>

@ -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 */

@ -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 */

@ -31,6 +31,7 @@ ol, ul {
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
}
caption, th, td {