diff --git a/README.md b/README.md index 565ea71..ab5d3bb 100644 --- a/README.md +++ b/README.md @@ -161,18 +161,18 @@ or ## Screenshots for v2 -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-home.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-home.jpg) +[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-home-2.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-home-2.jpg) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-server-view.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-server-view.jpg) +[![My idlers screenshot2](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-server-view.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-server-view.jpg) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-home.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-home.jpg) +[![My idlers screenshot3](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-home.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-home.jpg) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-YABs.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-YABs.jpg) +[![My idlers screenshot4](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-YABs.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-YABs.jpg) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-add-server_2.png)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-add-server_2.png) +[![My idlers screenshot5](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-add-server_2.png)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-add-server_2.png) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-compare.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-compare.jpg) +[![My idlers screenshot6](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-compare.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-servers-compare.jpg) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-Ips.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-Ips.jpg) +[![My idlers screenshot7](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-Ips.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-Ips.jpg) -[![My idlers screenshot1](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-labels.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-labels.jpg) +[![My idlers screenshot8](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-labels.jpg)](https://cdn.write.corbpie.com/wp-content/uploads/2022/03/My-idlers-v2-labels.jpg) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 8a26408..a8b43a4 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -50,6 +50,22 @@ class HomeController extends Controller ->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']); }); + $server_summary = Cache::remember('servers_summary', 1440, function () { + $cpu_sum = DB::table('servers')->get()->where('active', '=', 1)->sum('cpu'); + $ram_mb = DB::table('servers')->get()->where('active', '=', 1)->sum('ram_as_mb'); + $disk_gb = DB::table('servers')->get()->where('active', '=', 1)->sum('disk_as_gb'); + $bandwidth = DB::table('servers')->get()->where('active', '=', 1)->sum('bandwidth'); + $locations_sum = DB::table('servers')->get()->where('active', '=', 1)->groupBy('location_id')->count(); + $providers_sum = DB::table('servers')->get()->where('active', '=', 1)->groupBy('provider_id')->count(); + return array( + 'cpu_sum' => $cpu_sum, + 'ram_mb_sum' => $ram_mb, + 'disk_gb_sum' => $disk_gb, + 'bandwidth_sum' => $bandwidth, + 'locations_sum' => $locations_sum, + 'providers_sum' => $providers_sum, + ); + }); //Check for past due date and refresh the due date if so: $pricing = new Pricing(); @@ -168,7 +184,8 @@ class HomeController extends Controller 'total_cost_2_yearly' => number_format(($total_cost_yearly * 2), 2), 'due_soon' => $due_soon, 'newest' => $recently_added, - 'execution_time' => number_format($p->getTimeTaken(), 2) + 'execution_time' => number_format($p->getTimeTaken(), 2), + 'servers_summary' => $server_summary ); return view('home', compact('information')); diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index a3101e1..16596af 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -184,6 +184,7 @@ class ServerController extends Controller Cache::forget('recently_added');//Main page recently_added cache Cache::forget('all_active_servers');//all servers cache Cache::forget('non_active_servers');//all servers cache + Cache::forget('servers_summary');//servers summary cache return redirect()->route('servers.index') ->with('success', 'Server Created Successfully.'); @@ -327,6 +328,7 @@ class ServerController extends Controller Cache::forget('recently_added');//Main page recently_added cache Cache::forget('all_active_servers');//all servers cache Cache::forget('non_active_servers');//all servers cache + Cache::forget('servers_summary');//servers summary cache return redirect()->route('servers.index') ->with('success', 'Server Updated Successfully.'); @@ -350,6 +352,7 @@ class ServerController extends Controller Cache::forget('recently_added');//Main page recently_added cache Cache::forget('all_active_servers');//all servers cache Cache::forget('non_active_servers');//all servers cache + Cache::forget('servers_summary');//servers summary cache return redirect()->route('servers.index') ->with('success', 'Server was deleted Successfully.'); diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 079229c..0e5e563 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -131,6 +131,79 @@ +
+
+
+
+
+

{{$information['servers_summary']['cpu_sum']}}

+

CPU

+
+
+
+
+
+
+
+
+

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

+

Ram

+
+
+
+
+
+
+
+
+

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

+

Disk

+
+
+
+
+
+
+
+
+

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

+

Bandwidth

+
+
+
+
+
+
+
+
+

{{$information['servers_summary']['locations_sum']}}

+

Locations

+
+
+
+
+
+
+
+
+

{{$information['servers_summary']['providers_sum']}}

+

Providers

+
+
+
+
+
+

Due soon

@if(!empty($information['due_soon'])) @@ -181,15 +254,25 @@ {{$due_soon->price}} {{$due_soon->currency}} {{\App\Process::paymentTermIntToString($due_soon->term)}} @if($due_soon->service_type === 1) - + @elseif($due_soon->service_type === 2) - + @elseif($due_soon->service_type === 3) - + @elseif($due_soon->service_type === 4) - + @elseif($due_soon->service_type === 5) - + @endif