First commit
This commit is contained in:
100
resources/views/admin/audit-logs/index.blade.php
Normal file
100
resources/views/admin/audit-logs/index.blade.php
Normal file
@@ -0,0 +1,100 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Log Audit')
|
||||
|
||||
@section('breadcrumb')
|
||||
<li class="breadcrumb-item active">Log Audit</li>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex align-items-center justify-content-between mb-4">
|
||||
<h4 class="mb-0 fw-bold">Log Audit Sistem</h4>
|
||||
<small class="text-muted">Log tidak boleh diubah atau dipadam</small>
|
||||
</div>
|
||||
|
||||
{{-- Filter --}}
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-body py-3">
|
||||
<form method="GET" class="row g-2 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<select name="event" class="form-select form-select-sm">
|
||||
<option value="">Semua Event</option>
|
||||
@foreach($eventTypes as $event)
|
||||
<option value="{{ $event }}" {{ request('event') == $event ? 'selected' : '' }}>
|
||||
{{ $event }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input type="date" name="date_from" class="form-control form-control-sm"
|
||||
value="{{ request('date_from') }}" placeholder="Dari">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input type="date" name="date_to" class="form-control form-control-sm"
|
||||
value="{{ request('date_to') }}" placeholder="Hingga">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-search me-1"></i>Tapis
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="ps-3">Event</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Pengguna</th>
|
||||
<th>IP</th>
|
||||
<th>Tarikh</th>
|
||||
<th class="text-end pe-3">Detail</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($logs as $log)
|
||||
<tr>
|
||||
<td class="ps-3">
|
||||
<code class="small" style="font-size:.75rem">{{ $log->event }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<small>{{ $log->description ?? '—' }}</small>
|
||||
</td>
|
||||
<td>
|
||||
<small>{{ $log->user?->name ?? 'Sistem' }}</small>
|
||||
</td>
|
||||
<td>
|
||||
<small class="text-muted">{{ $log->ip_address ?? '—' }}</small>
|
||||
</td>
|
||||
<td>
|
||||
<small class="text-muted" title="{{ $log->created_at->format('d/m/Y H:i:s') }}">
|
||||
{{ $log->created_at->diffForHumans() }}
|
||||
</small>
|
||||
</td>
|
||||
<td class="text-end pe-3">
|
||||
<a href="{{ route('admin.audit-logs.show', $log) }}"
|
||||
class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-info-circle"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="text-center text-muted py-5">Tiada log ditemui.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if($logs->hasPages())
|
||||
<div class="card-footer bg-white border-top py-3">
|
||||
{{ $logs->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
57
resources/views/admin/audit-logs/show.blade.php
Normal file
57
resources/views/admin/audit-logs/show.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Log Audit Detail')
|
||||
|
||||
@section('breadcrumb')
|
||||
<li class="breadcrumb-item"><a href="{{ route('admin.audit-logs.index') }}">Log Audit</a></li>
|
||||
<li class="breadcrumb-item active">#{{ $auditLog->id }}</li>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-header bg-white border-bottom">
|
||||
<h6 class="mb-0 fw-semibold">Log Audit #{{ $auditLog->id }}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-3 text-muted">Event</dt>
|
||||
<dd class="col-9"><code>{{ $auditLog->event }}</code></dd>
|
||||
|
||||
<dt class="col-3 text-muted">Deskripsi</dt>
|
||||
<dd class="col-9">{{ $auditLog->description ?? '—' }}</dd>
|
||||
|
||||
<dt class="col-3 text-muted">Pengguna</dt>
|
||||
<dd class="col-9">{{ $auditLog->user?->name ?? 'Sistem' }}</dd>
|
||||
|
||||
<dt class="col-3 text-muted">IP</dt>
|
||||
<dd class="col-9">{{ $auditLog->ip_address ?? '—' }}</dd>
|
||||
|
||||
<dt class="col-3 text-muted">Tarikh</dt>
|
||||
<dd class="col-9">{{ $auditLog->created_at->format('d/m/Y H:i:s') }}</dd>
|
||||
|
||||
@if($auditLog->auditable_type)
|
||||
<dt class="col-3 text-muted">Model</dt>
|
||||
<dd class="col-9"><code>{{ class_basename($auditLog->auditable_type) }} #{{ $auditLog->auditable_id }}</code></dd>
|
||||
@endif
|
||||
</dl>
|
||||
|
||||
@if($auditLog->old_values)
|
||||
<div class="mt-3">
|
||||
<label class="text-muted small fw-semibold text-uppercase" style="font-size:.7rem">Nilai Lama</label>
|
||||
<pre class="bg-light rounded p-2 mt-1 small">{{ json_encode($auditLog->old_values, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}</pre>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($auditLog->new_values)
|
||||
<div class="mt-3">
|
||||
<label class="text-muted small fw-semibold text-uppercase" style="font-size:.7rem">Nilai Baru</label>
|
||||
<pre class="bg-light rounded p-2 mt-1 small">{{ json_encode($auditLog->new_values, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}</pre>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user