@extends('layouts.admin-sidebar') @section('title', 'API Configuration Logs') @section('page-title', 'API Configuration Logs') @section('page-description', 'View all API configuration changes and test results') @section('content')
Timestamp | User | Action | Service | Changes | IP Address |
---|---|---|---|---|---|
{{ $log->created_at->format('M j, Y H:i:s') }} | {{ $log->user ? $log->user->full_name : 'System' }} | @php $actionClasses = [ 'update_api_config' => 'bg-blue-100 text-blue-800', 'activate_service' => 'bg-emerald-100 text-emerald-800', 'deactivate_service' => 'bg-red-100 text-red-800', 'toggle_service_mode' => 'bg-amber-100 text-amber-800', 'test_api_connection' => 'bg-purple-100 text-purple-800', ]; $actionLabels = [ 'update_api_config' => 'Configuration Updated', 'activate_service' => 'Service Activated', 'deactivate_service' => 'Service Deactivated', 'toggle_service_mode' => 'Mode Changed', 'test_api_connection' => 'Connection Tested', ]; @endphp {{ $actionLabels[$log->action] ?? ucwords(str_replace('_', ' ', $log->action)) }} | @if($log->model_type === 'ApiConfig' && $log->model_id) @php $apiConfig = $apiConfigs->firstWhere('id', $log->model_id); @endphp {{ $apiConfig ? $apiConfig->name : 'Unknown Service' }} @else - @endif |
@if($log->action === 'test_api_connection' && isset($log->new_values['success']))
@if($log->new_values['success'])
✓ Test Successful
@if(isset($log->new_values['response_time']))
{{ $log->new_values['response_time'] }}ms @endif @else ✗ Test Failed @if(isset($log->new_values['error'])) {{ Str::limit($log->new_values['error'], 50) }} @endif @endif @elseif($log->old_values && $log->new_values) @php $changes = []; foreach($log->new_values as $key => $newValue) { $oldValue = $log->old_values[$key] ?? null; if($oldValue != $newValue) { if(in_array($key, ['api_key', 'secret_key', 'private_key', 'client_secret'])) { $changes[] = ucwords(str_replace('_', ' ', $key)) . ' changed'; } else { $changes[] = ucwords(str_replace('_', ' ', $key)) . ': ' . ($oldValue ?: 'null') . ' → ' . ($newValue ?: 'null'); } } } @endphp {{ implode(', ', array_slice($changes, 0, 2)) }} @if(count($changes) > 2) ... and {{ count($changes) - 2 }} more @endif @else - @endif |
{{ $log->ip_address }} |
@if(request()->hasAny(['service', 'action', 'date_from', 'date_to'])) No logs match your current filters. @else No API configuration logs available yet. @endif
@if(request()->hasAny(['service', 'action', 'date_from', 'date_to'])) @endif