diff --git a/miner.php b/miner.php index 728a4ebc..7c4d8891 100644 --- a/miner.php +++ b/miner.php @@ -3,6 +3,7 @@ session_start(); # global $miner, $port, $readonly, $notify, $rigs, $socktimeoutsec; global $checklastshare, $hidefields; +global $ignorerefresh, $changerefresh, $autorefresh; # # Don't touch these 2 - see $rigs below $miner = null; @@ -50,6 +51,14 @@ $socktimeoutsec = 10; #$hidefields = array('POOL.URL' => 1, 'POOL.User' => 1); $hidefields = array(); # +# Auto-refresh of the page (in seconds) +# $ignorerefresh = true/false always ignore refresh parameters +# $changerefresh = true/false show buttons to change the value +# $autorefresh = default value, 0 means dont auto-refresh +$ignorerefresh = false; +$changerefresh = true; +$autorefresh = 0; +# $here = $_SERVER['PHP_SELF']; # global $tablebegin, $tableend, $warnfont, $warnoff, $dfmt; @@ -60,6 +69,11 @@ $warnfont = ''; $warnoff = ''; $dfmt = 'H:i:s j-M-Y \U\T\CP'; # +global $miner_font_family, $miner_font_size; +# +$miner_font_family = 'verdana,arial,sans'; +$miner_font_size = '13pt'; +# # This below allows you to put your own settings into a seperate file # so you don't need to update miner.php with your preferred settings # every time a new version is released @@ -76,9 +90,24 @@ $showndate = false; global $rigerror; $rigerror = array(); # -function htmlhead($checkapi) +function htmlhead($checkapi, $rig) { + global $miner_font_family, $miner_font_size; global $error, $readonly, $here; + global $ignorerefresh, $autorefresh; + + $paramrig = ''; + if ($rig != null && $rig != '') + $paramrig = "&rig=$rig"; + + if ($ignorerefresh == true || $autorefresh == 0) + $refreshmeta = ''; + else + { + $url = "$here?ref=$autorefresh$paramrig"; + $refreshmeta = "\n"; + } + if ($readonly === false && $checkapi === true) { $access = api('privileged'); @@ -87,28 +116,31 @@ function htmlhead($checkapi) || $access['STATUS']['STATUS'] != 'S') $readonly = true; } -?> -Mine + $miner_font = "font-family:$miner_font_family; font-size:$miner_font_size;"; + + echo "$refreshmeta +Mine @@ -778,7 +810,7 @@ function doforeach($cmd, $des, $sum, $head, $datetime) foreach ($dthead as $name => $x) { if ($item == 'STATUS' && $name == '') - echo ""; + echo ""; else { if (isset($row[$name])) @@ -861,7 +893,7 @@ function doforeach($cmd, $des, $sum, $head, $datetime) if ($rig === 'total') echo "Total:"; else - echo ""; + echo ""; } else { @@ -884,27 +916,42 @@ function doforeach($cmd, $des, $sum, $head, $datetime) } } # +function refreshbuttons() +{ + global $readonly; + global $ignorerefresh, $changerefresh, $autorefresh; + + if ($ignorerefresh == false && $changerefresh == true) + { + echo '    '; + echo ""; + echo ""; + echo ""; + } +} +# function doOne($rig, $preprocess) { - global $error, $readonly, $notify; - global $rigs; + global $error, $readonly, $notify, $rigs; - htmlhead(true); + htmlhead(true, $rig); $error = null; echo ""; + echo ""; if (count($rigs) > 1) echo ""; - echo "
"; - echo " "; + echo " "; if ($readonly === false) { - $msg = 'Quit CGMiner'; + $rg = ''; if (count($rigs) > 1) - $msg .= " Rig $rig"; - echo ""; + $rg = " Rig $rig"; + echo ""; + echo " "; } + refreshbuttons(); echo "
"; if ($preprocess != null) @@ -930,6 +977,14 @@ function display() global $tablebegin, $tableend; global $miner, $port; global $error, $readonly, $notify, $rigs; + global $ignorerefresh, $autorefresh; + + if ($ignorerefresh == false) + { + $ref = trim(getparam('ref', true)); + if ($ref != null && $ref != '') + $autorefresh = intval($ref); + } $rig = trim(getparam('rig', true)); @@ -998,10 +1053,12 @@ function display() return; } - htmlhead(false); + htmlhead(false, null); echo "
"; echo ""; + echo " "; + refreshbuttons(); echo "
"; if ($preprocess != null)