adding per-worker difficulty display
This commit is contained in:
parent
7769550f89
commit
96066993ac
@ -136,14 +136,23 @@ class Worker {
|
|||||||
WHERE
|
WHERE
|
||||||
username = w.username
|
username = w.username
|
||||||
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
||||||
) + (
|
) + (
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536/600/1000), 0), 0) AS hashrate
|
IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536/600/1000), 0), 0) AS hashrate
|
||||||
FROM " . $this->share->getArchiveTableName() . "
|
FROM " . $this->share->getArchiveTableName() . "
|
||||||
WHERE
|
WHERE
|
||||||
username = w.username
|
username = w.username
|
||||||
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
||||||
) AS hashrate
|
) AS hashrate,
|
||||||
|
(
|
||||||
|
SELECT IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) / COUNT(id), 2), 0), 0)
|
||||||
|
FROM " . $this->share->getTableName() . "
|
||||||
|
WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
||||||
|
) + (
|
||||||
|
SELECT IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) / COUNT(id), 2), 0), 0)
|
||||||
|
FROM " . $this->share->getArchiveTableName() . "
|
||||||
|
WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)
|
||||||
|
) AS difficulty
|
||||||
FROM $this->table AS w
|
FROM $this->table AS w
|
||||||
WHERE account_id = ?");
|
WHERE account_id = ?");
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $account_id) && $stmt->execute() && $result = $stmt->get_result())
|
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $account_id) && $stmt->execute() && $result = $stmt->get_result())
|
||||||
|
|||||||
@ -7,13 +7,13 @@
|
|||||||
<table border="0" cellpadding="3" cellspacing="3">
|
<table border="0" cellpadding="3" cellspacing="3">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Worker Name</td>
|
<th>Worker Name</th>
|
||||||
<td>Password</td>
|
<th>Password</th>
|
||||||
<td class="center">Active</td>
|
<th class="center">Active</th>
|
||||||
{if $GLOBAL.config.disable_notifications != 1}<td class="center">Monitor</td>{/if}
|
{if $GLOBAL.config.disable_notifications != 1}<th class="center">Monitor</th>{/if}
|
||||||
<td class="right">Khash/s</td>
|
<th class="right">Khash/s</th>
|
||||||
<td> </td>
|
<th class="right">Difficulty</th>
|
||||||
<td> </td>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
{nocache}
|
{nocache}
|
||||||
{section worker $WORKERS}
|
{section worker $WORKERS}
|
||||||
@ -29,6 +29,7 @@
|
|||||||
</td>
|
</td>
|
||||||
{/if}
|
{/if}
|
||||||
<td class="right">{$WORKERS[worker].hashrate|number_format}</td>
|
<td class="right">{$WORKERS[worker].hashrate|number_format}</td>
|
||||||
|
<td class="right">{$WORKERS[worker].difficulty|number_format:"2"}</td>
|
||||||
<td align="right"><a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=delete&id={$WORKERS[worker].id|escape}"><button style="padding:5px" type="button">Delete</button></a></td>
|
<td align="right"><a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=delete&id={$WORKERS[worker].id|escape}"><button style="padding:5px" type="button">Delete</button></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{/section}
|
{/section}
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
<th align="left">Worker Name</th>
|
<th align="left">Worker Name</th>
|
||||||
<th align="center">Active</th>
|
<th align="center">Active</th>
|
||||||
<th align="right">Khash/s</th>
|
<th align="right">Khash/s</th>
|
||||||
|
<th align="right">Difficulty</th>
|
||||||
</tr>
|
</tr>
|
||||||
{section worker $WORKERS}
|
{section worker $WORKERS}
|
||||||
{assign var="username" value="."|escape|explode:$WORKERS[worker].username:2}
|
{assign var="username" value="."|escape|explode:$WORKERS[worker].username:2}
|
||||||
@ -11,6 +12,7 @@
|
|||||||
<td align="left"{if $WORKERS[worker].active} style="color: orange"{/if}>{$username.0|escape}.{$username.1|escape}</td>
|
<td align="left"{if $WORKERS[worker].active} style="color: orange"{/if}>{$username.0|escape}.{$username.1|escape}</td>
|
||||||
<td align="center"><img src="{$PATH}/images/{if $WORKERS[worker].hashrate > 0}success{else}error{/if}.gif" /></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 align="right">{$WORKERS[worker].hashrate|number_format}</td>
|
||||||
|
<td class="right">{$WORKERS[worker].hashrate|number_format}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/section}
|
{/section}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user