mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-21 02:19:47 +00:00
workers: show 'login' if set in account table
This commit is contained in:
parent
7ad244c996
commit
81c1c9c1db
1 changed files with 28 additions and 9 deletions
|
@ -12,19 +12,33 @@ echo "<th>Version</th>";
|
||||||
echo "<th>Diff</th>";
|
echo "<th>Diff</th>";
|
||||||
echo "<th>Hashrate</th>";
|
echo "<th>Hashrate</th>";
|
||||||
echo "<th>Bad</th>";
|
echo "<th>Bad</th>";
|
||||||
|
echo "<th>%</th>";
|
||||||
echo "<th></th>";
|
echo "<th></th>";
|
||||||
//echo "<th>Nonce1</th>";
|
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
echo "</thead><tbody>";
|
echo "</thead><tbody>";
|
||||||
|
|
||||||
$workers = getdbolist('db_workers', "algo=:algo order by name", array(':algo'=>$algo));
|
$workers = getdbolist('db_workers', "algo=:algo order by name", array(':algo'=>$algo));
|
||||||
|
|
||||||
|
$total_rate = 0.0;
|
||||||
|
foreach($workers as $worker)
|
||||||
|
{
|
||||||
|
$total_rate += yaamp_worker_rate($worker->id);
|
||||||
|
}
|
||||||
|
|
||||||
foreach($workers as $worker)
|
foreach($workers as $worker)
|
||||||
{
|
{
|
||||||
$user_rate = yaamp_worker_rate($worker->id);
|
$user_rate = yaamp_worker_rate($worker->id);
|
||||||
|
$percent = 0.0;
|
||||||
|
if ($total_rate) $percent = (100.0 * $user_rate) / $total_rate;
|
||||||
$user_bad = yaamp_worker_rate_bad($worker->id);
|
$user_bad = yaamp_worker_rate_bad($worker->id);
|
||||||
$percent = ($user_rate+$user_bad)? round($user_bad*100/($user_rate+$user_bad), 3): 0;
|
$pct_bad = ($user_rate+$user_bad)? round($user_bad*100/($user_rate+$user_bad), 3): 0;
|
||||||
$user_rate = Itoa2($user_rate).'h/s';
|
$user_rate = Itoa2($user_rate).'h/s';
|
||||||
$user_bad = Itoa2($user_bad).'h/s';
|
|
||||||
|
$name = $worker->worker;
|
||||||
|
if ($worker->userid) {
|
||||||
|
$user = getdbosql('db_accounts', 'id=:id', array(':id'=>$worker->userid));
|
||||||
|
$name = $user->login;
|
||||||
|
}
|
||||||
|
|
||||||
$dns = !empty($worker->dns)? $worker->dns: $worker->ip;
|
$dns = !empty($worker->dns)? $worker->dns: $worker->ip;
|
||||||
if(strlen($worker->dns) > 40)
|
if(strlen($worker->dns) > 40)
|
||||||
|
@ -37,14 +51,19 @@ foreach($workers as $worker)
|
||||||
echo "<td>$worker->version</td>";
|
echo "<td>$worker->version</td>";
|
||||||
echo "<td>$worker->difficulty</td>";
|
echo "<td>$worker->difficulty</td>";
|
||||||
echo "<td>$user_rate</td>";
|
echo "<td>$user_rate</td>";
|
||||||
echo "<td>$user_bad</td>";
|
|
||||||
|
|
||||||
if($percent > 50)
|
echo "<td>". ($user_bad ? Itoa2($user_bad).'h/s' : '-');
|
||||||
echo "<td align=right><b>{$percent}%</b></td>";
|
if ($user_bad) {
|
||||||
else
|
if ($pct_bad > 50)
|
||||||
echo "<td align=right>{$percent}%</td>";
|
echo "<b> {$pct_bad}%</b>";
|
||||||
|
else
|
||||||
|
echo " {$pct_bad}%";
|
||||||
|
}
|
||||||
|
echo "</td>";
|
||||||
|
|
||||||
// echo "<td>$worker->nonce1</td>";
|
echo '<td>'.number_format($percent,1,'.','').'%</td>';
|
||||||
|
|
||||||
|
echo "<td>$name</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue