@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if ($request->query('displayFormat') == 'human') { |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - return $devices; |
|
| 34 | + return $devices; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -45,13 +45,13 @@ |
||
| 45 | 45 | // TODO: move to a common file |
| 46 | 46 | // base = 1024 for bits, 1000 for mibibits |
| 47 | 47 | function formatBps($bits, $precision = 2, $base=1000) { |
| 48 | - $units = array('bps', 'Kbps', 'Mbps', 'Gbps', 'Tbps'); |
|
| 48 | + $units = array('bps', 'Kbps', 'Mbps', 'Gbps', 'Tbps'); |
|
| 49 | 49 | |
| 50 | - $bits = max($bits, 0); |
|
| 51 | - $pow = floor(($bits ? log($bits) : 0) / log($base)); |
|
| 52 | - $pow = min($pow, count($units) - 1); |
|
| 50 | + $bits = max($bits, 0); |
|
| 51 | + $pow = floor(($bits ? log($bits) : 0) / log($base)); |
|
| 52 | + $pow = min($pow, count($units) - 1); |
|
| 53 | 53 | |
| 54 | - $bits /= pow($base, $pow); |
|
| 54 | + $bits /= pow($base, $pow); |
|
| 55 | 55 | |
| 56 | 56 | return round($bits, $precision) . ' ' . $units[$pow]; |
| 57 | 57 | } |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | class ApiController extends Controller |
| 12 | 12 | { |
| 13 | 13 | /** |
| 14 | - * Get info about the install |
|
| 15 | - */ |
|
| 14 | + * Get info about the install |
|
| 15 | + */ |
|
| 16 | 16 | public function get_info() |
| 17 | 17 | { |
| 18 | 18 | $versions['git'] = `git rev-parse --short HEAD`; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Get statistics about the install |
| 31 | - **/ |
|
| 31 | + **/ |
|
| 32 | 32 | public function get_stats() |
| 33 | 33 | { |
| 34 | 34 | $stats['devices'] = DB::select('SELECT COUNT(device_id) AS `total` FROM `devices`')[0]->total; |