@extends('layouts.app') @section('title', __('app.titles.dashboard')) @section('breadcrumbs') @include('components.breadcrumbs', ['items' => []]) @endsection @section('content')

{{ __('clients.title') }}

{{ __('clients.limits.title') }}: {{ $currentClientCount }} / {{ $clientLimit }} {{ __('clients.limits.used') }}
@if(!$canAddNewClient)
{{ __('clients.limits.reached') }}! {{ __('clients.limits.cannot_add') }}
@endif
{{ __('clients.list_description') }} @if($canAddNewClient) {{ __('clients.add_new') }} @else @endif
{{ __('clients.found') }} {{ $clients->count() }} {{ __('clients.clients') }}
@foreach($clients as $client) @endforeach
ID @if($sortBy === 'id') @endif {{ __('clients.table.name') }} @if($sortBy === 'name') @endif {{ __('clients.table.last_scan') }} @if($sortBy === 'last_scan_date') @endif {{ __('clients.table.current_score') }} @if($sortBy === 'current_score') @endif {{ __('clients.table.total_errors') }} @if($sortBy === 'current_total_errors') @endif {{ __('clients.table.actions') }}
{{ $client['id'] }} {{ $client['name'] }} @if($client['last_scan_date']) {{ $client['last_scan_date']->format('d/m/Y H:i') }} @else {{ __('clients.table.no_scan') }} @endif @if($client['current_score'] !== null) @php $scoreClass = 'text-success'; $scoreDescription = __('clients.score.excellent'); if($client['current_score'] < 50) { $scoreClass = 'text-danger'; $scoreDescription = __('clients.score.critical'); } elseif($client['current_score'] < 75) { $scoreClass = 'text-warning'; $scoreDescription = __('clients.score.needs_improvement'); } @endphp {{ $client['current_score'] }}% @else N/A @endif @if($client['current_total_errors'] !== null) @php $errorClass = 'text-success'; $errorDescription = __('clients.errors.few'); if($client['current_total_errors'] > 50) { $errorClass = 'text-danger'; $errorDescription = __('clients.errors.many_critical'); } elseif($client['current_total_errors'] > 20) { $errorClass = 'text-warning'; $errorDescription = __('clients.errors.to_fix'); } @endphp {{ $client['current_total_errors'] }} @else N/A @endif
@csrf @method('DELETE')
@if($clients->isEmpty())

{{ __('clients.no_clients') }}

@if($canAddNewClient) {{ __('clients.add_first') }} @endif
@endif @endsection