@extends('layouts.app') @section('title', __('System Status')) @section('sidebar') @include('partials/sidebar_menu_toggle') @include('system/sidebar_menu') @endsection @section('content')
{{ __('System Status') }}

{{ __('Info') }}

@if (\Helper::detectCloudFlare()) @php $cloudflare_is_used = config('app.cloudflare_is_used'); @endphp @endif {{----}}
{{ __('App Version') }} @if (!\Config::get('app.disable_updating')) @if ($new_version_available) {{ \Config::get('app.version') }}
{{ __('A new version is available') }}: {{ $latest_version }} ({{ __('View details') }})
@else {{ \Config::get('app.version') }}    {{ __('Check for updates') }} @if ($latest_version_error)
{{ $latest_version_error }}
@endif @endif @else {{ \Config::get('app.version') }} @endif
{{ __('Date & Time') }} {{ App\User::dateFormat(new Illuminate\Support\Carbon()) }}
{{ __('Timezone') }} {{ \Config::get('app.timezone') }} (GMT{{ date('O') }})
{{ __('Protocol') }}
Proxy
@if (!$cloudflare_is_used) @endif{{ 'CloudFlare' }} ({{ __('read more') }})
{{ __('.env file') }} @if (\File::exists(base_path().DIRECTORY_SEPARATOR.'.env')) {{ 'Exists'}} @else {{ 'Not found'}} @endif
DB {{ ucfirst(\DB::connection()->getPDO()->getAttribute(\PDO::ATTR_DRIVER_NAME)) }} ({{ \DB::connection()->getPDO()->getAttribute(\PDO::ATTR_SERVER_VERSION) }}) @if ($missing_migrations)   {{ 'Migrate DB' }}
@foreach($missing_migrations as $missing_migration) {{ $missing_migration }}
@endforeach
@endif
{{ __('Web Server') }} @if (!empty($_SERVER['SERVER_SOFTWARE'])){{ $_SERVER['SERVER_SOFTWARE'] }}@else ? @endif
{{ __('PHP Version') }} PHP {{ phpversion() }}
PHP upload_max_filesize / post_max_size {{ ini_get('upload_max_filesize') }} / {{ ini_get('post_max_size') }}

{{ __('PHP Extensions') }}

@foreach ($php_extensions as $extension_name => $extension_status) @endforeach
{{ $extension_name }}@if ($extension_name == 'intl' && !$extension_status) {{ __('(optional)') }}@endif @if ($extension_status) OK @else {{ __('Not found') }} @endif

{{ __('Functions') }}

@foreach ($functions as $functions_name => $functions_status) @endforeach
{{ $functions_name }} @if ($functions_status) OK @else {{ __('Not found') }} @endif

{{ __('Permissions') }}

{!! __('These folders must be writable by web server user (:user).', ['user' => ''.get_current_user().'']) !!} {{ __('Recommended permissions') }}: 775 @foreach ($permissions as $perm_path => $perm) @endforeach
{{ $perm_path }} @if ($perm_path == 'storage/framework/cache/data/') @if ($non_writable_cache_file) {{ __('Non-writable files found') }}
{{ $non_writable_cache_file }}

{{ __('Run the following command') }} ({{ __('read more') }}):
sudo chown -R www-data:www-data {{ base_path() }} @elseif (!$perm['status']) {{ __('Not writable') }} @if ($perm['value'])({{ $perm['value'] }})@endif @else OK @endif @else @if ($perm['status']) OK @else {{ __('Not writable') }} @if ($perm['value'])({{ $perm['value'] }})@endif

{{ __('Run the following command') }} ({{ __('read more') }}):
sudo chown -R www-data:www-data {{ base_path() }} @endif @endif
public/storage (symlink) @if ($public_symlink_exists) OK @else {{ __('Not found') }}
{{ __('Create symlink manually') }}: ln -s storage/app/public public/storage
@endif
.env @if ($env_is_writable) OK @else {{ __('Not writable') }} @endif
@if ($invalid_symlinks) @include('modules/partials/invalid_symlinks') @endif

Cron Commands

{!! __('Make sure that you have the following line in your crontab:') !!}
* * * * * php {{ base_path() }}/artisan schedule:run >> /dev/null 2>&1
{!! __('Alternatively cron job can be executed by requesting the following URL every minute (this method is not recommended as some features may not work as expected, use it at your own risk)') !!}:
{{ route('system.cron', ['hash' => \Helper::getWebCronHash()]) }}

@foreach ($commands as $command) @endforeach
{{ $command['name'] }} {!! $command['status_text'] !!} @if ($command['name'] == 'freescout:fetch-emails' && $command['status'] != "success") ({{ __('See logs') }}) @endif

{{ __('Background Jobs') }}

@if (count($queued_jobs) || count($failed_jobs)) {{ __('Queued and failed jobs are cleaned automatically once in a while. No need to worry or delete them manually.') }} @endif
{{ __('Queued Jobs') }}

{{ __('Total') }}: {{ count($queued_jobs)}}

@foreach ($queued_jobs as $job) @php $payload = $job->getPayloadDecoded(); @endphp @if (\Str::startsWith($payload['displayName'], 'App\Jobs\Send')) @php $command = $job->getCommand(); $last_thread = null; if ($command && !empty($command->conversation) && !empty($command->threads) ) { $last_thread = \App\Thread::getLastThread($command->threads); } @endphp @if (!empty($last_thread)) @endif @endif @if ($job->attempts > 0) @endif
{{ $loop->index+1 }}. {{ $payload['displayName'] }}
{{ csrf_field() }} @if ($job->attempts > 0) @endif
{{ __('Queue') }} {{ $job->queue }}
{{ __('Message') }} #{{ $command->conversation->number }}
{{ __('Attempts') }} @if ($job->attempts > 0)@endif {{ $job->attempts }} @if ($job->attempts > 0) @endif @if ($job->attempts > 0 && !empty($last_thread))  ({{ __('View log') }}) @endif
{{ __('Created At') }} {{ App\User::dateFormat($job->created_at) }}
{{ __('Next Attempt') }} {{ App\User::dateFormat($job->available_at) }}
@endforeach
{{ __('Failed Jobs') }}

{{ __('Total') }}: 0) class="text-danger" @endif >{{ count($failed_jobs) }} @if (count($failed_jobs))   

{{ csrf_field() }}
@endif

@foreach ($failed_jobs as $job) @php $payload = $job->getPayloadDecoded(); @endphp @if (\Str::startsWith($payload['displayName'], 'App\Jobs\Send')) @php $command = $job->getCommand(); $last_thread = null; if ($command && !empty($command->conversation) && !empty($command->threads) ) { $last_thread = \App\Thread::getLastThread($command->threads); } @endphp @if (!empty($last_thread)) @endif @endif
{{ $loop->index+1 }}. {{ json_decode($job->payload, true)['displayName'] }} – {{ __('View Details') }}
{{ __('Queue') }} {{ $job->queue }}
{{ __('Message') }} #{{ $command->conversation->number }}
{{ __('Logs') }} {{ __('View log') }}
{{ __('Failed At') }} {{ App\User::dateFormat($job->failed_at, 'M j, Y H:i:s') }}
@endforeach
@endsection @section('javascript') @parent initSystemStatus(); @endsection