Files
ladill-frontdesk/resources/views/frontdesk/devices/index.blade.php
T
isaaccladandCursor f995606649
Deploy Ladill Frontdesk / deploy (push) Successful in 1m3s
Add hero sections to Visits, Hosts, Employees, Devices, Branches, and Team index pages.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:45:30 +00:00

74 lines
4.2 KiB
PHP

<x-app-layout title="Devices">
<div class="space-y-6">
<x-frontdesk.page-hero
badge="Kiosks · Printers · Reception hardware"
title="Devices"
description="Register and monitor kiosks, badge printers, and reception hardware across your branches."
: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('frontdesk.devices.create') }}" class="btn-primary">
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
Add device
</a>
</x-slot>
@endif
</x-frontdesk.page-hero>
<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>
<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">Desk / 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">{{ $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->receptionDesk?->name ?? '—' }}
@if ($device->branch)
<span class="text-slate-400">· {{ $device->branch->name }}</span>
@endif
</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">
@if ($canManage)
<a href="{{ route('frontdesk.devices.edit', $device) }}" class="text-indigo-700 hover:underline">Edit</a>
@endif
@if ($device->type === 'kiosk' && $device->device_token)
<a href="{{ route('frontdesk.kiosk.device', $device->device_token) }}" target="_blank" class="ml-3 text-indigo-700 hover:underline">Open kiosk</a>
@endif
</td>
</tr>
@empty
<tr><td colspan="6" class="px-4 py-8 text-center text-slate-500">No devices registered yet.</td></tr>
@endforelse
</tbody>
</table>
@if ($devices->hasPages())
<div class="border-t border-slate-100 px-5 py-3">{{ $devices->links() }}</div>
@endif
</div>
</div>
</x-app-layout>