[ADDED] Worker information
This commit is contained in:
parent
9b95c95ac7
commit
73db2cf7c5
@ -36,16 +36,16 @@
|
||||
</tr>
|
||||
</table>
|
||||
{if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API}
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Worker</th>
|
||||
<th>Hashrate</th>
|
||||
<th style="padding-right: 10px;">Difficulty</th>
|
||||
<th>Difficulty</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="b-workers">
|
||||
<td colspan="3">No worker information available</td>
|
||||
<td colspan="3" class="text-center">No worker information available</td>
|
||||
</tbody>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -65,6 +65,7 @@ $(document).ready(function(){
|
||||
$('#b-poolworkers').html(data.getdashboarddata.data.pool.workers);
|
||||
$('#b-hashrate').html((parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2)));
|
||||
$('#b-poolhashrate').html((parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2)));
|
||||
$('#b-nethashrate').html((parseFloat(data.getdashboarddata.data.network.hashrate).toFixed(2)));
|
||||
$('#b-sharerate').html((parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2)));
|
||||
$('#b-yvalid').html(number_format(data.getdashboarddata.data.personal.shares.valid));
|
||||
$('#b-yivalid').html(number_format(data.getdashboarddata.data.personal.shares.invalid));
|
||||
@ -98,6 +99,20 @@ $(document).ready(function(){
|
||||
{/literal}{/if}{literal}
|
||||
}
|
||||
|
||||
// Refresh worker information
|
||||
function refreshWorkerData(data) {
|
||||
workers = data.getuserworkers.data;
|
||||
length = workers.length;
|
||||
$('#b-workers').html('');
|
||||
for (var i = j = 0; i < length; i++) {
|
||||
if (workers[i].hashrate > 0) {
|
||||
j++;
|
||||
$('#b-workers').append('<tr><td>' + workers[i].username + '</td><td class="text-right">' + workers[i].hashrate + '</td><td class="text-right">' + workers[i].difficulty + '</td></tr>');
|
||||
}
|
||||
}
|
||||
if (j == 0) { $('#b-workers').html('<tr><td colspan="3" class="text-center">No active workers</td></tr>'); }
|
||||
}
|
||||
|
||||
// Our worker process to keep gauges and graph updated
|
||||
(function worker1() {
|
||||
$.ajax({
|
||||
@ -115,6 +130,22 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
(function worker2() {
|
||||
$.ajax({
|
||||
url: url_worker,
|
||||
dataType: 'json',
|
||||
cache : false,
|
||||
contentType : 'application/json; charset=utf-8',
|
||||
type : 'GET',
|
||||
success: function(data) {
|
||||
refreshWorkerData(data);
|
||||
},
|
||||
complete: function() {
|
||||
setTimeout(worker2, {/literal}{($GLOBAL.config.statistics_ajax_long_refresh_interval * 1000)|default:"10000"}{literal})
|
||||
}
|
||||
});
|
||||
})();
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
<li class="bg-default">
|
||||
<div class="sparklines-stats-showcase">
|
||||
<span>Pool Workers</span>
|
||||
<h2 id="b-poolhashrate">{$GLOBAL.workers}</h2>
|
||||
<h2 id="b-poolworkers">{$GLOBAL.workers}</h2>
|
||||
</div>
|
||||
<div class="pool-workers-bar chart"></div>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user