Browse Source

Merge pull request #39 from toyg/display_core_version

display client version
master
miguelfreitas 11 years ago
parent
commit
2b50b6c933
  1. 7
      network.html
  2. 6
      twister_network.js

7
network.html

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

6
twister_network.js

@ -20,11 +20,17 @@ function requestNetInfo(cbFunc, cbArg) {
twisterdAddrman = ret.addrman_total; twisterdAddrman = ret.addrman_total;
twisterdBlocks = ret.blocks; twisterdBlocks = ret.blocks;
twisterDhtNodes = ret.dht_nodes; 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); $(".connection-count").text(twisterdConnections);
$(".known-peers").text(twisterdAddrman); $(".known-peers").text(twisterdAddrman);
$(".blocks").text(twisterdBlocks); $(".blocks").text(twisterdBlocks);
$(".dht-nodes").text(twisterDhtNodes); $(".dht-nodes").text(twisterDhtNodes);
$(".version").text(twisterDisplayVersion);
if( !twisterdConnections ) { if( !twisterdConnections ) {
$.MAL.setNetworkStatusMsg("Connection lost.", false); $.MAL.setNetworkStatusMsg("Connection lost.", false);

Loading…
Cancel
Save