miner.php split devs output for different devices
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
diff --git a/miner.php b/miner.php
index d385a8f..8f37dfc 100644
--- a/miner.php
+++ b/miner.php
@@ -158,7 +158,8 @@ function fmt($section, $name, $value)
switch ($section.'.'.$name)
{
- case 'GPU0.Last Share Time':
+ case 'GPU.Last Share Time':
+ case 'PGA.Last Share Time':
return date('H:i:s', $value);
break;
case 'SUMMARY.Elapsed':
@@ -190,11 +191,13 @@ function fmt($section, $name, $value)
}
}
break;
- case 'GPU0.Utility':
+ case 'GPU.Utility':
+ case 'PGA.Utility':
case 'SUMMARY.Utility':
return $value.'/m';
break;
- case 'GPU0.Temperature':
+ case 'GPU.Temperature':
+ case 'PGA.Temperature':
return $value.'°C';
break;
}
@@ -202,8 +205,37 @@ function fmt($section, $name, $value)
return $value;
}
#
+global $poolcmd;
+$poolcmd = array( 'Switch to' => 'switchpool',
+ 'Enable' => 'enablepool',
+ 'Disable' => 'disablepool' );
+#
+function showhead($cmd, $item, $values)
+{
+ global $poolcmd;
+
+ echo '<tr>';
+
+ foreach ($values as $name => $value)
+ {
+ if ($name == '0')
+ $name = ' ';
+ echo "<td valign=bottom class=h>$name</td>";
+ }
+
+ if ($cmd == 'pools')
+ foreach ($poolcmd as $name => $pcmd)
+ echo "<td valign=bottom class=h>$name</td>";
+
+ echo '</tr>';
+}
+#
function details($cmd, $list)
{
+ global $poolcmd;
+
+ $dfmt = 'H:i:s j-M-Y \U\T\CP';
+
$stas = array('S' => 'Success', 'W' => 'Warning', 'I' => 'Informational', 'E' => 'Error', 'F' => 'Fatal');
$tb = '<tr><td><table border=1 cellpadding=5 cellspacing=0>';
@@ -211,7 +243,7 @@ function details($cmd, $list)
echo $tb;
- echo '<tr><td class=sta>Date: '.date('H:i:s j-M-Y \U\T\CP').'</td></tr>';
+ echo '<tr><td class=sta>Date: '.date($dfmt).'</td></tr>';
echo $te.$tb;
@@ -219,49 +251,30 @@ function details($cmd, $list)
{
echo '<tr>';
echo '<td>Computer: '.$list['STATUS']['Description'].'</td>';
+ if (isset($list['STATUS']['When']))
+ echo '<td>When: '.date($dfmt, $list['STATUS']['When']).'</td>';
$sta = $list['STATUS']['STATUS'];
echo '<td>Status: '.$stas[$sta].'</td>';
echo '<td>Message: '.$list['STATUS']['Msg'].'</td>';
echo '</tr>';
}
- echo $te.$tb;
$section = '';
- $poolcmd = array( 'Switch to' => 'switchpool',
- 'Enable' => 'enablepool',
- 'Disable' => 'disablepool' );
-
foreach ($list as $item => $values)
{
- if ($item != 'STATUS')
- {
- $section = $item;
-
- echo '<tr>';
-
- foreach ($values as $name => $value)
- {
- if ($name == '0')
- $name = ' ';
- echo "<td valign=bottom class=h>$name</td>";
- }
-
- if ($cmd == 'pools')
- foreach ($poolcmd as $name => $pcmd)
- echo "<td valign=bottom class=h>$name</td>";
+ if ($item == 'STATUS')
+ continue;
- echo '</tr>';
+ $sectionname = ereg_replace('[0-9]', '', $item);
- break;
+ if ($sectionname != $section)
+ {
+ echo $te.$tb;
+ showhead($cmd, $item, $values);
+ $section = $sectionname;
}
- }
-
- foreach ($list as $item => $values)
- {
- if ($item == 'STATUS')
- continue;
echo '<tr>';