Polish Queue Devices empty state and align sidebar with other apps.
Deploy Ladill Queue / deploy (push) Successful in 38s
Deploy Ladill Queue / deploy (push) Successful in 38s
Match Care/Frontdesk nav icon styling, admin icons, and settings footer; add proper table layouts and empty states for Devices and Displays. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,22 +1,75 @@
|
||||
<x-app-layout title="Devices">
|
||||
<div class="mb-6 flex justify-between">
|
||||
<h1 class="text-2xl font-semibold">Devices</h1>
|
||||
<a href="{{ route('qms.devices.create') }}" class="btn-primary">Register device</a>
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-slate-900">Devices</h1>
|
||||
<p class="text-sm text-slate-500">Kiosks and ticket printers for self-service and reception</p>
|
||||
</div>
|
||||
@if ($canManage)
|
||||
<a href="{{ route('qms.devices.create') }}" class="btn-primary">Register device</a>
|
||||
@endif
|
||||
</div>
|
||||
@if (session('success'))<p class="mb-4 rounded-lg bg-emerald-50 px-3 py-2 text-sm text-emerald-800">{{ session('success') }}</p>@endif
|
||||
<div class="space-y-3">
|
||||
@foreach ($devices as $device)
|
||||
<div class="flex items-center justify-between rounded-2xl border bg-white p-4 dark:border-slate-700 dark:bg-slate-900">
|
||||
<div>
|
||||
<p class="font-semibold">{{ $device->name }}</p>
|
||||
<p class="text-sm text-slate-500">{{ config('qms.device_types.'.$device->type) }} · {{ $device->status }}</p>
|
||||
@if ($device->type === 'kiosk' && $device->device_token)
|
||||
<p class="mt-1 text-xs text-slate-400">Kiosk URL: {{ route('qms.kiosk.device', $device->device_token) }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<form method="POST" action="{{ route('qms.devices.regenerate-token', $device) }}">@csrf<button class="btn-secondary text-sm">Regenerate token</button></form>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="mt-4 rounded-lg bg-emerald-50 px-4 py-3 text-sm text-emerald-800">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="mt-4 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>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
{{ $devices->links() }}
|
||||
</x-app-layout>
|
||||
|
||||
Reference in New Issue
Block a user