'local-sample.php', //'EPSYTOUR'=>'epsytour.php', /* copy local.php file and edit target IP:PORT */ ); function getdataFromPears() { global $host, $configs; $data = array(); foreach ($configs as $name => $conf) { $json = file_get_contents($host.$conf); $data[$name] = json_decode($json, TRUE); } return $data; } function translateField($key) { $intl = array(); $intl['NAME'] = 'Software'; $intl['VER'] = 'Version'; $intl['ALGO'] = 'Algorithm'; $intl['KHS'] = 'Hash rate (kH/s)'; $intl['ACC'] = 'Accepted shares'; $intl['ACCMN'] = 'Accepted / mn'; $intl['REJ'] = 'Rejected'; $intl['UPTIME'] = 'Miner up time'; $intl['TEMP'] = 'T°c'; $intl['FAN'] = 'Fan %'; if (isset($intl[$key])) return $intl[$key]; else return $key; } function translateValue($key,$val) { if ($key == 'UPTIME') { $min = floor(intval($val) / 60); $sec = intval($val) % 60; $val = "${min}mn ${sec}s"; } return $val; } function displayData($data) { $htm = ''; $totals = array(); foreach ($data as $name => $stats) { $htm .= '
'.$name." | |
---|---|
'.translateField($key).' | '. ''.translateValue($key, $val)." |
'.$g." | |
'.translateField($key).' | '. ''.translateValue($key, $val)." |