@extends('admin.layouts.app') @section('title', __('admin.logs.module_call_title', ['id' => $log->id])) @section('content') @php // Pretty-print JSON where it is JSON. Truehost rows hold a status line, // then Truehost's answer as received. $pretty = function (?string $text) { if ($text === null || $text === '') return null; $data = json_decode($text, true); if (is_array($data)) return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); $parts = explode("\n", $text, 2); $head = json_decode($parts[0], true); if (is_array($head) && isset($parts[1])) { $body = json_decode($parts[1], true); return json_encode($head, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n\n" .($body !== null ? json_encode($body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) : $parts[1]); } return $text; }; $ok = $log->outcome(); @endphp
{{ __('common.table.date') }}
{{ $log->created_at?->format('Y-m-d H:i:s') }}
{{ __('admin.logs.module') }}
{{ ucfirst($log->module) }}
{{ __('admin.logs.action') }}
{{ $log->action }}
{{ __('admin.logs.outcome') }}
@if($ok === true){{ __('admin.logs.outcome_ok') }}@elseif($ok === false){{ __('admin.logs.outcome_failed') }}@else - @endif
{{ __('admin.logs.item') }}
@if($log->service){{ __('admin.logs.service_label', ['id' => $log->service_id, 'domain' => $log->service->domain]) }} @elseif($log->domain){{ $log->domain->domain }} @else - @endif @if($log->service_id || $log->domain_id) ยท {{ __('admin.logs.all_for_item') }} @endif
@foreach(['request' => __('admin.logs.request'), 'response' => __('admin.logs.response')] as $field => $label)
{{ $label }}
{{ $pretty($log->{$field}) ?? '-' }}
@endforeach @endsection