@extends('layouts.app') @section('title', 'Audit Logs — ' . config('app.name')) @section('content')

Audit Logs

Log login, aksi admin, API, serta akses UI (browser, durasi halaman).

@include('partials.flash') @if ($error)
{{ $error }}
@endif @if (!empty($uiStats['page_views']) || !empty($uiStats['page_durations']))

UI Access Count (7 hari)

@forelse ($uiStats['page_views'] as $row)
{{ $row['path'] }} {{ $row['count'] }}×
@empty

Belum ada data page view.

@endforelse

UI Duration (7 hari)

@forelse ($uiStats['page_durations'] as $row)
{{ $row['path'] }} avg {{ $row['avg_seconds'] }}s · {{ $row['visits'] }} visit · total {{ gmdate('i\m s\s', $row['total_seconds']) }}
@empty

Belum ada data durasi.

@endforelse
@endif
{{ count($logs) }} entries · PG {{ $available ? 'connected' : 'unavailable' }}
@forelse ($logs as $log) @php $client = $log->metadata['client'] ?? []; $clientLine = collect([ isset($client['browser']) ? $client['browser'].($client['browser_version'] ?? '' ? ' '.$client['browser_version'] : '') : null, isset($client['os']) ? $client['os'].($client['os_version'] ?? '' ? ' '.$client['os_version'] : '') : null, ])->filter()->implode(' · '); $durationSec = $log->metadata['duration_seconds'] ?? null; @endphp @empty @endforelse
Time Type CRUD / Event User / Client IP Client Action Resource Duration
{{ $log->occurred_at?->format('Y-m-d H:i:s') }} {{ strtoupper($log->actor_type) }} {{ $log->metadata['event'] ?? ($log->metadata['crud'] ?? ($log->metadata['http_method'] ?? '—')) }} {{ $log->actor_username ?? '—' }} @if ($log->actor_client)
{{ $log->actor_client }}
@endif
@if ($log->ip_address) {{ $log->ip_address }} @php $scope = $log->metadata['ip_scope'] ?? null; @endphp @if ($scope) {{ $scope === 'public' ? 'Publik' : ($scope === 'private' ? 'Lokal' : ($scope === 'localhost' ? 'Localhost' : $scope)) }} @endif @if (!empty($client['webrtc_ip']) && $client['webrtc_ip'] !== $log->ip_address)
RTC: {{ $client['webrtc_ip'] }}
@endif @else @endif
@if ($clientLine !== '')
{{ $clientLine }}
@endif @if (!empty($client['screen']))
{{ $client['screen'] }}
@endif @if (!empty($client['cpu_cores']))
{{ $client['cpu_cores'] }} cores@if(!empty($client['device_memory_gb'])) · {{ $client['device_memory_gb'] }} GB RAM@endif
@endif @if (!empty($client['gpu']))
GPU: {{ Str::limit($client['gpu'], 28) }}
@endif @if (!empty($client['language']) || !empty($client['timezone']))
{{ $client['language'] ?? '' }}@if(!empty($client['timezone'])) · {{ $client['timezone'] }}@endif
@endif @if ($clientLine === '' && empty($client['screen'])) @endif
{{ $log->action }} {{ $log->resource ?? $log->path ?? '—' }} @if ($durationSec !== null) {{ $durationSec }}s @else — @endif
No audit logs yet.
@endsection