Files
WMS/Modules/Platform/resources/views/dashboard/index.blade.php
T
2026-06-19 11:25:50 +01:00

129 lines
8.7 KiB
PHP

<x-layouts.app :title="__('Platform Dashboard')">
<div class="space-y-6">
<x-wms.page-hero
title="Platform Dashboard"
description="System-level tenant, licence, pricing and operational oversight for the WMS platform."
eyebrow="Platform Administration"
/>
<section class="grid gap-4 md:grid-cols-2 xl:grid-cols-5">
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-950">
<p class="text-sm font-medium text-slate-500 dark:text-slate-400">Companies</p>
<p class="mt-2 text-3xl font-semibold text-slate-950 dark:text-white">{{ number_format($companiesCount ?? 0) }}</p>
</article>
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-950">
<p class="text-sm font-medium text-slate-500 dark:text-slate-400">Active</p>
<p class="mt-2 text-3xl font-semibold text-emerald-700 dark:text-emerald-300">{{ number_format($activeCompaniesCount ?? 0) }}</p>
</article>
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-950">
<p class="text-sm font-medium text-slate-500 dark:text-slate-400">Warehouses</p>
<p class="mt-2 text-3xl font-semibold text-slate-950 dark:text-white">{{ number_format($warehousesCount ?? 0) }}</p>
</article>
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-950">
<p class="text-sm font-medium text-slate-500 dark:text-slate-400">Prices</p>
<p class="mt-2 text-3xl font-semibold text-slate-950 dark:text-white">{{ number_format($pricesCount ?? 0) }}</p>
</article>
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-950">
<p class="text-sm font-medium text-slate-500 dark:text-slate-400">Licences</p>
<p class="mt-2 text-3xl font-semibold text-slate-950 dark:text-white">{{ number_format($licensesCount ?? 0) }}</p>
</article>
</section>
<section class="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-950">
<div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div>
<h2 class="text-lg font-semibold text-slate-950 dark:text-white">Pricing plans</h2>
<p class="mt-1 text-sm text-slate-500 dark:text-slate-400">Public pricing cards remain visible from the Platform dashboard, while CRUD stays under Administration.</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ route('platform.pricing.index') }}" class="rounded-lg border border-blue-200 px-3 py-2 text-sm font-semibold text-blue-700 hover:bg-blue-50 dark:border-blue-800 dark:text-blue-300 dark:hover:bg-blue-950/40">Public pricing</a>
<a href="{{ route('platform.prices.index') }}" class="rounded-lg bg-blue-600 px-3 py-2 text-sm font-semibold text-white hover:bg-blue-700">Manage prices</a>
</div>
</div>
<div class="mt-5 grid gap-4 md:grid-cols-3">
@forelse (($prices ?? collect())->take(3) as $price)
<article class="rounded-xl border border-slate-200 p-4 dark:border-slate-800">
<div class="flex items-start justify-between gap-3">
<div>
<h3 class="font-semibold text-slate-950 dark:text-white">{{ $price->name }}</h3>
<p class="mt-1 text-sm text-slate-500 dark:text-slate-400">{{ $price->strapline ?? 'WMS platform plan' }}</p>
</div>
@if (! empty($price->badge_label))
<span class="rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-semibold text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300">{{ $price->badge_label }}</span>
@endif
</div>
<p class="mt-4 text-2xl font-bold text-slate-950 dark:text-white">
{{ strtoupper($price->currency ?? 'GBP') }} {{ number_format(((int) ($price->monthly_amount ?? 0)) / 100, 2) }}
</p>
<p class="text-sm text-slate-500 dark:text-slate-400">per month</p>
@php($features = is_array($price->features ?? null) ? $price->features : [])
@if ($features !== [])
<ul class="mt-4 space-y-2 text-sm text-slate-600 dark:text-slate-300">
@foreach (array_slice($features, 0, 3) as $feature)
<li>✓ {{ $feature }}</li>
@endforeach
</ul>
@endif
</article>
@empty
<article class="rounded-xl border border-dashed border-slate-300 p-4 text-sm text-slate-500 dark:border-slate-700 dark:text-slate-400 md:col-span-3">
No active pricing plans have been configured yet.
</article>
@endforelse
</div>
</section>
<section class="grid gap-6 xl:grid-cols-3">
<article class="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-950 xl:col-span-1">
<h2 class="text-lg font-semibold text-slate-950 dark:text-white">Administration shortcuts</h2>
<div class="mt-4 grid gap-3">
<a href="{{ route('platform.companies.index') }}" class="rounded-xl border border-slate-200 p-3 text-sm font-semibold hover:bg-slate-50 dark:border-slate-800 dark:hover:bg-slate-900">Manage companies</a>
<a href="{{ route('platform.prices.index') }}" class="rounded-xl border border-slate-200 p-3 text-sm font-semibold hover:bg-slate-50 dark:border-slate-800 dark:hover:bg-slate-900">Manage prices</a>
<a href="{{ route('platform.pricing.index') }}" class="rounded-xl border border-slate-200 p-3 text-sm font-semibold hover:bg-slate-50 dark:border-slate-800 dark:hover:bg-slate-900">View public pricing</a>
</div>
</article>
<article class="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-950 xl:col-span-2">
<h2 class="text-lg font-semibold text-slate-950 dark:text-white">Recent companies</h2>
<div class="mt-4 overflow-hidden rounded-xl border border-slate-200 dark:border-slate-800">
<table class="min-w-full divide-y divide-slate-200 text-sm dark:divide-slate-800">
<thead class="bg-slate-50 text-left text-xs uppercase tracking-wide text-slate-500 dark:bg-slate-900 dark:text-slate-400">
<tr>
<th class="px-4 py-3">Company</th>
<th class="px-4 py-3">Users</th>
<th class="px-4 py-3">Warehouses</th>
<th class="px-4 py-3">Licences</th>
<th class="px-4 py-3">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-200 dark:divide-slate-800">
@forelse (($companies ?? collect()) as $company)
<tr>
<td class="px-4 py-3 font-medium text-slate-950 dark:text-white">{{ $company->name }}</td>
<td class="px-4 py-3">{{ $company->users_count ?? 0 }}</td>
<td class="px-4 py-3">{{ $company->warehouses_count ?? 0 }}</td>
<td class="px-4 py-3">{{ $company->license_keys_count ?? 0 }}</td>
<td class="px-4 py-3">{{ ucfirst($company->status ?? 'active') }}</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-4 py-6 text-center text-slate-500 dark:text-slate-400">No companies have been created yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</article>
</section>
</div>
</x-layouts.app>