mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-02-09 21:44:15 +00:00
Added mining hashrate and difficulty to status to the UI
This commit is contained in:
parent
6874e006c3
commit
049e4ddab6
16
network.html
16
network.html
@ -154,6 +154,22 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2>Block generation status</h2>
|
||||||
|
|
||||||
|
<div class="module">
|
||||||
|
<h3> General information</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label> Mining difficulty: </label>
|
||||||
|
<span class="muning-difficulty">0.0</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label> Current hash rate: </label>
|
||||||
|
<span class="muning-hashrate">0</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -137,6 +137,32 @@ function networkUpdate(cbFunc, cbArg) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMiningInfo(cbFunc, cbArg) {
|
||||||
|
twisterRpc("getmininginfo", [],
|
||||||
|
function(args, ret) {
|
||||||
|
miningDifficulty = ret.difficulty;
|
||||||
|
miningHashRate = ret.hashespersec;
|
||||||
|
|
||||||
|
$(".mining-difficulty").text(miningDifficulty);
|
||||||
|
$(".mining-hashrate").text(miningHashRate);
|
||||||
|
/*
|
||||||
|
if( !twisterdConnections ) {
|
||||||
|
$.MAL.setNetworkStatusMsg("Connection lost.", false);
|
||||||
|
twisterdConnectedAndUptodate = false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if( args.cbFunc )
|
||||||
|
args.cbFunc(args.cbArg);
|
||||||
|
}, {cbFunc:cbFunc, cbArg:cbArg},
|
||||||
|
function(args, ret) {
|
||||||
|
console.log("Error connecting to local twister daemon.");
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
function miningUpdate(cbFunc, cbArg) {
|
||||||
|
getMiningInfo(cbFunc, cbArg);
|
||||||
|
}
|
||||||
|
|
||||||
function getGenerate() {
|
function getGenerate() {
|
||||||
twisterRpc("getgenerate", [],
|
twisterRpc("getgenerate", [],
|
||||||
function(args, ret) {
|
function(args, ret) {
|
||||||
@ -216,6 +242,10 @@ function initInterfaceNetwork() {
|
|||||||
});
|
});
|
||||||
networkUpdate();
|
networkUpdate();
|
||||||
setInterval("networkUpdate()", 2000);
|
setInterval("networkUpdate()", 2000);
|
||||||
|
|
||||||
|
miningUpdate();
|
||||||
|
setInterval("miningUpdate()", 2000);
|
||||||
|
|
||||||
getGenerate();
|
getGenerate();
|
||||||
|
|
||||||
interfaceNetworkHandlers();
|
interfaceNetworkHandlers();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user