@extends('layouts.admin') @section('title', app()->isLocale('ar') ? 'سجل التدقيق' : 'Audit log') @section('content') {{ app()->isLocale('ar') ? 'فتح سجل الأرشيف' : 'Open archive log' }} @if(session('status'))
{{ session('status') }}
@endif
{{ app()->isLocale('ar') ? 'سجلات قيد النشاط' : 'Unarchived records' }} {{ number_format($unarchivedCount) }}
{{ app()->isLocale('ar') ? 'فترة الاحتفاظ' : 'Retention window' }} {{ number_format(config('audit.retention_days', 90)) }} {{ app()->isLocale('ar') ? 'يوم' : 'days' }}
{{ app()->isLocale('ar') ? 'حزم الأرشيف' : 'Archive batches' }} {{ number_format($archiveCount) }}
{{ app()->isLocale('ar') ? 'إعادة ضبط' : 'Reset' }}
@forelse($logs as $log) @empty @endforelse
{{ app()->isLocale('ar') ? 'التاريخ والوقت' : 'Occurred' }} {{ app()->isLocale('ar') ? 'العملية' : 'Action' }} {{ app()->isLocale('ar') ? 'المستخدم' : 'Actor' }} {{ app()->isLocale('ar') ? 'العنصر المتأثر' : 'Subject' }} {{ app()->isLocale('ar') ? 'الحالة' : 'Result' }} {{ app()->isLocale('ar') ? 'التخزين' : 'Storage' }} {{ app()->isLocale('ar') ? 'الإجراءات' : 'Actions' }}
{{ str($log->action->value)->replace('.', ' ')->headline() }} {{ $log->actor?->name ?? (app()->isLocale('ar') ? 'النظام' : 'System') }} @if($log->actor)
{{ $log->actor->email }} @endif
@php $subjectName = $log->subjectDisplayName(); $typeBasename = class_basename($log->subject_type); $typeTranslations = [ 'Project' => 'مشروع', 'Client' => 'عميل', 'Partner' => 'شريك', 'Service' => 'خدمة', 'User' => 'مستخدم', 'Role' => 'دور', 'Job' => 'وظيفة', 'Post' => 'مقال', 'Quotation' => 'عرض سعر', 'Meeting' => 'اجتماع', 'MenuBarLink' => 'رابط قائمة', 'FooterLink' => 'رابط فوتر', 'HomePage' => 'الصفحة الرئيسية', 'HomePageSection' => 'قسم الصفحة الرئيسية', 'Setting' => 'إعدادات', 'Contact' => 'جهة اتصال', 'Lead' => 'فرصة', ]; $translatedType = app()->isLocale('ar') ? ($typeTranslations[$typeBasename] ?? $typeBasename) : $typeBasename; @endphp {{ $subjectName }}
{{ $translatedType }} @if($log->subject_id && !str_contains($subjectName, (string)$log->subject_id)) #{{ Str::limit($log->subject_id, 10) }} @endif
{{ $log->result === 'succeeded' ? (app()->isLocale('ar') ? 'نجح' : 'Succeeded') : (app()->isLocale('ar') ? 'فشل' : 'Failed') }} {{ $log->archiveEntry ? (app()->isLocale('ar') ? 'مؤرشف' : 'Archived') : (app()->isLocale('ar') ? 'نشط' : 'Active') }}
{{-- Archive Button --}}
@csrf
{{-- Delete Button --}}
@csrf @method('DELETE')
{{ app()->isLocale('ar') ? 'عرض تفاصيل التغيير والسياق' : 'Inspect redacted context' }}
{{ app()->isLocale('ar') ? 'معرّف الطلب' : 'Request ID' }}
{{ $log->request_id ?? 'Not available' }}
{{ app()->isLocale('ar') ? 'عنوان IP' : 'IP address' }}
{{ $log->ip_address ?? 'Not available' }}

{{ app()->isLocale('ar') ? 'القيم السابقة (Before)' : 'Before' }}

{{ app()->isLocale('ar') ? 'القيم الجديدة (After)' : 'After' }}

{{ app()->isLocale('ar') ? 'لا توجد سجلات تدقيق مطابقة للبحث.' : 'No audit records matched the current filters.' }}
{{ $logs->links() }}

{{ app()->isLocale('ar') ? 'الاحتفاظ والتخزين' : 'Retention' }}

{{ app()->isLocale('ar') ? 'حزم الأرشيف الأخيرة' : 'Recent archive batches' }}

{{ app()->isLocale('ar') ? 'تصديرات مضغوطة ومحمية مع التحقق من سلامة البيانات عبر SHA-256.' : 'Private, compressed exports with immutable membership and SHA-256 verification.' }}

@forelse($archives as $archive) @empty @endforelse
{{ app()->isLocale('ar') ? 'تاريخ الإنشاء' : 'Created' }} {{ app()->isLocale('ar') ? 'تاريخ الحد' : 'Cutoff' }} {{ app()->isLocale('ar') ? 'عدد السجلات' : 'Records' }} {{ app()->isLocale('ar') ? 'الحجم' : 'Size' }} {{ app()->isLocale('ar') ? 'بصمة التحقق' : 'Checksum' }}
{{ $archive->created_at->format('Y-m-d H:i') }}
{{ $archive->creator?->name ?? 'System command' }}
{{ $archive->cutoff_at->format('Y-m-d H:i') }} {{ number_format($archive->records_count) }} {{ number_format($archive->byte_size) }} bytes {{ str($archive->checksum_sha256)->substr(0, 16) }}…
{{ app()->isLocale('ar') ? 'لم يتم إنشاء حزم أرشيف بعد.' : 'No audit archive has been created yet.' }}
@endsection