Update statsjs.tpl to js.tpl
This commit is contained in:
parent
6eb74aa57d
commit
418e0bd89d
30
public/templates/mpos/statistics/js.tpl
Normal file
30
public/templates/mpos/statistics/js.tpl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<script>
|
||||||
|
{literal}
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
// Ajax API URL
|
||||||
|
var url = "{/literal}{$smarty.server.PHP_SELF}?page=api&action=getnavbardata{literal}";
|
||||||
|
|
||||||
|
function refreshStaticData(data) {
|
||||||
|
$('#b-workers').html((parseFloat(data.getnavbardata.data.pool.workers).toFixed(0)));
|
||||||
|
$('#b-hashrate').html((parseFloat(data.getnavbardata.data.pool.hashrate).toFixed(3)));
|
||||||
|
$('#b-target').html(data.getnavbardata.data.pool.estimated + " (done: " + data.getnavbardata.data.pool.progress + "%)");
|
||||||
|
$('#b-diff').html(data.getnavbardata.data.network.difficulty);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Our worker process to keep gauges and graph updated
|
||||||
|
(function worker() {
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(data) {
|
||||||
|
refreshStaticData(data);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
setTimeout(worker, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"10000"}{literal})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
});
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
{include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true}
|
{include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true}
|
||||||
|
|
||||||
{include file="statistics/statsjs.tpl"}
|
{include file="statistics/js.tpl"}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user