[MERGE] Fixed merge conflict
This commit is contained in:
commit
217f4a7993
@ -278,6 +278,20 @@ $aSettings['system'][] = array(
|
||||
'name' => 'disable_about', 'value' => $setting->getValue('disable_about'),
|
||||
'tooltip' => 'Showing About page in Navigation.'
|
||||
);
|
||||
$aSettings['system'][] = array(
|
||||
'display' => 'Disable Live Dashboard', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes'),
|
||||
'default' => 0,
|
||||
'name' => 'disable_dashboard', 'value' => $setting->getValue('disable_dashboard'),
|
||||
'tooltip' => 'Disable live updates on the dashboard to reduce server load.'
|
||||
);
|
||||
$aSettings['system'][] = array(
|
||||
'display' => 'Disable Dashboard API', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes'),
|
||||
'default' => 0,
|
||||
'name' => 'disable_dashboard_api', 'value' => $setting->getValue('disable_dashboard_api'),
|
||||
'tooltip' => 'Disable dashboard API entirely to reduce server load.'
|
||||
);
|
||||
$aSettings['recaptcha'][] = array(
|
||||
'display' => 'Enable re-Captcha', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes' ),
|
||||
|
||||
@ -3,6 +3,12 @@
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
// Check if the system is enabled
|
||||
if ($setting->getValue('disable_dashboard_api')) {
|
||||
echo $api->get_json(array('error' => 'disabled'));
|
||||
die();
|
||||
}
|
||||
|
||||
// System load check
|
||||
if ($load = @sys_getloadavg()) {
|
||||
if (isset($config['system']['load']['max']) && $load[0] > $config['system']['load']['max']) {
|
||||
@ -11,6 +17,9 @@ if ($load = @sys_getloadavg()) {
|
||||
}
|
||||
}
|
||||
|
||||
// Supress master template
|
||||
$supress_master = 1;
|
||||
|
||||
// Check user token and access level permissions
|
||||
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
|
||||
|
||||
@ -116,8 +125,6 @@ $data = array(
|
||||
'system' => array( 'load' => sys_getloadavg() ),
|
||||
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ),
|
||||
);
|
||||
echo $api->get_json($data);
|
||||
|
||||
// Supress master template
|
||||
$supress_master = 1;
|
||||
echo $api->get_json($data);
|
||||
?>
|
||||
|
||||
@ -10,14 +10,24 @@ if ($user->isAuthenticated()) {
|
||||
$dDifficulty = 1;
|
||||
$aRoundShares = 1;
|
||||
|
||||
// Only run these if the user is logged in
|
||||
$aRoundShares = $statistics->getRoundShares();
|
||||
$dDifficulty = 1;
|
||||
$dNetworkHashrate = 1;
|
||||
$iBlock = 0;
|
||||
if ($bitcoin->can_connect() === true) {
|
||||
$dDifficulty = $bitcoin->getdifficulty();
|
||||
$dNetworkHashrate = $bitcoin->getnetworkhashps();
|
||||
$iBlock = $bitcoin->getblockcount();
|
||||
}
|
||||
|
||||
// Fetch some data
|
||||
// Round progress
|
||||
$iEstShares = $statistics->getEstimatedShares($dDifficulty);
|
||||
if ($iEstShares > 0 && $aRoundShares['valid'] > 0) {
|
||||
$dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2);
|
||||
} else {
|
||||
$dEstPercent = 0;
|
||||
}
|
||||
if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0;
|
||||
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();
|
||||
$iCurrentPoolShareRate = $statistics->getCurrentShareRate();
|
||||
@ -26,6 +36,10 @@ if ($user->isAuthenticated()) {
|
||||
if ($iCurrentPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $iCurrentPoolHashrate;
|
||||
|
||||
// Make it available in Smarty
|
||||
$smarty->assign('DISABLED_DASHBOARD', $setting->getValue('disable_dashboard'));
|
||||
$smarty->assign('DISABLED_DASHBOARD_API', $setting->getValue('disable_dashboard_api'));
|
||||
$smarty->assign('ESTIMATES', array('shares' => $iEstShares, 'percent' => $dEstPercent));
|
||||
$smarty->assign('NETWORK', array('difficulty' => $dDifficulty, 'block' => $iBlock));
|
||||
$smarty->assign('INTERVAL', $interval / 60);
|
||||
$smarty->assign('CONTENT', 'default.tpl');
|
||||
}
|
||||
|
||||
@ -24,13 +24,14 @@
|
||||
</thead>
|
||||
<tr>
|
||||
<td align="left" style="font-weight: bold;">Confirmed</td>
|
||||
<td align="right"><span id="b-confirmed" class="confirmed" style="width: calc(80px); font-size: 12px;"></span></td>
|
||||
<td align="right"><span id="b-confirmed" class="confirmed" style="width: calc(80px); font-size: 12px;">{$GLOBAL.userdata.balance.confirmed}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-weight: bold;">Unconfirmed</td>
|
||||
<td align="right"><span id="b-unconfirmed" class="unconfirmed" style="width: calc(80px); font-size: 12px;"></span></td>
|
||||
<td align="right"><span id="b-unconfirmed" class="unconfirmed" style="width: calc(80px); font-size: 12px;">{$GLOBAL.userdata.balance.unconfirmed}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
{if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API}
|
||||
<table class="tablesorter" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -40,8 +41,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="b-workers">
|
||||
<td colspan="3" align="center">Loading worker information</td>
|
||||
<td colspan="3" align="center">No worker information available</td>
|
||||
</tbody>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
</article>
|
||||
|
||||
@ -3,5 +3,9 @@
|
||||
{include file="dashboard/system_stats.tpl"}
|
||||
{include file="dashboard/round_data.tpl"}
|
||||
{include file="dashboard/account_data.tpl"}
|
||||
{include file="dashboard/js.tpl"}
|
||||
{if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API}
|
||||
{include file="dashboard/js_api.tpl"}
|
||||
{else}
|
||||
{include file="dashboard/js_static.tpl"}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
62
public/templates/mpos/dashboard/js_static.tpl
Normal file
62
public/templates/mpos/dashboard/js_static.tpl
Normal file
@ -0,0 +1,62 @@
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.json2.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.dateAxisRenderer.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.highlighter.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.canvasTextRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.trendline.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.enhancedLegendRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.canvasTextRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.categoryAxisRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.barRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/plugins/jqplot.pointLabels.js"></script>
|
||||
|
||||
<script>
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
var g1, g2, g3, g4, g5;
|
||||
|
||||
var jqPlotShareinfoOptions = {
|
||||
title: 'Shares',
|
||||
highlighter: { show: false },
|
||||
grid: { drawBorder: false, background: '#fbfbfb', shadow: false },
|
||||
seriesColors: [ '#26a4ed', '#ee8310', '#e9e744' ],
|
||||
seriesDefaults: {
|
||||
pointLabels: { show: true },
|
||||
renderer: $.jqplot.BarRenderer,
|
||||
shadowAngle: 135,
|
||||
rendererOptions: {
|
||||
barWidth: 5,
|
||||
barDirection: 'horizontal'
|
||||
},
|
||||
trendline: { show: false },
|
||||
},
|
||||
axesDefaults: {
|
||||
autoscale: true,
|
||||
tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
|
||||
},
|
||||
series: [
|
||||
{label: 'Own', }, {label: 'Pool'}
|
||||
],
|
||||
legend: { show: true, location: 'ne', renderer: $.jqplot.EnhancedLegendRenderer, rendererOptions: { seriesToggleReplot: { resetAxes: true } } },
|
||||
axes: {
|
||||
yaxis: { tickOptions: { angle: -90 }, ticks: [ 'valid', 'invalid' ], renderer: $.jqplot.CategoryAxisRenderer },
|
||||
xaxis: { tickOptions: { angle: -17 }, pointLabels: { show: true } }
|
||||
}
|
||||
};
|
||||
|
||||
// Init shares graph
|
||||
var plot2 = $.jqplot('shareinfograph', [[{/literal}{$GLOBAL.userdata.shares.valid}{literal},{/literal}{$GLOBAL.userdata.shares.invalid}{literal}],[{/literal}{$GLOBAL.roundshares.valid}{literal},{/literal}{$GLOBAL.roundshares.invalid}{literal}]], jqPlotShareinfoOptions);
|
||||
|
||||
g1 = new JustGage({id: "nethashrate", value: parseFloat({/literal}{$GLOBAL.nethashrate}{literal}).toFixed(2), min: 0, max: Math.round({/literal}{$GLOBAL.nethashrate}{literal} * 2), title: "Net Hashrate", gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, label: "{/literal}{$GLOBAL.hashunits.network}{literal}"});
|
||||
g2 = new JustGage({id: "poolhashrate", value: parseFloat({/literal}{$GLOBAL.hashrate}{literal}).toFixed(2), min: 0, max: Math.round({/literal}{$GLOBAL.hashrate}{literal}* 2), title: "Pool Hashrate", gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, label: "{/literal}{$GLOBAL.hashunits.pool}{literal}"});
|
||||
g3 = new JustGage({id: "hashrate", value: parseFloat({/literal}{$GLOBAL.userdata.hashrate}{literal}).toFixed(2), min: 0, max: Math.round({/literal}{$GLOBAL.userdata.hashrate}{literal} * 2), title: "Hashrate", gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, label: "{/literal}{$GLOBAL.hashunits.personal}{literal}"});
|
||||
if ({/literal}{$GLOBAL.userdata.sharerate}{literal} > 1) {
|
||||
initSharerate = {/literal}{$GLOBAL.userdata.sharerate}{literal} * 2
|
||||
} else {
|
||||
initSharerate = 1
|
||||
}
|
||||
g4 = new JustGage({id: "sharerate", value: parseFloat({/literal}{$GLOBAL.userdata.sharerate}{literal}).toFixed(2), min: 0, max: Math.round(initSharerate), gaugeColor: '#6f7a8a', valueFontColor: '#555', shadowOpacity : 0.8, shadowSize : 0, shadowVerticalOffset : 10, title: "Sharerate", label: "shares/s"});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
@ -3,9 +3,9 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Difficulty</b></td>
|
||||
<td id="b-diff" class="right"></td>
|
||||
<td id="b-diff" class="right">{$NETWORK.difficulty}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Current Block</b></td>
|
||||
<td id="b-nblock" class="right"></td>
|
||||
<td id="b-nblock" class="right">{$NETWORK.block}</td>
|
||||
</tr>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<article class="module module width_3_quarter">
|
||||
<header><h3>Overview {if $GLOBAL.config.price.currency}{$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: <span id="b-price"></span>{/if} / Pool Workers: <span id="b-dworkers"></span></h3></header>
|
||||
<header><h3>Overview {if $GLOBAL.config.price.currency}{$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: <span id="b-price">{$GLOBAL.price}</span>{/if} / Pool Workers: <span id="b-dworkers">{$GLOBAL.workers}</span></h3></header>
|
||||
<div class="module_content">
|
||||
<center>
|
||||
<div style="display: inline-block;">
|
||||
@ -14,9 +14,11 @@
|
||||
<div id="querytime" style="width:120px; height:90px;"></div>
|
||||
</div>
|
||||
</center>
|
||||
{if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API}
|
||||
<div style="margin-left: 16px; display: inline-block; width: 100%;">
|
||||
<div id="hashrategraph" style="height: 160px; width: 100%;"></div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<footer>
|
||||
<p style="margin-left: 25px">Refresh interval: {$GLOBAL.config.statistics_ajax_refresh_interval|default:"10"} seconds. Hashrate based on shares submitted in the past {$INTERVAL|default:"5"} minutes.</p>
|
||||
|
||||
@ -5,19 +5,19 @@
|
||||
{if $GLOBAL.config.payout_system != 'pps'}
|
||||
<tr>
|
||||
<td><b>Block</b></td>
|
||||
<td id="b-block" class="right"></td>
|
||||
<td id="b-block" class="right">{$GLOBAL.userdata.estimates.block}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Fees</b></td>
|
||||
<td id="b-fee" class="right"></td>
|
||||
<td id="b-fee" class="right">{$GLOBAL.userdata.estimates.fee}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Donation</b></td>
|
||||
<td id="b-donation" class="right"></td>
|
||||
<td id="b-donation" class="right">{$GLOBAL.userdata.estimates.donation}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Payout</b></td>
|
||||
<td id="b-payout" class="right"></td>
|
||||
<td id="b-payout" class="right">{$GLOBAL.userdata.estimates.payout}</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr>
|
||||
|
||||
@ -3,21 +3,21 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Est. Shares</b></td>
|
||||
<td id="b-target" class="right"></td>
|
||||
<td id="b-target" class="right">{$ESTIMATES.shares} (done: {$ESTIMATES.percent}%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Pool Valid</b></td>
|
||||
<td id="b-pvalid" class="right"></td>
|
||||
<td id="b-pvalid" class="right">{$GLOBAL.roundshares.valid}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Your Valid<b></td>
|
||||
<td id="b-yvalid" class="right"></td>
|
||||
<td id="b-yvalid" class="right">{$GLOBAL.userdata.shares.valid}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Pool Invalid</b></td>
|
||||
<td id="b-pivalid" class="right"></td>
|
||||
<td id="b-pivalid" class="right">{$GLOBAL.roundshares.invalid}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Your Invalid</b></td>
|
||||
<td id="b-yivalid" class="right"></td>
|
||||
<td id="b-yivalid" class="right">{$GLOBAL.userdata.shares.invalid}</td>
|
||||
</tr>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
{if $GLOBAL.config.payout_system == 'pplns'}
|
||||
<tr>
|
||||
<td><b>PPLNS Target</b></td>
|
||||
<td id="b-pplns" class="right"></td>
|
||||
<td id="b-pplns" class="right">{$GLOBAL.pplns.target}</td>
|
||||
</tr>
|
||||
{elseif $GLOBAL.config.payout_system == 'pps'}
|
||||
<tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user