[CHANGE] Updated mobile theme
This commit is contained in:
parent
ab1e19bfd4
commit
628dabacb5
12
public/site_assets/mobile/js/justgage.1.0.1.min.js
vendored
Executable file
12
public/site_assets/mobile/js/justgage.1.0.1.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
10
public/site_assets/mobile/js/raphael.2.1.0.min.js
vendored
Executable file
10
public/site_assets/mobile/js/raphael.2.1.0.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<table>
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th align="left">Worker Name</th>
|
||||
<th align="left">Name</th>
|
||||
<th align="center">Active</th>
|
||||
<th align="right">Khash/s</th>
|
||||
<th align="right">Difficulty</th>
|
||||
@ -9,10 +9,13 @@
|
||||
{section worker $WORKERS}
|
||||
{assign var="username" value="."|escape|explode:$WORKERS[worker].username:2}
|
||||
<tr>
|
||||
<td align="left"{if $WORKERS[worker].active} style="color: orange"{/if}>{$username.0|escape}.{$username.1|escape}</td>
|
||||
<td colspan="4" align="left"{if $WORKERS[worker].hashrate > 0} style="color: orange"{/if}>{$username.0|escape}.{$username.1|escape}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td align="center"><img src="{$PATH}/images/{if $WORKERS[worker].hashrate > 0}success{else}error{/if}.gif" /></td>
|
||||
<td align="right">{$WORKERS[worker].hashrate|number_format}</td>
|
||||
<td class="right">{$WORKERS[worker].difficulty|number_format:"2"}</td>
|
||||
<td align="right">{$WORKERS[worker].difficulty|number_format:"2"}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</tbody>
|
||||
|
||||
5
public/templates/mobile/dashboard/default.tpl
Normal file
5
public/templates/mobile/dashboard/default.tpl
Normal file
@ -0,0 +1,5 @@
|
||||
{if $smarty.session.AUTHENTICATED|default}
|
||||
{assign var=payout_system value=$GLOBAL.config.payout_system}
|
||||
{include file="dashboard/overview.tpl"}
|
||||
{include file="dashboard/js.tpl"}
|
||||
{/if}
|
||||
55
public/templates/mobile/dashboard/js.tpl
Normal file
55
public/templates/mobile/dashboard/js.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
<script>
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
var g1, g2, g3, g4, g5;
|
||||
|
||||
// Ajax API URL
|
||||
var url = "{/literal}{$smarty.server.PHP_SELF}?page=api&action=getdashboarddata&api_key={$GLOBAL.userdata.api_key}&id={$GLOBAL.userdata.id}{literal}";
|
||||
|
||||
// Store our data globally
|
||||
var storedPersonalHashrate=[];
|
||||
var storedPoolHashrate=[];
|
||||
var storedPersonalSharerate=[];
|
||||
|
||||
// Helper to initilize gauges
|
||||
function initGauges(data) {
|
||||
g1 = new JustGage({id: "nethashrate", value: parseFloat(data.getdashboarddata.data.network.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.network.hashrate * 2), title: "Net Hashrate", label: "{/literal}{$GLOBAL.hashunits.network}{literal}"});
|
||||
g2 = new JustGage({id: "poolhashrate", value: parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.pool.hashrate * 2), title: "Pool Hashrate", label: "{/literal}{$GLOBAL.hashunits.pool}{literal}"});
|
||||
g3 = new JustGage({id: "hashrate", value: parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.personal.hashrate * 2), title: "Hashrate", label: "{/literal}{$GLOBAL.hashunits.personal}{literal}"});
|
||||
g4 = new JustGage({id: "sharerate", value: parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.data.personal.sharerate * 2), title: "Sharerate", label: "shares/s"});
|
||||
g5 = new JustGage({id: "querytime", value: parseFloat(data.getdashboarddata.runtime).toFixed(2), min: 0, max: Math.round(data.getdashboarddata.runtime * 3), title: "Querytime", label: "ms"});
|
||||
}
|
||||
|
||||
// Helper to refresh graphs
|
||||
function refreshInformation(data) {
|
||||
g1.refresh(parseFloat(data.getdashboarddata.data.network.hashrate).toFixed(2));
|
||||
g2.refresh(parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2));
|
||||
g3.refresh(parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2));
|
||||
g4.refresh(parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2));
|
||||
g5.refresh(parseFloat(data.getdashboarddata.runtime).toFixed(2));
|
||||
}
|
||||
|
||||
// Fetch initial data via Ajax, starts proper gauges to display
|
||||
$.ajax({
|
||||
url: url,
|
||||
async: false, // Run all others requests after this only if it's done
|
||||
dataType: 'json',
|
||||
success: function (data) { initGauges(data); }
|
||||
});
|
||||
|
||||
// Our worker process to keep gauges and graph updated
|
||||
(function worker() {
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
refreshInformation(data);
|
||||
},
|
||||
complete: function() {
|
||||
setTimeout(worker, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"10000"}{literal})
|
||||
}
|
||||
});
|
||||
})();
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
11
public/templates/mobile/dashboard/overview.tpl
Normal file
11
public/templates/mobile/dashboard/overview.tpl
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="module_content">
|
||||
<div style="display: inline-block;">
|
||||
<div id="hashrate" style="width:180px; height:120px;"></div>
|
||||
<div id="sharerate" style="width:180px; height:120px;"></div>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
<div id="poolhashrate" style="width:100px; height:80px;"></div>
|
||||
<div id="nethashrate" style="width:100px; height:80px;"></div>
|
||||
<div id="querytime" style="width:100px; height:80px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -4,12 +4,13 @@
|
||||
{/if}
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="{$smarty.server.PHP_SELF}" data-icon="info" data-ajax="false">News</a></li>
|
||||
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=dashboard" data-icon="grid" data-ajax="false">Dashboard</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=account&action=workers" data-icon="grid" data-ajax="false">Worker</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=pool" data-icon="grid" data-ajax="false">Statistics</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=logout" data-icon="gear" data-ajax="false">Logout</a></li>
|
||||
{else}
|
||||
<li><a href="{$smarty.server.PHP_SELF}" data-icon="info" data-ajax="false">News</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=login" data-icon="gear" data-ajax="false">Login</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Hashrate</b></td>
|
||||
<td align="right">{$GLOBAL.userdata.hashrate|number_format} KH/s</td>
|
||||
<td align="right">{$GLOBAL.userdata.hashrate|number_format} {$GLOBAL.hashunits.personal}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Share Rate</b></td>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Hashrate</b></td>
|
||||
<td align="right">{$GLOBAL.userdata.hashrate|number_format} KH/s</td>
|
||||
<td align="right">{$GLOBAL.userdata.hashrate|number_format} {$GLOBAL.hashunits.personal}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Share Rate</b></td>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Hashrate</b></td>
|
||||
<td align="right">{$GLOBAL.userdata.hashrate|number_format} KH/s</td>
|
||||
<td align="right">{$GLOBAL.userdata.hashrate|number_format} {$GLOBAL.hashunits.personal}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Share Rate</b></td>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<form action="{$smarty.server.PHP_SELF}?page=login" method="post" id="loginForm" data-ajax="false">
|
||||
<input type="hidden" name="to" value="{($smarty.request.to|default:"{$smarty.server.PHP_SELF}?page=dashboard")|escape}" />
|
||||
<p><input type="text" name="username" value="" id="userForm" maxlength="20"></p>
|
||||
<p><input type="password" name="password" value="" id="passForm" maxlength="20"></p>
|
||||
<center><p><input type="submit" value="Login"></p></center>
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
<title>{$GLOBAL.website.title}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{$PATH}/css/jquery.mobile-1.3.2.min.css" />
|
||||
<script src="{$PATH}/js/jquery-1.9.1.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/jquery-1.9.1.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/raphael.2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/justgage.1.0.1.min.js"></script>
|
||||
<script src="{$PATH}/js/jquery.mobile-1.3.2.min.js"></script>
|
||||
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
|
||||
<script>
|
||||
|
||||
@ -10,55 +10,7 @@
|
||||
|
||||
<div data-role="collapsible">
|
||||
<h3>General Stats</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="leftheader">Pool Hash Rate</td>
|
||||
<td>{($GLOBAL.hashrate / 1000)|number_format:"3"} Mhash/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Pool Efficiency</td>
|
||||
<td>{if $GLOBAL.roundshares.valid > 0}{(100 - (100 / $GLOBAL.roundshares.valid * $GLOBAL.roundshares.invalid))|number_format:"2"}{else}0{/if} %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Current Active Workers</td>
|
||||
<td>{$GLOBAL.workers}</td>
|
||||
</tr>
|
||||
{if $GLOBAL.website.blockexplorer.url}
|
||||
<tr>
|
||||
<td class="leftheader">Next Network Block</td>
|
||||
<td>{$CURRENTBLOCK + 1} <font size="1"> (Current: <a href="{$GLOBAL.website.blockexplorer.url}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr>
|
||||
<td class="leftheader">Next Network Block</td>
|
||||
<td>{$CURRENTBLOCK + 1} (Current: {$CURRENTBLOCK})</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="leftheader">Last Block Found</td>
|
||||
<td>{if $GLOBAL.website.blockexplorer.url}<a href="{$GLOBAL.website.blockexplorer.url}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
|
||||
</tr>
|
||||
{if ! $GLOBAL.website.chaininfo.disabled}
|
||||
<tr>
|
||||
<td class="leftheader">Current Difficulty</td>
|
||||
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="leftheader">Est. Avg. Time per Round</td>
|
||||
<td>{$ESTTIME|seconds_to_words}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Est. Shares this Round</td>
|
||||
<td>{((65536 * $DIFFICULTY) / pow(2, ($GLOBAL.config.targetdiff - 16)))|number_format:"0"} <font size="1">(done: {(100 / ((65536 * $DIFFICULTY) / pow(2, ($GLOBAL.config.targetdiff - 16))) * $GLOBAL.roundshares.valid)|number_format:"2"} %)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Time Since Last Block</td>
|
||||
<td>{$TIMESINCELAST|seconds_to_words}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{include file="statistics/pool/general_stats.tpl"}
|
||||
</div>
|
||||
|
||||
<div data-role="collapsible">
|
||||
|
||||
49
public/templates/mobile/statistics/pool/general_stats.tpl
Normal file
49
public/templates/mobile/statistics/pool/general_stats.tpl
Normal file
@ -0,0 +1,49 @@
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="leftheader">Pool Hash Rate</td>
|
||||
<td>{($GLOBAL.hashrate)|number_format:"3"} {$GLOBAL.hashunits.pool}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Pool Efficiency</td>
|
||||
<td>{if $GLOBAL.roundshares.valid > 0}{(100 - (100 / $GLOBAL.roundshares.valid * $GLOBAL.roundshares.invalid))|number_format:"2"}{else}0{/if} %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Current Active Workers</td>
|
||||
<td>{$GLOBAL.workers}</td>
|
||||
</tr>
|
||||
{if $GLOBAL.website.blockexplorer.url}
|
||||
<tr>
|
||||
<td class="leftheader">Next Network Block</td>
|
||||
<td>{$CURRENTBLOCK + 1} <font size="1"> (Current: <a href="{$GLOBAL.website.blockexplorer.url}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr>
|
||||
<td class="leftheader">Next Network Block</td>
|
||||
<td>{$CURRENTBLOCK + 1} (Current: {$CURRENTBLOCK})</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="leftheader">Last Block Found</td>
|
||||
<td>{if $GLOBAL.website.blockexplorer.url}<a href="{$GLOBAL.website.blockexplorer.url}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
|
||||
</tr>
|
||||
{if ! $GLOBAL.website.chaininfo.disabled}
|
||||
<tr>
|
||||
<td class="leftheader">Current Difficulty</td>
|
||||
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="leftheader">Est. Avg. Time per Round</td>
|
||||
<td>{$ESTTIME|seconds_to_words}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Est. Shares this Round</td>
|
||||
<td>{((65536 * $DIFFICULTY) / pow(2, ($GLOBAL.config.targetdiff - 16)))|number_format:"0"} <font size="1">(done: {(100 / ((65536 * $DIFFICULTY) / pow(2, ($GLOBAL.config.targetdiff - 16))) * $GLOBAL.roundshares.valid)|number_format:"2"} %)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="leftheader">Time Since Last Block</td>
|
||||
<td>{$TIMESINCELAST|seconds_to_words}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
Loading…
Reference in New Issue
Block a user