Deploy Ladill POS / deploy (push) Successful in 42s
Register tills, customer displays, kitchen screens, printers, scanners, and tablets per branch. Customer displays share the branch display token and mark online when the public screen polls; stale devices go offline on a schedule.
83 lines
5.0 KiB
PHP
83 lines
5.0 KiB
PHP
<x-app-layout title="Devices">
|
|
<div class="mx-auto max-w-5xl space-y-6">
|
|
<div class="flex flex-wrap items-end justify-between gap-4">
|
|
<div>
|
|
<p class="text-xs font-semibold uppercase tracking-wider text-indigo-600">Hardware</p>
|
|
<h1 class="mt-1 text-2xl font-semibold text-slate-900">Devices</h1>
|
|
<p class="mt-1 text-sm text-slate-500">Register tills, customer screens, kitchen displays, and printers for each branch.</p>
|
|
</div>
|
|
<a href="{{ route('pos.devices.create') }}" class="btn-primary">Add device</a>
|
|
</div>
|
|
|
|
<div class="grid gap-3 sm:grid-cols-3">
|
|
<div class="rounded-2xl border border-slate-200 bg-white px-5 py-4">
|
|
<p class="text-2xl font-semibold tabular-nums text-slate-900">{{ number_format($heroStats['total']) }}</p>
|
|
<p class="mt-0.5 text-xs font-medium uppercase tracking-wide text-slate-500">Devices</p>
|
|
</div>
|
|
<div class="rounded-2xl border border-slate-200 bg-white px-5 py-4">
|
|
<p class="text-2xl font-semibold tabular-nums text-emerald-600">{{ number_format($heroStats['online']) }}</p>
|
|
<p class="mt-0.5 text-xs font-medium uppercase tracking-wide text-slate-500">Online</p>
|
|
</div>
|
|
<div class="rounded-2xl border border-slate-200 bg-white px-5 py-4">
|
|
<p class="text-2xl font-semibold tabular-nums text-slate-900">{{ number_format($heroStats['displays']) }}</p>
|
|
<p class="mt-0.5 text-xs font-medium uppercase tracking-wide text-slate-500">Displays</p>
|
|
</div>
|
|
</div>
|
|
|
|
@if (session('success'))
|
|
<div class="rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800">{{ session('success') }}</div>
|
|
@endif
|
|
@if (session('error'))
|
|
<div class="rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-800">{{ session('error') }}</div>
|
|
@endif
|
|
|
|
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
|
<div class="border-b border-slate-100 px-6 py-4">
|
|
<h2 class="text-sm font-semibold text-slate-900">All devices</h2>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-slate-100 text-sm">
|
|
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
|
|
<tr>
|
|
<th class="px-4 py-3">Name</th>
|
|
<th class="px-4 py-3">Type</th>
|
|
<th class="px-4 py-3">Status</th>
|
|
<th class="px-4 py-3">Branch</th>
|
|
<th class="px-4 py-3">Last online</th>
|
|
<th class="px-4 py-3"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-50">
|
|
@forelse ($devices as $device)
|
|
<tr>
|
|
<td class="px-4 py-3 font-medium text-slate-900">{{ $device->name }}</td>
|
|
<td class="px-4 py-3 text-slate-600">{{ $deviceTypes[$device->type] ?? $device->type }}</td>
|
|
<td class="px-4 py-3">
|
|
<span class="inline-flex rounded-full px-2 py-0.5 text-xs font-medium {{ $device->isOnline() ? 'bg-emerald-100 text-emerald-800' : 'bg-slate-100 text-slate-600' }}">
|
|
{{ $device->isOnline() ? 'Online' : ucfirst($device->status) }}
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-3 text-slate-600">{{ $device->location?->name ?? '—' }}</td>
|
|
<td class="px-4 py-3 text-slate-500">{{ $device->last_online_at?->diffForHumans() ?? 'Never' }}</td>
|
|
<td class="px-4 py-3 text-right">
|
|
<a href="{{ route('pos.devices.edit', $device) }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">Manage</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="6" class="px-4 py-10 text-center text-slate-500">
|
|
No devices yet.
|
|
<a href="{{ route('pos.devices.create') }}" class="font-medium text-indigo-600 hover:text-indigo-800">Add your first device</a>
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@if ($devices->hasPages())
|
|
<div class="border-t border-slate-100 px-5 py-3">{{ $devices->links() }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|