[IMPROVED] Show static nav hashrate if live off
Fixes #1362 once merged.
This commit is contained in:
parent
e2d763e04d
commit
9526cf0093
@ -92,7 +92,6 @@
|
||||
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
|
||||
<br />
|
||||
{else}
|
||||
{if !$GLOBAL.website.api.disabled && !$GLOBAL.config.disable_navbar && !$GLOBAL.config.disable_navbar_api}
|
||||
<ul>
|
||||
<center>
|
||||
<div style="display: inline-block;">
|
||||
@ -102,7 +101,10 @@
|
||||
</div>
|
||||
</center>
|
||||
</ul>
|
||||
<hr/>
|
||||
{include file="global/navjs.tpl"}
|
||||
<hr/>
|
||||
{if !$GLOBAL.website.api.disabled && !$GLOBAL.config.disable_navbar && !$GLOBAL.config.disable_navbar_api}
|
||||
{include file="global/navjs_api.tpl"}
|
||||
{else}
|
||||
{include file="global/navjs_static.tpl"}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@ -6,10 +6,6 @@ $(document).ready(function(){
|
||||
// Ajax API URL
|
||||
var url = "{/literal}{$smarty.server.PHP_SELF}?page=api&action=getnavbardata{literal}";
|
||||
|
||||
// Store our data globally
|
||||
var storedHashrate=[];
|
||||
var storedWorkers=[];
|
||||
|
||||
g1 = new JustGage({
|
||||
id: "mr",
|
||||
value: parseFloat({/literal}{$GLOBAL.workers}{literal}).toFixed(0),
|
||||
@ -46,16 +42,10 @@ $(document).ready(function(){
|
||||
shadowVerticalOffset : 10
|
||||
});
|
||||
|
||||
{/literal}{if $GLOBAL.config.disable_navbar|default:"0" != 1 && $GLOBAL.config.disable_navbar_api|default:"0" != 1}{literal}
|
||||
// Helper to refresh graphs
|
||||
function refreshInformation(data) {
|
||||
g1.refresh(parseFloat(data.getnavbardata.data.pool.workers).toFixed(0));
|
||||
g2.refresh(parseFloat(data.getnavbardata.data.pool.hashrate).toFixed(2));
|
||||
if (storedWorkers.length > 20) { storedWorkers.shift(); }
|
||||
if (storedHashrate.length > 20) { storedHashrate.shift(); }
|
||||
timeNow = new Date().getTime();
|
||||
storedWorkers[storedWorkers.length] = [timeNow, data.getnavbardata.data.raw.pool.workers];
|
||||
storedHashrate[storedHashrate.length] = [timeNow, data.getnavbardata.data.raw.pool.hashrate];
|
||||
}
|
||||
|
||||
// Our worker process to keep gauges and graph updated
|
||||
@ -70,7 +60,6 @@ $(document).ready(function(){
|
||||
setTimeout(worker, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"1000"}{literal})
|
||||
}
|
||||
});
|
||||
{/literal}{/if}{literal}
|
||||
})();
|
||||
});
|
||||
{/literal}
|
||||
42
public/templates/mpos/global/navjs_static.tpl
Normal file
42
public/templates/mpos/global/navjs_static.tpl
Normal file
@ -0,0 +1,42 @@
|
||||
<script>
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
var g1, g2;
|
||||
g1 = new JustGage({
|
||||
id: "mr",
|
||||
value: parseFloat({/literal}{$GLOBAL.workers}{literal}).toFixed(0),
|
||||
min: 0,
|
||||
max: Math.round({/literal}{$GLOBAL.workers}{literal} * 2),
|
||||
title: "Miners",
|
||||
gaugeColor: '#6f7a8a',
|
||||
labelFontColor: '#555',
|
||||
titleFontColor: '#555',
|
||||
valueFontColor: '#555',
|
||||
label: "Active Miners",
|
||||
relativeGaugeSize: true,
|
||||
showMinMax: true,
|
||||
shadowOpacity : 0.8,
|
||||
shadowSize : 0,
|
||||
shadowVerticalOffset : 10
|
||||
});
|
||||
|
||||
g2 = new JustGage({
|
||||
id: "hr",
|
||||
value: parseFloat({/literal}{$GLOBAL.hashrate}{literal}).toFixed(2),
|
||||
min: 0,
|
||||
max: Math.round({/literal}{$GLOBAL.hashrate}{literal} * 2),
|
||||
title: "Pool Hashrate",
|
||||
gaugeColor: '#6f7a8a',
|
||||
labelFontColor: '#555',
|
||||
titleFontColor: '#555',
|
||||
valueFontColor: '#555',
|
||||
label: "{/literal}{$GLOBAL.hashunits.pool}{literal}",
|
||||
relativeGaugeSize: true,
|
||||
showMinMax: true,
|
||||
shadowOpacity : 0.8,
|
||||
shadowSize : 0,
|
||||
shadowVerticalOffset : 10
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user