Files
ladill-frontdesk/resources/views/frontdesk/devices/edit.blade.php
T
isaaccladandCursor 42e93a1744
Deploy Ladill Frontdesk / deploy (push) Successful in 1m44s
Make danger-zone action buttons full width like form footers.
Device and employee edit pages now stretch Regenerate/Remove actions across the row on wider screens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 06:37:48 +00:00

93 lines
5.0 KiB
PHP

<x-app-layout title="Edit device">
<div class="mx-auto max-w-lg">
<h1 class="text-xl font-semibold text-slate-900">Edit device</h1>
<form method="POST" action="{{ route('frontdesk.devices.update', $device) }}" class="mt-6 space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
@csrf @method('PUT')
<div>
<label class="block text-sm font-medium">Name</label>
<input type="text" name="name" value="{{ old('name', $device->name) }}" required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
<x-frontdesk.device-type-field :device-types="$deviceTypes" :selected="$device->type" />
<div>
<label class="block text-sm font-medium">Status</label>
<select name="status" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
@foreach (['online', 'offline', 'maintenance'] as $status)
<option value="{{ $status }}" @selected(old('status', $device->status) === $status)>{{ ucfirst($status) }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-sm font-medium">Branch</label>
<select name="branch_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
<option value="">All branches</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(old('branch_id', $device->branch_id) == $branch->id)>{{ $branch->name }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-sm font-medium">Reception desk</label>
<select name="reception_desk_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
<option value="">None</option>
@foreach ($desks as $desk)
<option value="{{ $desk->id }}" @selected(old('reception_desk_id', $device->reception_desk_id) == $desk->id)>{{ $desk->name }}</option>
@endforeach
</select>
</div>
@if ($device->device_token)
<div class="rounded-lg bg-slate-50 p-3">
<p class="text-xs font-medium uppercase text-slate-500">Device token</p>
<code class="mt-1 block break-all text-xs text-slate-700">{{ $device->device_token }}</code>
@if ($device->type === 'kiosk')
<x-btn
:href="route('frontdesk.kiosk.device', $device->device_token)"
target="_blank"
variant="link"
size="sm"
plain
class="mt-2"
>Open kiosk URL</x-btn>
@if (! empty($kioskQrSvg))
<div class="mt-4 rounded-xl border border-slate-200 bg-white p-4 text-center">
<p class="text-sm font-medium text-slate-900">Provision Ladill Kiosk app</p>
<p class="mt-1 text-xs text-slate-500">Scan with the tablet on first boot to link this device.</p>
<div class="mx-auto mt-3 inline-block">{!! $kioskQrSvg !!}</div>
</div>
@endif
@endif
</div>
@endif
<div class="flex gap-3 pt-2">
<x-btn href="{{ route('frontdesk.devices.index') }}" variant="secondary" class="flex-1 justify-center">Back</x-btn>
<x-btn type="submit" class="flex-1">Save</x-btn>
</div>
</form>
@if ($device->device_token)
<x-danger-zone title="Device actions" class="mt-4">
<form method="POST" action="{{ route('frontdesk.devices.regenerate-token', $device) }}">
@csrf
<x-btn
type="submit"
variant="warning"
onclick="return confirm('Regenerate token? Existing kiosk sessions will stop working.')"
>Regenerate token</x-btn>
</form>
<form method="POST" action="{{ route('frontdesk.devices.destroy', $device) }}" onsubmit="return confirm('Remove this device?')">
@csrf @method('DELETE')
<x-btn type="submit" variant="danger">Remove device</x-btn>
</form>
</x-danger-zone>
@else
<form method="POST" action="{{ route('frontdesk.devices.destroy', $device) }}" class="mt-4" onsubmit="return confirm('Remove this device?')">
@csrf @method('DELETE')
<x-danger-zone title="Device actions">
<x-btn type="submit" variant="danger">Remove device</x-btn>
</x-danger-zone>
</form>
@endif
</div>
</x-app-layout>