miner.php fix single rig total formatting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
diff --git a/miner.php b/miner.php
index 8c3bef3..e64439a 100644
--- a/miner.php
+++ b/miner.php
@@ -1174,6 +1174,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
switch ($name)
{
case 'Last Share Time':
+ if ($section == 'total')
+ break;
if ($section == 'POOL')
{
if ($value == 0)
@@ -1198,12 +1200,16 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
break;
case 'Last getwork':
case 'Last Valid Work':
+ if ($section == 'total')
+ break;
if ($value == 0)
$ret = 'Never';
else
$ret = ($value - $when) . 's';
break;
case 'Last Share Pool':
+ if ($section == 'total')
+ break;
if ($value == -1)
{
$ret = 'None';
@@ -1212,6 +1218,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
break;
case 'Elapsed':
case 'Device Elapsed':
+ if ($section == 'total')
+ break;
$s = $value % 60;
$value -= $s;
$value /= 60;
@@ -1244,6 +1252,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
}
break;
case 'Last Well':
+ if ($section == 'total')
+ break;
if ($value == '0')
{
$ret = 'Never';
@@ -1253,6 +1263,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
$ret = date('H:i:s', $value);
break;
case 'Last Not Well':
+ if ($section == 'total')
+ break;
if ($value == '0')
$ret = 'Never';
else
@@ -1262,6 +1274,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
}
break;
case 'Reason Not Well':
+ if ($section == 'total')
+ break;
if ($value != 'None')
$class = $errorclass;
break;
@@ -1296,6 +1310,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
$ret = number_format($value, 2).'/m';
break;
case 'Temperature':
+ if ($section == 'total')
+ break;
$ret = $value.'°C';
if (!isset($alldata['GPU']))
{
@@ -1307,10 +1323,14 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
case 'Memory Clock':
case 'GPU Voltage':
case 'GPU Activity':
+ if ($section == 'total')
+ break;
if ($value == 0)
$class = $warnclass;
break;
case 'Fan Percent':
+ if ($section == 'total')
+ break;
if ($value == 0)
$class = $warnclass;
else
@@ -1323,6 +1343,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
}
break;
case 'Fan Speed':
+ if ($section == 'total')
+ break;
if ($value == 0)
$class = $warnclass;
else
@@ -1413,25 +1435,35 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
$ret = number_format((float)$parts[0]).$dec;
break;
case 'Status':
+ if ($section == 'total')
+ break;
if ($value != 'Alive')
$class = $errorclass;
break;
case 'Enabled':
+ if ($section == 'total')
+ break;
if ($value != 'Y')
$class = $warnclass;
break;
case 'No Device':
+ if ($section == 'total')
+ break;
if ($value != 'false')
$class = $errorclass;
break;
case 'When':
case 'Current Block Time':
+ if ($section == 'total')
+ break;
$ret = date($dfmt, $value);
break;
+ case 'Last Share Difficulty':
+ if ($section == 'total')
+ break;
case 'Difficulty Accepted':
case 'Difficulty Rejected':
case 'Difficulty Stale':
- case 'Last Share Difficulty':
if ($value != '')
$ret = number_format((float)$value, 2);
break;
@@ -1439,10 +1471,14 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
case 'Device Rejected%':
case 'Pool Rejected%':
case 'Pool Stale%':
+ if ($section == 'total')
+ break;
if ($value != '')
$ret = number_format((float)$value, 2) . '%';
break;
case 'Best Share':
+ if ($section == 'total')
+ break;
case 'Hardware Errors':
if ($value != '')
$ret = number_format((float)$value);
@@ -1470,6 +1506,8 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
$ret = number_format((float)$value, 2);
break;
case 'AvShr':
+ if ($section == 'total')
+ break;
if ($value != '')
$ret = number_format((float)$value, 2);
if ($value == 0)
@@ -1534,14 +1572,16 @@ function showdatetime()
#
global $singlerigsum;
$singlerigsum = array(
- 'devs' => array('MHS av' => 1, 'MHS 5s' => 1, 'Accepted' => 1, 'Rejected' => 1,
+ 'devs' => array('MHS av' => 1, 'MHS 5s' => 1, 'MHS 1m' => 1, 'MHS 5m' => 1,
+ 'MHS 15m' => 1, 'Accepted' => 1, 'Rejected' => 1,
'Hardware Errors' => 1, 'Utility' => 1, 'Total MH' => 1,
- 'Diff1 Shares' => 1, 'Diff1 Work' => 1, 'Difficulty Accepted' => 1,
- 'Difficulty Rejected' => 1),
+ 'Diff1 Shares' => 1, 'Diff1 Work' => 1,
+ 'Difficulty Accepted' => 1, 'Difficulty Rejected' => 1),
'pools' => array('Getworks' => 1, 'Accepted' => 1, 'Rejected' => 1, 'Discarded' => 1,
'Stale' => 1, 'Get Failures' => 1, 'Remote Failures' => 1,
- 'Diff1 Shares' => 1, 'Diff1 Work' => 1, 'Difficulty Accepted' => 1,
- 'Difficulty Rejected' => 1, 'Difficulty Stale' => 1),
+ 'Diff1 Shares' => 1, 'Diff1 Work' => 1,
+ 'Difficulty Accepted' => 1, 'Difficulty Rejected' => 1,
+ 'Difficulty Stale' => 1),
'notify' => array('*' => 1));
#
function showtotal($total, $when, $oldvalues)