mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 22:38:01 +00:00
miner.php - fix custom totals and colouroverride
This commit is contained in:
parent
7d7fd4d1c6
commit
4003291f75
36
miner.php
36
miner.php
@ -154,23 +154,28 @@ function getcss($cssname, $dom = false)
|
|||||||
global $colourtable, $colouroverride;
|
global $colourtable, $colouroverride;
|
||||||
|
|
||||||
$css = '';
|
$css = '';
|
||||||
foreach ($colourtable as $cssdata => $colour)
|
foreach ($colourtable as $cssdata => $value)
|
||||||
{
|
{
|
||||||
$cssobj = split(' ', $cssdata, 2);
|
$cssobj = split(' ', $cssdata, 2);
|
||||||
if ($cssobj[0] == $cssname)
|
if ($cssobj[0] == $cssname)
|
||||||
{
|
{
|
||||||
if (isset($colouroverride[$cssdata]))
|
if (isset($colouroverride[$cssdata]))
|
||||||
$color = $colouroverride[$cssdata];
|
$value = $colouroverride[$cssdata];
|
||||||
|
|
||||||
if ($dom == true)
|
if ($dom == true)
|
||||||
$css .= ' '.$cssobj[1].'='.$colour;
|
$css .= ' '.$cssobj[1].'='.$value;
|
||||||
else
|
else
|
||||||
$css .= $cssobj[1].':'.$colour.'; ';
|
$css .= $cssobj[1].':'.$value.'; ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $css;
|
return $css;
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
|
function getdom($domname)
|
||||||
|
{
|
||||||
|
return getcss($domname, true);
|
||||||
|
}
|
||||||
|
#
|
||||||
function htmlhead($checkapi, $rig, $pg = null)
|
function htmlhead($checkapi, $rig, $pg = null)
|
||||||
{
|
{
|
||||||
global $miner_font_family, $miner_font_size;
|
global $miner_font_family, $miner_font_size;
|
||||||
@ -216,7 +221,7 @@ td.lst { $miner_font ".getcss('td.lst')."}
|
|||||||
td.hi { $miner_font ".getcss('td.hi')."}
|
td.hi { $miner_font ".getcss('td.hi')."}
|
||||||
td.lo { $miner_font ".getcss('td.lo')."}
|
td.lo { $miner_font ".getcss('td.lo')."}
|
||||||
</style>
|
</style>
|
||||||
</head><body".getcss('body',true).">
|
</head><body".getdom('body').">
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
function pr(a,m){if(m!=null){if(!confirm(m+'?'))return}window.location='$here?ref=$autorefresh'+a}\n";
|
function pr(a,m){if(m!=null){if(!confirm(m+'?'))return}window.location='$here?ref=$autorefresh'+a}\n";
|
||||||
|
|
||||||
@ -517,6 +522,7 @@ function fmt($section, $name, $value, $when, $alldata)
|
|||||||
case 'GPU.Utility':
|
case 'GPU.Utility':
|
||||||
case 'PGA.Utility':
|
case 'PGA.Utility':
|
||||||
case 'SUMMARY.Utility':
|
case 'SUMMARY.Utility':
|
||||||
|
case 'total.Utility':
|
||||||
$ret = $value.'/m';
|
$ret = $value.'/m';
|
||||||
if ($value == 0)
|
if ($value == 0)
|
||||||
$class = $errorclass;
|
$class = $errorclass;
|
||||||
@ -575,6 +581,7 @@ function fmt($section, $name, $value, $when, $alldata)
|
|||||||
case 'GPU.MHS av':
|
case 'GPU.MHS av':
|
||||||
case 'PGA.MHS av':
|
case 'PGA.MHS av':
|
||||||
case 'SUMMARY.MHS av':
|
case 'SUMMARY.MHS av':
|
||||||
|
case 'total.MHS av':
|
||||||
$parts = explode('.', $value, 2);
|
$parts = explode('.', $value, 2);
|
||||||
if (count($parts) == 1)
|
if (count($parts) == 1)
|
||||||
$dec = '';
|
$dec = '';
|
||||||
@ -600,18 +607,25 @@ function fmt($section, $name, $value, $when, $alldata)
|
|||||||
case 'GPU.Total MH':
|
case 'GPU.Total MH':
|
||||||
case 'PGA.Total MH':
|
case 'PGA.Total MH':
|
||||||
case 'SUMMARY.Total MH':
|
case 'SUMMARY.Total MH':
|
||||||
|
case 'total.Total MH':
|
||||||
case 'SUMMARY.Getworks':
|
case 'SUMMARY.Getworks':
|
||||||
|
case 'POOL.Getworks':
|
||||||
|
case 'total.Getworks':
|
||||||
case 'GPU.Accepted':
|
case 'GPU.Accepted':
|
||||||
case 'PGA.Accepted':
|
case 'PGA.Accepted':
|
||||||
case 'SUMMARY.Accepted':
|
case 'SUMMARY.Accepted':
|
||||||
|
case 'POOL.Accepted':
|
||||||
|
case 'total.Accepted':
|
||||||
case 'GPU.Rejected':
|
case 'GPU.Rejected':
|
||||||
case 'PGA.Rejected':
|
case 'PGA.Rejected':
|
||||||
case 'SUMMARY.Rejected':
|
case 'SUMMARY.Rejected':
|
||||||
case 'SUMMARY.Local Work':
|
|
||||||
case 'POOL.Getworks':
|
|
||||||
case 'POOL.Accepted':
|
|
||||||
case 'POOL.Rejected':
|
case 'POOL.Rejected':
|
||||||
|
case 'total.Rejected':
|
||||||
|
case 'SUMMARY.Local Work':
|
||||||
|
case 'total.Local Work':
|
||||||
|
case 'SUMMARY.Discarded':
|
||||||
case 'POOL.Discarded':
|
case 'POOL.Discarded':
|
||||||
|
case 'total.Discarded':
|
||||||
$parts = explode('.', $value, 2);
|
$parts = explode('.', $value, 2);
|
||||||
if (count($parts) == 1)
|
if (count($parts) == 1)
|
||||||
$dec = '';
|
$dec = '';
|
||||||
@ -1002,8 +1016,6 @@ function doforeach($cmd, $des, $sum, $head, $datetime)
|
|||||||
|
|
||||||
showhead('', $header);
|
showhead('', $header);
|
||||||
|
|
||||||
$section = '';
|
|
||||||
|
|
||||||
foreach ($anss as $rig => $ans)
|
foreach ($anss as $rig => $ans)
|
||||||
{
|
{
|
||||||
$when = 0;
|
$when = 0;
|
||||||
@ -1017,9 +1029,7 @@ function doforeach($cmd, $des, $sum, $head, $datetime)
|
|||||||
|
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
|
|
||||||
$newsection = preg_replace('/\d/', '', $item);
|
$section = preg_replace('/\d/', '', $item);
|
||||||
if ($newsection != 'total')
|
|
||||||
$section = $newsection;
|
|
||||||
|
|
||||||
foreach ($header as $name => $x)
|
foreach ($header as $name => $x)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user