Files
ladill-queue/resources/views/qms/devices/index.blade.php
T
isaaccladandCursor bf879d6abe
Deploy Ladill Queue / deploy (push) Successful in 36s
Add hero sections to Queue index pages and soften analytics cards.
Introduce shared x-qms.page-hero with summary stats across queues,
tickets, counters, admin pages, and insights; remove bordered cards on
Analytics, Reports, Feedback, and Branches list views.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 07:32:10 +00:00

84 lines
4.7 KiB
PHP

<x-app-layout title="Devices">
<div class="space-y-6">
<x-qms.page-hero
badge="Kiosks · Printers · Self-service"
title="Devices"
description="Kiosks and ticket printers for self-service check-in and reception — register devices and open kiosk mode from here."
:stats="[
['value' => number_format($heroStats['total']), 'label' => 'Devices'],
['value' => number_format($heroStats['online']), 'label' => 'Online'],
['value' => number_format($heroStats['kiosks']), 'label' => 'Kiosks'],
]">
@if ($canManage)
<x-slot name="actions">
<a href="{{ route('qms.devices.create') }}" class="btn-primary">Register device</a>
</x-slot>
@endif
</x-qms.page-hero>
@if (session('success'))
<div class="rounded-lg bg-emerald-50 px-4 py-3 text-sm text-emerald-800">{{ session('success') }}</div>
@endif
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
@if ($devices->isEmpty())
<x-empty-state
title="No devices registered yet"
description="Register a kiosk tablet or ticket printer so customers can join queues without staff assistance."
>
<x-slot:icon>
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21" />
</svg>
</x-slot:icon>
@if ($canManage)
<x-slot:action>
<a href="{{ route('qms.devices.create') }}" class="btn-primary">Register your first device</a>
</x-slot:action>
@endif
</x-empty-state>
@else
<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"></th>
</tr>
</thead>
<tbody class="divide-y divide-slate-50">
@foreach ($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->status === 'online' ? 'bg-emerald-100 text-emerald-800' : 'bg-slate-100 text-slate-600' }}">
{{ ucfirst($device->status) }}
</span>
</td>
<td class="px-4 py-3 text-slate-600">{{ $device->branch?->name ?? '—' }}</td>
<td class="px-4 py-3 text-right">
@if ($device->type === 'kiosk' && $device->device_token)
<a href="{{ route('qms.kiosk.device', $device->device_token) }}" target="_blank" class="text-indigo-700 hover:underline">Open kiosk</a>
@endif
@if ($canManage)
<form method="POST" action="{{ route('qms.devices.regenerate-token', $device) }}" class="ml-3 inline">
@csrf
<button type="submit" class="text-indigo-700 hover:underline">Regenerate token</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="border-t border-slate-200 px-4 py-3">
{{ $devices->links() }}
</div>
@endif
</div>
</div>
</x-app-layout>