Files
ladill-pos/resources/views/pos/devices/index.blade.php
T
isaacclad 4546c2ab8c
Deploy Ladill POS / deploy (push) Successful in 29s
Move Devices under Settings like Branches and Team.
Drop Devices from the main sidebar, surface a Devices card on the Settings
page, and nest device routes under /settings/devices with legacy redirects.
2026-07-15 23:56:03 +00:00

80 lines
4.9 KiB
PHP

<x-app-layout title="Devices">
<x-settings.page description="Register tills, customer screens, kitchen displays, and printers for each branch.">
<div class="mb-4 flex flex-wrap items-center justify-between gap-3 text-sm">
<div class="flex flex-wrap items-center gap-1 text-slate-500">
<a href="{{ route('pos.settings') }}" class="hover:text-slate-800">Settings</a>
<span class="px-1">/</span>
<span class="font-medium text-slate-900">Devices</span>
</div>
<a href="{{ route('pos.devices.create') }}" class="btn-primary">Add device</a>
</div>
<div class="mb-6 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="mb-4 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="mb-4 rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-800">{{ session('error') }}</div>
@endif
<x-settings.card title="All devices" description="Hardware registered to this POS account.">
<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-1 pt-3">{{ $devices->links() }}</div>
@endif
</x-settings.card>
</x-settings.page>
</x-app-layout>