Browse Source

display client version

master
toyg 11 years ago
parent
commit
45baf81c48
  1. 7
      network.html
  2. 6
      twister_network.js

7
network.html

@ -80,17 +80,20 @@ @@ -80,17 +80,20 @@
<li>
<span class="network-status highlight connection-status">Updating status...</span>
</li>
<li>
<label>Client Version: </label>
<span class="version">00.00.00.00</label>
</ul>
<h3> Detailed information </h3>
<ul>
<li class="connections">
<label>Connections: </label>
<span class="connection-count">1</span>
<span class="connection-count">0</span>
</li>
<li>
<label>Known peers: </label>
<span class="known-peers">6</span>
<span class="known-peers">0</span>
</li>
<li>
<label>Active DHT nodes: </label>

6
twister_network.js

@ -20,11 +20,17 @@ function requestNetInfo(cbFunc, cbArg) { @@ -20,11 +20,17 @@ function requestNetInfo(cbFunc, cbArg) {
twisterdAddrman = ret.addrman_total;
twisterdBlocks = ret.blocks;
twisterDhtNodes = ret.dht_nodes;
twisterVersion = ("0000000" + ret.version).slice(-8);
twisterDisplayVersion = twisterVersion.slice(0,2) + '.' +
twisterVersion.slice(2,4) + '.' +
twisterVersion.slice(4,6) + '.' +
twisterVersion.slice(6,8);
$(".connection-count").text(twisterdConnections);
$(".known-peers").text(twisterdAddrman);
$(".blocks").text(twisterdBlocks);
$(".dht-nodes").text(twisterDhtNodes);
$(".version").text(twisterDisplayVersion);
if( !twisterdConnections ) {
$.MAL.setNetworkStatusMsg("Connection lost.", false);

Loading…
Cancel
Save