mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 14:28:12 +00:00
miner.php display rig 'when' table at top of the multi-rig summary page
This commit is contained in:
parent
724d9e45e1
commit
fe381c14e7
54
miner.php
54
miner.php
@ -203,6 +203,8 @@ function getparam($name, $both = false)
|
|||||||
#
|
#
|
||||||
function fmt($section, $name, $value)
|
function fmt($section, $name, $value)
|
||||||
{
|
{
|
||||||
|
$dfmt = 'H:i:s j-M-Y \U\T\CP';
|
||||||
|
|
||||||
$errorclass = ' class=err';
|
$errorclass = ' class=err';
|
||||||
$warnclass = ' class=warn';
|
$warnclass = ' class=warn';
|
||||||
$b = ' ';
|
$b = ' ';
|
||||||
@ -325,6 +327,9 @@ function fmt($section, $name, $value)
|
|||||||
if ($value != 'Y')
|
if ($value != 'Y')
|
||||||
$class = $warnclass;
|
$class = $warnclass;
|
||||||
break;
|
break;
|
||||||
|
case 'STATUS.When':
|
||||||
|
$ret = date($dfmt, $value);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($section == 'NOTIFY' && substr($name, 0, 1) == '*' && $value != '0')
|
if ($section == 'NOTIFY' && substr($name, 0, 1) == '*' && $value != '0')
|
||||||
@ -346,7 +351,7 @@ function showhead($cmd, $item, $values)
|
|||||||
|
|
||||||
foreach ($values as $name => $value)
|
foreach ($values as $name => $value)
|
||||||
{
|
{
|
||||||
if ($name == '0')
|
if ($name == '0' or $name == '')
|
||||||
$name = ' ';
|
$name = ' ';
|
||||||
echo "<td valign=bottom class=h>$name</td>";
|
echo "<td valign=bottom class=h>$name</td>";
|
||||||
}
|
}
|
||||||
@ -550,7 +555,7 @@ function process($cmds, $rig)
|
|||||||
}
|
}
|
||||||
#
|
#
|
||||||
# $head is a hack but this is just a demo anyway :)
|
# $head is a hack but this is just a demo anyway :)
|
||||||
function doforeach($cmd, $des, $sum, $head)
|
function doforeach($cmd, $des, $sum, $head, $datetime)
|
||||||
{
|
{
|
||||||
global $miner, $port;
|
global $miner, $port;
|
||||||
global $error, $readonly, $notify, $rigs;
|
global $error, $readonly, $notify, $rigs;
|
||||||
@ -588,6 +593,45 @@ function doforeach($cmd, $des, $sum, $head)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($datetime)
|
||||||
|
{
|
||||||
|
$dthead = array('' => 1, 'STATUS' => 1, 'Description' => 1, 'When' => 1);
|
||||||
|
showhead('', null, $dthead);
|
||||||
|
|
||||||
|
foreach ($anss as $rig => $ans)
|
||||||
|
{
|
||||||
|
echo '<tr>';
|
||||||
|
|
||||||
|
foreach ($ans as $item => $row)
|
||||||
|
{
|
||||||
|
if ($item != 'STATUS')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach ($dthead as $name => $x)
|
||||||
|
{
|
||||||
|
if ($name == '')
|
||||||
|
echo "<td align=right><input type=button value='Rig $rig' onclick='pr(\"?rig=$rig\",null)'></td>";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (isset($row[$name]))
|
||||||
|
list($showvalue, $class) = fmt('STATUS', $name, $row[$name]);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$class = '';
|
||||||
|
$showvalue = ' ';
|
||||||
|
}
|
||||||
|
echo "<td$class align=right>$showvalue</td>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</tr>';
|
||||||
|
}
|
||||||
|
echo $tableend;
|
||||||
|
echo '<tr><td><br><br></td></tr>';
|
||||||
|
echo $tablebegin;
|
||||||
|
}
|
||||||
|
|
||||||
$total = array();
|
$total = array();
|
||||||
|
|
||||||
foreach ($anss as $rig => $ans)
|
foreach ($anss as $rig => $ans)
|
||||||
@ -795,15 +839,15 @@ function display()
|
|||||||
|
|
||||||
echo $tablebegin;
|
echo $tablebegin;
|
||||||
$sum = array('MHS av', 'Getworks', 'Found Blocks', 'Accepted', 'Rejected', 'Discarded', 'Stale', 'Utility', 'Local Work', 'Total MH');
|
$sum = array('MHS av', 'Getworks', 'Found Blocks', 'Accepted', 'Rejected', 'Discarded', 'Stale', 'Utility', 'Local Work', 'Total MH');
|
||||||
doforeach('summary', 'summary information', $sum, array());
|
doforeach('summary', 'summary information', $sum, array(), true);
|
||||||
echo $tableend;
|
echo $tableend;
|
||||||
echo '<tr><td><br><br></td></tr>';
|
echo '<tr><td><br><br></td></tr>';
|
||||||
echo $tablebegin;
|
echo $tablebegin;
|
||||||
doforeach('devs', 'device list', $sum, array(''=>'','ID'=>'','Name'=>''));
|
doforeach('devs', 'device list', $sum, array(''=>'','ID'=>'','Name'=>''), false);
|
||||||
echo $tableend;
|
echo $tableend;
|
||||||
echo '<tr><td><br><br></td></tr>';
|
echo '<tr><td><br><br></td></tr>';
|
||||||
echo $tablebegin;
|
echo $tablebegin;
|
||||||
doforeach('pools', 'pool list', $sum, array(''=>''));
|
doforeach('pools', 'pool list', $sum, array(''=>''), false);
|
||||||
echo $tableend;
|
echo $tableend;
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user