mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-11 21:11:02 +00:00
implement connection info
This commit is contained in:
parent
7bfe59d938
commit
712bfc1e3e
@ -71,6 +71,7 @@ table
|
|||||||
{
|
{
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
html, body
|
html, body
|
||||||
{
|
{
|
||||||
|
@ -92,6 +92,43 @@ function requestNetInfo(cbFunc, cbArg) {
|
|||||||
function(args, ret) {
|
function(args, ret) {
|
||||||
console.log("Error connecting to local twister daemon.");
|
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() {
|
function peerKeypress() {
|
||||||
|
12
network.html
12
network.html
@ -81,6 +81,18 @@
|
|||||||
<li class="connections">
|
<li class="connections">
|
||||||
<label>Connections: </label>
|
<label>Connections: </label>
|
||||||
<span class="connection-count">0</span>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
<label>Known peers: </label>
|
<label>Known peers: </label>
|
||||||
|
@ -244,6 +244,7 @@ ol, ul {
|
|||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* line 28, ../../../../../../var/lib/gems/2.1.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
/* 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 {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* line 28, ../../../../../../var/lib/gems/2.1.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
/* 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 {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
caption, th, td {
|
caption, th, td {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user