Files
ladill-frontdesk/resources/views/frontdesk/audit/index.blade.php
T
isaaccladandCursor f46bebc1e3
Deploy Ladill Frontdesk / deploy (push) Successful in 55s
Unify Frontdesk secondary actions with shared button variants.
Add warning, danger, and link button styles plus x-btn and x-danger-zone components so ghost text actions match the primary pill UI across edit screens and tables.

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

58 lines
3.0 KiB
PHP

<x-app-layout title="Audit log">
<div class="flex items-center justify-between">
<div>
<h1 class="text-xl font-semibold text-slate-900">Audit log</h1>
<p class="text-sm text-slate-500">Security and compliance activity</p>
</div>
@if ($canExport)
<x-btn href="{{ route('frontdesk.audit.export', request()->query()) }}" variant="secondary" size="sm">Export CSV</x-btn>
@endif
</div>
<form method="GET" class="mt-4 grid gap-2 sm:grid-cols-4">
<input type="search" name="q" value="{{ request('q') }}" placeholder="Search…" class="rounded-lg border-slate-300 text-sm">
<select name="action" class="rounded-lg border-slate-300 text-sm">
<option value="">All actions</option>
@foreach ($actions as $key => $label)
<option value="{{ $key }}" @selected(request('action') === $key)>{{ $label }}</option>
@endforeach
</select>
<input type="date" name="from" value="{{ request('from') }}" class="rounded-lg border-slate-300 text-sm">
<input type="date" name="to" value="{{ request('to') }}" class="rounded-lg border-slate-300 text-sm">
<x-btn type="submit" variant="secondary" size="sm" class="sm:col-span-4 sm:w-fit">Filter</x-btn>
</form>
<div class="mt-4 overflow-hidden rounded-2xl border border-slate-200 bg-white">
<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">Time</th>
<th class="px-4 py-3">Action</th>
<th class="px-4 py-3">Actor</th>
<th class="px-4 py-3">Details</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-50">
@forelse ($logs as $log)
<tr class="@if(str_starts_with($log->action, 'watchlist.')) bg-amber-50/40 @endif">
<td class="px-4 py-3 whitespace-nowrap text-slate-500">{{ $log->created_at?->format('M j, g:i A') }}</td>
<td class="px-4 py-3 font-medium">{{ $actions[$log->action] ?? $log->action }}</td>
<td class="px-4 py-3 text-slate-600">{{ $log->actor_ref ?? 'System' }}</td>
<td class="px-4 py-3 text-slate-600">
@if ($log->metadata)
{{ collect($log->metadata)->except('_awaiting_approval')->map(fn ($v, $k) => "$k: $v")->join(' · ') }}
@else
@endif
</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-8 text-center text-slate-400">No audit entries found.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-4">{{ $logs->links() }}</div>
</x-app-layout>