mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-11 21:11:02 +00:00
Merge pull request #40 from BlockTester/master
A little bit more mining information
This commit is contained in:
commit
03e77ec3c9
@ -624,7 +624,8 @@ button.disabled:hover
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.twister-user-name
|
||||
.twister-user-name,
|
||||
.twister-by-user-name
|
||||
{
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
|
@ -174,7 +174,9 @@
|
||||
<span class="twister-user-tag"></span>
|
||||
</a>
|
||||
<div class="followers">Followed by
|
||||
<span class="followed-by"></span>
|
||||
<a href="#" class="twister-by-user-name open-profile-modal">
|
||||
<span class="followed-by"></span>
|
||||
</a>
|
||||
</div>
|
||||
<a class="twister-user-remove">×</a>
|
||||
<button class="follow">Follow</button>
|
||||
|
13
network.html
13
network.html
@ -121,7 +121,12 @@
|
||||
<label>Time of the last block:</label>
|
||||
<span class="last-block-time">Fri Nov 08 2013 08:32:48 </span>
|
||||
</li>
|
||||
<li>
|
||||
<label> Mining difficulty: </label>
|
||||
<span class="mining-difficulty">0.0</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<h2>Configure block generation</h2>
|
||||
@ -155,6 +160,14 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3> Block generation status</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<label> Current hash rate: </label>
|
||||
<span class="mining-hashrate">0</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -332,6 +332,7 @@ function processSuggestion(arg, suggestion, followedBy) {
|
||||
item.find(".twister-user-info").attr("data-screen-name", suggestion);
|
||||
|
||||
item.find(".twister-user-name").attr("href", $.MAL.userUrl(suggestion));
|
||||
item.find(".twister-by-user-name").attr("href", $.MAL.userUrl(followedBy));
|
||||
item.find(".twister-user-tag").text("@" + suggestion);
|
||||
|
||||
getAvatar(suggestion,item.find(".twister-user-photo"));
|
||||
|
@ -143,6 +143,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() {
|
||||
twisterRpc("getgenerate", [],
|
||||
function(args, ret) {
|
||||
@ -222,6 +248,10 @@ function initInterfaceNetwork() {
|
||||
});
|
||||
networkUpdate();
|
||||
setInterval("networkUpdate()", 2000);
|
||||
|
||||
miningUpdate();
|
||||
setInterval("miningUpdate()", 2000);
|
||||
|
||||
getGenerate();
|
||||
|
||||
interfaceNetworkHandlers();
|
||||
|
Loading…
x
Reference in New Issue
Block a user