@extends('panel.layout.app')
@section('title', __('Site Health'))
@section('content')
@if (Auth::user()->type == 'admin')
@php
function backgroundColor($status)
{
return match ($status) {
Spatie\Health\Enums\Status::ok()->value => 'bg-green-500',
Spatie\Health\Enums\Status::warning()->value => 'bg-yellow-500',
Spatie\Health\Enums\Status::skipped()->value => 'bg-blue-500',
Spatie\Health\Enums\Status::failed()->value, Spatie\Health\Enums\Status::crashed()->value => 'bg-red-500',
default => 'bg-gray-500',
};
}
function iconColor($status)
{
return match ($status) {
Spatie\Health\Enums\Status::ok()->value => 'text-green-500',
Spatie\Health\Enums\Status::warning()->value => 'text-yellow-500',
Spatie\Health\Enums\Status::skipped()->value => 'text-blue-500',
Spatie\Health\Enums\Status::failed()->value, Spatie\Health\Enums\Status::crashed()->value => 'text-red-500',
default => 'text-gray-500',
};
}
function icon($status)
{
return match ($status) {
Spatie\Health\Enums\Status::ok()->value => 'check-circle',
Spatie\Health\Enums\Status::warning()->value => 'exclamation-circle',
Spatie\Health\Enums\Status::skipped()->value => 'arrow-circle-right',
Spatie\Health\Enums\Status::failed()->value, Spatie\Health\Enums\Status::crashed()->value => 'x-circle',
default => '',
};
}
@endphp
@if (count($checkResults?->storedCheckResults ?? []))
@foreach ($checkResults->storedCheckResults as $result)
@if (icon($result->status) == 'check-circle')
@elseif(icon($result->status) == 'exclamation-circle')
@elseif(icon($result->status) == 'arrow-circle-right')
@elseif(icon($result->status) == 'x-circle')
@else
@endif
{{ $result->label }}
@if (!empty($result->notificationMessage))
@if ($result->notificationMessage === 'Crashed')
{{ __('Failed to calculate. Your server configuration is preventing this feature from being calculated.') }}
@else
{{ str_replace('The debug mode was expected to be `false`, but actually was `true`', __('Debug mode is enabled. If this is your production site, it is recommended to disable it.'), $result->notificationMessage) }}
@endif
@else
{{ $result->shortSummary }}
@endif
@endforeach
@endif
@if ($app_is_not_demo)
{{ __('Clean Up Cache') }}
{{ __('Server Details') }}
{{ __('You can copy the below info as simple text with Ctrl+C / Ctrl+V:') }}
{{ __('Copy') }}
log
{{ __('View Log File') }}
@endif
@endif
@endsection
@push('script')
@endpush