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:
parent
7bfe59d938
commit
712bfc1e3e
@ -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() {
|
||||
|
12
network.html
12
network.html
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user