function totalMH() { $stats = miner("devs", ""); $devs = $stats['DEVS']; $MHSav = 0; if (count($devs) == 0) { return "0"; } foreach ($devs as $dev) { $MHSav = $MHSav + $dev['MHSav']; } return $MHSav; }
create_graph("mhsav-year.png", "-1y", "Last Year"); function create_graph($output, $start, $title) { $RRDPATH = '/opt/minepeon/var/rrd/'; $options = array("--slope-mode", "--start", $start, "--title={$title}", "--vertical-label=Hash per second", "--lower=0", "DEF:hashrate=" . $RRDPATH . "hashrate.rrd:hashrate:AVERAGE", "CDEF:realspeed=hashrate,1000,*", "LINE2:realspeed#FF0000"); $ret = rrd_graph("/opt/minepeon/http/rrd/" . $output, $options); if (!$ret) { //echo "<b>Graph error: </b>".rrd_error()."\n"; } } if (isset($_POST['url'])) { $pools = miner('pools', '')['POOLS']; $pool = 0; foreach ($pools as $key => $value) { if (isset($value['User']) && $value['URL'] == $_POST['url']) { miner('switchpool', $pool); } $pool = $pool + 1; } } include 'head.php'; ?> <script src="js/jquery.min.js"> </script> <script type="text/javascript"> $(document).ready(function () { setInterval(function () { $("#status1").load("ajax/status.php"); $("#miners1").load("ajax/miners.php"); $("#pools1").load("ajax/pools.php"); }, 1000);
<?php require_once 'miner.inc.php'; include_once 'functions.inc.php'; include_once "../lang/en/lang.en.php"; include_once 'settings.inc.php'; $G_MHSav = 0; $stats = miner("devs", ""); $status = $stats['STATUS']; $devs = $stats['DEVS']; $summary = miner("summary", ""); $pools = miner("pools", ""); if (count($devs) == 0) { echo "<div class='alert alert-danger'>No devices running</div>"; } else { $devices = 0; $MHSav = 0; $Accepted = 0; $Rejected = 0; $HardwareErrors = 0; $Utility = 0; $tableRow = '<table id="stats" class="tablesorter table table-striped table-hover stats"> <thead> <tr> <th>Name</th> <th>ID</th> <th>Temp</th> <th>Hash Rate</th> <th>Accept</th> <th>Reject</th> <th>Error</th>
<?php include_once 'functions.inc.php'; include_once 'settings.inc.php'; this_session_start(); login_check("quick"); header('Content-type: application/json'); require 'miner.inc.php'; // Check for POST or GET data if (empty($_REQUEST['command'])) { echo json_encode(array('success' => false, 'debug' => "No command given")); exit; } $command["command"] = $_REQUEST['command']; // Check for parameters if (!empty($_REQUEST['parameter'])) { $command['parameter'] = $_REQUEST['parameter']; } miner($command["command"], $command['parameter']); $r['success'] = "true"; $r['command'] = $command; echo json_encode($r);
var start = new Date(); start = Date.parse(start)/1000; var seconds = 15; function CountDown(){ var now = new Date(); now = Date.parse(now)/1000; var counter = parseInt(seconds-(now-start),10); document.getElementById('countdown').innerHTML = counter; if(counter > 0){ timerID = setTimeout("CountDown()", 100) }else{ location.href = "/" } } window.setTimeout('CountDown()',100); </script> </head> <body> <div class="center-page"> <p><h1>Restarting Miner</h1></p> <p>You will be redirected in</p> <p><h1 id="countdown">15</h1></p> <p>seconds.</p> </div> </body> </html> <?php include 'miner.inc.php'; miner('restart', '');