175 lines
11 KiB
PHP
175 lines
11 KiB
PHP
<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
|
|
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('app-layout'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes([]); ?>
|
|
<div class="space-y-6 pb-12">
|
|
|
|
<div class="flex flex-col md:flex-row md:items-center justify-between gap-4">
|
|
<div>
|
|
<h2 class="text-3xl font-black text-slate-800 tracking-tight leading-none mb-1 text-uppercase">Audit Trail</h2>
|
|
<p class="text-sm text-slate-500 font-medium italic uppercase tracking-tighter">Rekaman Aktivitas Staf & Keamanan Sistem</p>
|
|
</div>
|
|
<div class="flex flex-wrap items-center gap-3">
|
|
|
|
<span class="px-4 py-2 bg-white border border-slate-200 rounded-xl text-[10px] font-black text-slate-400">
|
|
TOTAL: <?php echo e($logs->total()); ?> LOGS
|
|
</span>
|
|
|
|
|
|
<a href="<?php echo e(route('admin.logs.export')); ?>" class="inline-flex items-center px-6 py-4 bg-emerald-50 text-emerald-900 border-2 border-emerald-200 text-[10px] font-black rounded-2xl shadow-sm hover:bg-emerald-600 hover:text-white transition-all uppercase tracking-widest">
|
|
<i class="fas fa-file-excel mr-2 text-sm text-emerald-600 group-hover:text-white"></i> Export XLSX
|
|
</a>
|
|
|
|
|
|
<form id="clear-logs-form" action="<?php echo e(route('admin.logs.clear')); ?>" method="POST" class="inline">
|
|
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
|
|
<button type="button" onclick="confirmClearLogs()" class="inline-flex items-center px-5 py-3 bg-rose-50 text-rose-600 border border-rose-100 text-[10px] font-black rounded-2xl hover:bg-rose-100 transition-all uppercase tracking-widest">
|
|
<i class="fas fa-trash-alt mr-2 text-sm"></i> Clear Data
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="bg-white p-5 border border-slate-200 rounded-[2rem] shadow-sm">
|
|
<form action="<?php echo e(route('admin.logs.index')); ?>" method="GET" class="flex flex-col md:flex-row gap-4">
|
|
<div class="flex-1 relative">
|
|
<i class="fas fa-search absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"></i>
|
|
<input type="text" name="search" value="<?php echo e(request('search')); ?>" placeholder="Cari deskripsi atau nama staf..."
|
|
class="w-full pl-11 pr-4 py-3.5 bg-slate-50 border border-slate-100 rounded-xl text-xs font-bold text-slate-700 focus:ring-2 focus:ring-indigo-100 transition-all">
|
|
</div>
|
|
|
|
|
|
<select name="action" class="bg-slate-50 border border-slate-100 rounded-xl text-xs font-bold text-slate-700 px-5 py-3.5 focus:ring-2 focus:ring-indigo-100 transition-all">
|
|
<option value="">SEMUA AKSI</option>
|
|
<option value="CREATE" <?php echo e(request('action') == 'CREATE' ? 'selected' : ''); ?>>CREATE (Tambah)</option>
|
|
<option value="UPDATE" <?php echo e(request('action') == 'UPDATE' ? 'selected' : ''); ?>>UPDATE (Ubah)</option>
|
|
<option value="DELETE" <?php echo e(request('action') == 'DELETE' ? 'selected' : ''); ?>>DELETE (Hapus)</option>
|
|
<option value="LOGIN" <?php echo e(request('action') == 'LOGIN' ? 'selected' : ''); ?>>LOGIN</option>
|
|
</select>
|
|
|
|
<button type="submit" class="px-8 py-3.5 bg-slate-900 text-white text-[10px] font-black rounded-xl uppercase hover:bg-black transition-all">Filter</button>
|
|
<?php if(request()->anyFilled(['search', 'action'])): ?>
|
|
<a href="<?php echo e(route('admin.logs.index')); ?>" class="px-4 py-3.5 text-slate-400 hover:text-rose-600 text-[10px] font-black flex items-center transition-all uppercase">Reset</a>
|
|
<?php endif; ?>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] overflow-hidden shadow-sm">
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-left border-collapse">
|
|
<thead class="bg-slate-50 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100">
|
|
<tr>
|
|
<th class="px-6 py-4">Waktu</th>
|
|
<th class="px-6 py-4">Staf Pelaksana</th>
|
|
<th class="px-6 py-4 text-center">Aksi</th>
|
|
<th class="px-6 py-4">Deskripsi Aktivitas</th>
|
|
<th class="px-6 py-4 text-right">Teknis</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-100 font-medium text-slate-700">
|
|
<?php $__empty_1 = true; $__currentLoopData = $logs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
|
<tr class="hover:bg-slate-50/50 transition-all group">
|
|
<td class="px-6 py-4">
|
|
<p class="text-xs font-black text-slate-800"><?php echo e($log->created_at->format('d/m/Y')); ?></p>
|
|
<p class="text-[10px] text-slate-400 font-bold tracking-tight"><?php echo e($log->created_at->format('H:i:s')); ?></p>
|
|
</td>
|
|
|
|
|
|
<td class="px-6 py-4">
|
|
<div class="flex items-center gap-3">
|
|
<div class="w-10 h-10 rounded-xl bg-white border border-slate-200 text-slate-900 flex items-center justify-center font-black text-sm shadow-sm uppercase">
|
|
<?php echo e(substr($log->user->name ?? 'S', 0, 1)); ?>
|
|
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-black text-slate-700"><?php echo e($log->user->name ?? 'Sistem'); ?></p>
|
|
<p class="text-[9px] text-slate-400 font-bold uppercase tracking-widest"><?php echo e($log->user->role ?? '-'); ?></p>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-6 py-4 text-center">
|
|
<?php
|
|
$action = strtoupper($log->action);
|
|
$style = 'text-slate-500 bg-slate-50 border-slate-100';
|
|
if(str_contains($action, 'CREATE')) $style = 'text-emerald-600 bg-emerald-50 border-emerald-100';
|
|
if(str_contains($action, 'UPDATE')) $style = 'text-blue-600 bg-blue-50 border-blue-100';
|
|
if(str_contains($action, 'DELETE')) $style = 'text-rose-600 bg-rose-50 border-rose-100';
|
|
if(str_contains($action, 'LOGIN')) $style = 'text-amber-600 bg-amber-50 border-amber-100';
|
|
?>
|
|
<span class="px-3 py-1 rounded-lg text-[9px] font-black border uppercase <?php echo e($style); ?>">
|
|
<?php echo e($log->action); ?>
|
|
|
|
</span>
|
|
</td>
|
|
|
|
<td class="px-6 py-4">
|
|
<div class="flex flex-col">
|
|
<span class="text-xs font-bold text-slate-600 leading-relaxed"><?php echo e($log->description); ?></span>
|
|
<span class="text-[9px] text-slate-400 italic">Target: <?php echo e(class_basename($log->model)); ?> (ID: <?php echo e($log->model_id); ?>)</span>
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-6 py-4 text-right">
|
|
<span class="text-[10px] font-mono font-bold text-slate-500 bg-slate-50 px-2 py-0.5 rounded border border-slate-100">
|
|
<?php echo e($log->ip_address); ?>
|
|
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
|
<tr>
|
|
<td colspan="5" class="px-6 py-20 text-center text-slate-400 uppercase text-[10px] font-black tracking-widest">
|
|
Tidak ada log ditemukan
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="p-6 border-t border-slate-100 bg-slate-50/30">
|
|
<?php echo e($logs->appends(request()->query())->links()); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<?php $__env->startPush('scripts'); ?>
|
|
<script>
|
|
function confirmClearLogs() {
|
|
Swal.fire({
|
|
title: 'RESET DATA LOG?',
|
|
html: "Anda akan menghapus <b class='text-rose-600'>SEMUA</b> riwayat aktivitas. Data tidak bisa dikembalikan!",
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#e11d48',
|
|
confirmButtonText: 'YA, BERSIHKAN',
|
|
cancelButtonText: 'BATAL',
|
|
reverseButtons: true,
|
|
customClass: { popup: 'rounded-[2.5rem] p-10' }
|
|
}).then((result) => {
|
|
if (result.isConfirmed) document.getElementById('clear-logs-form').submit();
|
|
});
|
|
}
|
|
</script>
|
|
<?php $__env->stopPush(); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
|
|
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
|
|
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
|
|
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
|
|
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
|
|
<?php endif; ?><?php /**PATH /home/u806112658/domains/earrinasia.com/ilycats/resources/views/pages/admin/logs.blade.php ENDPATH**/ ?>
|