diff --git a/miner.php b/miner.php
index 5e8f80ed..e0fc3985 100644
--- a/miner.php
+++ b/miner.php
@@ -72,9 +72,13 @@ $allowcustompages = true;
# - empty tables are not shown
# - empty columns (an unknown field) are not shown
# - and missing field data shows as blank
+# - section = 'DATE' displays a date table like 'Summary'
+# - section = 'RIGS' displays a rig table like 'Summary'
# There is a second array, listing fields to be totaled for each section
# see the example below (if there is no matching data, no total will show)
$mobilepage = array(
+ 'DATE' => null,
+ 'RIGS' => null,
'SUMMARY' => array('Elapsed', 'MHS av', 'Found Blocks', 'Accepted', 'Rejected', 'Utility'),
'DEVS' => array('ID', 'Name', 'GPU', 'Status', 'MHS av', 'Accepted', 'Rejected', 'Utility'),
'POOL' => array('POOL', 'Status', 'Accepted', 'Rejected', 'Last Share Time'));
@@ -888,6 +892,50 @@ function process($cmds, $rig)
}
}
#
+function showdatetime()
+{
+ global $dfmt;
+
+ echo '
';
+ }
+}
+#
# $head is a hack but this is just a demo anyway :)
function doforeach($cmd, $des, $sum, $head, $datetime)
{
@@ -940,39 +988,10 @@ function doforeach($cmd, $des, $sum, $head, $datetime)
if ($datetime)
{
- echo '
';
echo $tablebegin;
@@ -1147,7 +1166,9 @@ global $sectionmap;
# map sections to their api command
# DEVS is a special case that will match GPU or PGA
# so you can have a single table with both in it
+# DATE is hard coded so not in here
$sectionmap = array(
+ 'RIGS' => 'version',
'SUMMARY' => 'summary',
'POOL' => 'pools',
'DEVS' => 'devs',
@@ -1274,11 +1295,37 @@ function processcustompage($pagename, $sections, $sum)
}
}
+ $shownsomething = false;
if (count($results) > 0)
{
$first = true;
foreach ($sections as $section => $fields)
{
+ if ($section === 'DATE')
+ {
+ if ($shownsomething)
+ echo '
';
+
+ echo $tablebegin;
+ showdatetime();
+ echo $tableend;
+ // On top of the next table
+ $shownsomething = false;
+ continue;
+ }
+
+ if ($section === 'RIGS')
+ {
+ if ($shownsomething)
+ echo '
';
+
+ echo $tablebegin;
+ showrigs($results['version'], 'Rig', '');
+ echo $tableend;
+ $shownsomething = true;
+ continue;
+ }
+
if (isset($results[$sectionmap[$section]]))
{
$rigresults = $results[$sectionmap[$section]];
@@ -1294,7 +1341,7 @@ function processcustompage($pagename, $sections, $sum)
if (count($showfields) > 0)
{
- if ($first === false)
+ if ($shownsomething)
echo '