diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 7185752..2790953 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -119,10 +119,10 @@ class ServerController extends Controller 'location_id' => $request->location_id, 'ram' => $request->ram, 'ram_type' => $request->ram_type, - 'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram / 1000), + 'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram * 1024), 'disk' => $request->disk, 'disk_type' => $request->disk_type, - 'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1000), + 'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1024), 'owned_since' => $request->owned_since, 'ns1' => $request->ns1, 'ns2' => $request->ns2, @@ -268,10 +268,10 @@ class ServerController extends Controller 'location_id' => $request->location_id, 'ram' => $request->ram, 'ram_type' => $request->ram_type, - 'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram / 1000), + 'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram * 1024), 'disk' => $request->disk, 'disk_type' => $request->disk_type, - 'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1000), + 'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1024), 'owned_since' => $request->owned_since, 'ns1' => $request->ns1, 'ns2' => $request->ns2, diff --git a/app/Http/Controllers/YabsController.php b/app/Http/Controllers/YabsController.php index e2f8e7b..ac885cb 100644 --- a/app/Http/Controllers/YabsController.php +++ b/app/Http/Controllers/YabsController.php @@ -101,10 +101,10 @@ class YabsController extends Controller ->update([ 'ram' => $yabs['ram'], 'ram_type' => $yabs['ram_type'], - 'ram_as_mb' => ($yabs['ram_type'] === 'GB') ? ($yabs['ram'] * 1000) : $yabs['ram'], + 'ram_as_mb' => ($yabs['ram_type'] === 'GB') ? ($yabs['ram'] * 1024) : $yabs['ram'], 'disk' => $yabs['disk'], 'disk_type' => $yabs['disk_type'], - 'disk_as_gb' => ($yabs['disk_type'] === 'TB') ? ($yabs['disk'] * 1000) : $yabs['disk'], + 'disk_as_gb' => ($yabs['disk_type'] === 'TB') ? ($yabs['disk'] * 1024) : $yabs['disk'], 'cpu' => $yabs['cpu_cores'], 'has_yabs' => 1 ]); diff --git a/app/Process.php b/app/Process.php index 9707472..8e1f048 100644 --- a/app/Process.php +++ b/app/Process.php @@ -94,9 +94,9 @@ class Process private function GBpstoMBps(string $gbps, bool $format = false): float {//Gigabits to Megabits if ($format) { - return (float)number_format(((float)$gbps * 1000), 3); + return (float)number_format(((float)$gbps * 1024), 3); } - return (float)$gbps * 1000; + return (float)$gbps * 1024; } private function diskSpeedAsMbps(string $type, string $value): float @@ -105,7 +105,7 @@ class Process return $this->GBpstoMBps($value); } if ($type === "KB/s") { - return (float)($value / 1000); + return (float)($value / 1024); } return $value; } diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 7844415..de86b84 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -146,7 +146,7 @@
-

{{$information['servers_summary']['ram_mb_sum'] / 1000}} {{$information['servers_summary']['ram_mb_sum'] / 1024}} GB

Ram

@@ -159,7 +159,7 @@

@if($information['servers_summary']['disk_gb_sum'] >= 1000) - {{$information['servers_summary']['disk_gb_sum'] / 1000}} TB @else {{$information['servers_summary']['disk_gb_sum']}}
-

{{$information['servers_summary']['bandwidth_sum'] / 1000}} {{$information['servers_summary']['bandwidth_sum'] / 1024}} TB

Bandwidth

diff --git a/resources/views/servers/index.blade.php b/resources/views/servers/index.blade.php index 57c8590..fd5bc36 100644 --- a/resources/views/servers/index.blade.php +++ b/resources/views/servers/index.blade.php @@ -148,14 +148,14 @@ {{$server->cpu}} @if($server->ram_as_mb > 1024) - {{ number_format(($server->ram_as_mb / 1000),0) }}GB + {{ number_format(($server->ram_as_mb / 1024),0) }}GB @else {{$server->ram_as_mb}}MB @endif @if($server->disk > 1000) - {{ number_format(($server->disk / 1000),1) }}TB + {{ number_format(($server->disk / 1024),1) }}TB @else {{$server->disk}}GB @endif diff --git a/resources/views/servers/public-index.blade.php b/resources/views/servers/public-index.blade.php index e0bc890..8a4f3ea 100644 --- a/resources/views/servers/public-index.blade.php +++ b/resources/views/servers/public-index.blade.php @@ -58,7 +58,7 @@ @if($s->disk > 1000) - {{ number_format(($s->disk / 1000),1) }}TB + {{ number_format(($s->disk / 1024),1) }}TB @else {{$s->disk}}GB @endif