diff --git a/api/index.php b/api/index.php index 8ae6518..e49a006 100644 --- a/api/index.php +++ b/api/index.php @@ -27,11 +27,11 @@ function translateField($key) $intl['VER'] = 'Version'; $intl['ALGO'] = 'Algorithm'; - $intl['KHS'] = 'Hashrate (kH/s)'; + $intl['KHS'] = 'Hash rate (kH/s)'; $intl['ACC'] = 'Accepted shares'; $intl['ACCMN'] = 'Accepted / mn'; $intl['REJ'] = 'Rejected'; - $intl['UPTIME'] = 'Miner uptime'; + $intl['UPTIME'] = 'Miner up time'; $intl['TEMP'] = 'T°c'; $intl['FAN'] = 'Fan %'; @@ -42,27 +42,50 @@ function translateField($key) 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).' | '. - ''.$val." |
'.$g." | |
'.translateField($key).' | '. - ''.$val." |
'.translateField($key).' | '. + ''.translateValue($key, $val)." |
'.$g." | |
'.translateField($key).' | '. + ''.translateValue($key, $val)." |