diff --git a/app/Http/Controllers/Hosting/HostingProductController.php b/app/Http/Controllers/Hosting/HostingProductController.php index f8a80d8..1e1056d 100644 --- a/app/Http/Controllers/Hosting/HostingProductController.php +++ b/app/Http/Controllers/Hosting/HostingProductController.php @@ -172,6 +172,14 @@ class HostingProductController extends Controller CustomerHostingOrder::CYCLE_YEARLY => 'Yearly (12 months)', ]; + $pendingStatuses = ['pending_payment', 'pending_approval', 'approved', 'provisioning']; + $heroStats = [ + 'total' => $orders->count() + $rcServiceOrders->count(), + 'active' => $orders->where('status', 'active')->count() + $rcServiceOrders->where('status', 'active')->count(), + 'pending' => $orders->whereIn('status', $pendingStatuses)->count() + $rcServiceOrders->whereIn('status', $pendingStatuses)->count(), + 'plans' => $products->count(), + ]; + return view('hosting.server-type', [ 'title' => $title, 'type' => $type, @@ -182,6 +190,7 @@ class HostingProductController extends Controller 'serverOrderPayloads' => $serverOrderPayloads, 'billingCycles' => $billingCycles, 'userDomains' => $userDomains, + 'heroStats' => $heroStats, ]); } diff --git a/resources/css/app.css b/resources/css/app.css index 16f9abf..d387698 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -69,6 +69,16 @@ } } +.mobile-stats-card { + width: calc(66.666667% - 0.5rem); +} + +@media (min-width: 640px) { + .mobile-stats-card { + width: auto; + } +} + /* Ladill app launcher — cap at 5 rows (15 apps), always-visible scroll indicator */ .ladill-launcher-apps-wrap { position: relative; diff --git a/resources/views/components/servers/page-hero.blade.php b/resources/views/components/servers/page-hero.blade.php new file mode 100644 index 0000000..47e2daa --- /dev/null +++ b/resources/views/components/servers/page-hero.blade.php @@ -0,0 +1,47 @@ +@props([ + 'badge', + 'title', + 'description' => null, + 'stats' => [], +]) + +@php + $statCols = match (count($stats)) { + 4 => 'sm:grid-cols-2 lg:grid-cols-4', + 2 => 'sm:grid-cols-2', + default => 'sm:grid-cols-3', + }; +@endphp + +
{{ $description }}
+ @endif + @isset($actions) +Manage your {{ strtolower($title) }} orders.
-