Skip to content

Commit 82e28a0

Browse files
author
Colin Rice
committed
Merge pull request #696 from DavidVorick/master
An inital fix for stats.html
2 parents 3b22d14 + b728b38 commit 82e28a0

2 files changed

Lines changed: 12 additions & 54 deletions

File tree

44 KB
Binary file not shown.

bitHopper/templates/stats.html

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767

6868
return 'white';
6969
}
70+
71+
7072
function numberWithCommas(x) {
7173
return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
7274
}
@@ -299,53 +301,6 @@
299301
return srvhist[srv['name']];
300302
}
301303

302-
function getSlice(payload, srv) {
303-
var name = srv['pool_index'];
304-
if (payload['sliceinfo'] == undefined && srv['slice'] == undefined)
305-
return "-"
306-
if (payload['sliceinfo'] != undefined && payload['sliceinfo'][name] >= 0)
307-
return parseFloat(payload['sliceinfo'][name]).toFixed(0)
308-
else if (srv['slice'] >= 0)
309-
return parseFloat(srv['slice']).toFixed(0)
310-
else
311-
return "-"
312-
}
313-
314-
function getWait(payload, srv) {
315-
if (payload['wait'] == undefined && srv['wait'] == undefined)
316-
return "-"
317-
var wait = 0.0
318-
if (srv['wait'] && srv['wait'] > 0) {
319-
wait = parseFloat(srv['wait']);
320-
}
321-
var wait_html = "<a href='#' onFocus='this.blur();' onClick=\"setWait('"
322-
wait_html = wait_html + srvName + "', " + wait + ");\" style='text-decoration:underline;color:" + getColor(payload,srv) + ";'>"
323-
wait_html = wait_html + wait.toFixed(2) + "</a>";
324-
return wait_html;
325-
}
326-
327-
function getPenalty(payload, srv) {
328-
var penalty = 1.00
329-
if (srv['penalty'] && srv['penalty'] > 0) {
330-
penalty = parseFloat(srv['penalty']);
331-
}
332-
var penalty_html = "<a href='#' onFocus='this.blur();' onClick=\"setPenalty('"
333-
penalty_html = penalty_html + srvName + "', " + penalty + ");\" style='text-decoration:underline;color:" + getColor(payload,srv) + ";'>"
334-
penalty_html = penalty_html + penalty.toFixed(2) + "</a>";
335-
return penalty_html;
336-
}
337-
338-
function getLPPenalty(payload, srv) {
339-
var penalty = 0.00
340-
if (srv['lp_penalty']) {
341-
penalty = parseFloat(srv['lp_penalty']);
342-
}
343-
var penalty_html = "<a href='#' onFocus='this.blur();' onClick=\"setLPPenalty('"
344-
penalty_html = penalty_html + srvName + "', " + penalty + ");\" style='text-decoration:underline;color:" + getColor(payload,srv) + ";'>"
345-
penalty_html = penalty_html + penalty.toFixed(2) + "</a>";
346-
return penalty_html;
347-
}
348-
349304
function getPoolSpeed(payload, srv) {
350305
if (srv['ghash'] > 0) {
351306
if (srv["isSpeedEstimated"] == true) {
@@ -480,6 +435,12 @@
480435
if( !showInfoPools && row_role == "info" ){
481436
continue; //Skip info pools
482437
}
438+
439+
var htmlRepresentationOfShares = columns['Shares']['data'](payload, row, r);
440+
var intRepresentationOfShares = htmlRepresentationOfShares.replace(/[^0-9]/g, '');
441+
if(intRepresentationOfShares == 0 || intRepresentationOfShares > 50000000) {
442+
continue;
443+
}
483444
}
484445

485446
html += "<tr id=\"row_" + i + "\">";
@@ -574,10 +535,6 @@
574535
'Round<br>Time': { 'data':getRoundDuration, 'align':'center'},
575536
'Payout': { 'data':getPayout, 'color':getColor, 'align':'right' },
576537
'Eff.': { 'data':getEfficiency, 'color':getColor, 'align':'center' },
577-
'ThrPnlty': { 'data':getPenalty, 'color':getColor, 'align':'center' },
578-
'LP-Pnlty': { 'data':getLPPenalty, 'color':getColor, 'align':'center' },
579-
'Wait': { 'data':getWait, 'color':getColor, 'align':'center' },
580-
'Slice': { 'data':getSlice, 'color':getColor, 'align':'center', 'display':'' },
581538
'Round Shares': { 'data':getRoundShares, 'type':'linechart', 'width':'100%' },
582539
'Role String': { 'data':getRoleString, 'display':'none' }
583540
},
@@ -596,8 +553,9 @@
596553
);
597554

598555
users = data["user"];
599-
600-
buildTable("#users", users, users,
556+
557+
//buildTable has been commented out because none of the getUserX calls are working and I don't know what is supposed to be happening. Functionality may one day be readded
558+
/*buildTable("#users", users, users,
601559
{
602560
"User": { 'data':getUserName } ,
603561
"Last Seen": { 'data':getUserTime, 'align':'left' },
@@ -610,7 +568,7 @@
610568
function(c,d){
611569
return c > d;
612570
},""
613-
);
571+
);*/
614572

615573
});
616574
}

0 commit comments

Comments
 (0)