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 + +
merge(['class' => 'relative overflow-hidden rounded-2xl border border-slate-200 bg-white']) }}> +
+
+
+
+
+ {{ $badge }} +
+

{{ $title }}

+ @if ($description) +

{{ $description }}

+ @endif + @isset($actions) +
+ {{ $actions }} +
+ @endisset +
+ + @if (count($stats) > 0) +
+ @foreach ($stats as $stat) +
+

{{ $stat['value'] }}

+

{{ $stat['label'] }}

+
+ @endforeach +
+ @endif +
+
+
diff --git a/resources/views/hosting/server-type.blade.php b/resources/views/hosting/server-type.blade.php index 96363df..07babb9 100644 --- a/resources/views/hosting/server-type.blade.php +++ b/resources/views/hosting/server-type.blade.php @@ -85,20 +85,24 @@ @endphp
- {{-- Page Header --}} -
-
-

{{ $title }}

-

Manage your {{ strtolower($title) }} orders.

-
+ @if ($serverOrderPayloads !== []) - + + {{ $orderButtonLabel }} + @endif -
+ @if ($hasAnyProducts)