@php use App\Helpers\ActionHelper; use Carbon\Carbon; use Illuminate\Support\Str; @endphp @extends('layouts.app') @section('title', 'Client Details') @section('breadcrumbs') @include('components.breadcrumbs', ['items' => [ ['title' => $client->name, 'active' => true] ]]) @endsection @section('content')

{{ $client->name }}

@if($client->scan_every > 0 && $nextScanDate)
Prossima scansione automatica: {{ $nextScanDate->format('d/m/Y H:i') }}
@endif
Modifica Cliente   @if($canAddNewUrl) @else @endif  
In attesa
Limite URL: {{ $uniqueUrlsCount }} / {{ $urlLimit }} URL utilizzate
@if(!$canAddNewUrl)
Limite raggiunto! Non è possibile aggiungere nuove URL.
@endif
Aggiungi Nuova URL
@csrf
@php // === ESTRAZIONE AZIONI CON NUOVA FUNZIONE UNIFICATA === $allDomainActions = \App\Helpers\ActionHelper::extractActionsFromDomain($client->action_domain); // === FILTRAGGIO AZIONI === // Rimuove azioni predefinite che creano scan automatici e categorie vuote $filteredBeforeScanActions = []; foreach ($allDomainActions['before_scan_action'] as $category => $actions) { $filteredActions = []; foreach ($actions as $actionName => $actionData) { // Includiamo l'azione solo se NON è (predefinita E crea auto scan) if (!($actionData['is_predefined'] && $actionData['creates_auto_scan'])) { $filteredActions[$actionName] = $actionData; } } // Aggiungiamo la categoria solo se ha azioni if (!empty($filteredActions)) { $filteredBeforeScanActions[$category] = $filteredActions; } } $filteredActions = []; foreach ($allDomainActions['action'] as $category => $actions) { $filteredCategoryActions = []; foreach ($actions as $actionName => $actionData) { // Includiamo l'azione solo se NON è (predefinita E crea auto scan) if (!($actionData['is_predefined'] && $actionData['creates_auto_scan'])) { $filteredCategoryActions[$actionName] = $actionData; } } // Aggiungiamo la categoria solo se ha azioni if (!empty($filteredCategoryActions)) { $filteredActions[$category] = $filteredCategoryActions; } } $hasBeforeScanActions = !empty($filteredBeforeScanActions); @endphp @if($hasBeforeScanActions)
@endif @php // === RACCOLTA DATI PER AZIONI NORMALI === $hasActions = !empty($filteredActions); @endphp @if($hasActions)
@endif

Avanzamento Scansioni

0%
0 di 0 scansioni completate

Andamento Report nel Tempo

@if(count($availableDates ?? []) > 0)
@else

Scans

@endif
@csrf
@if(count($groupedScans) > 0)
@foreach($groupedScans as $groupKey => $group) @php $cardId = 'scan-card-' . $group['key']; $overallStatus = $group['overall_status'] ?? 'pending'; // Determina se mostrare i pulsanti $isLatestDateScans = $isLatestDate; // Questo scan fa parte dell'ultimo giorno di scans $isTodayLatestDate = $selectedDate === 'current' || $selectedDate === Carbon::today()->format('Y-m-d'); // Stato attuale o oggi è l'ultimo giorno di scan // Controlla se l'azione automatica crea scansioni automatiche (per nascondere il pulsante delete) $actionCreatesAutoScan = false; $beforeActionCreatesAutoScan = false; if (!empty($group['action']) && Str::startsWith($group['action'], '_auto_')) { $predefinedActionsService = app('App\Services\PredefinedActionsService'); $actionCreatesAutoScan = $predefinedActionsService->actionCreatesAutomaticScan($group['action']); } if (!empty($group['before_scan_action']) && Str::startsWith($group['before_scan_action'], '_auto_')) { $predefinedActionsService = app('App\Services\PredefinedActionsService'); $beforeActionCreatesAutoScan = $predefinedActionsService->actionCreatesAutomaticScan($group['before_scan_action']); } // Nascondi il pulsante delete solo se è un'azione automatica che crea scansioni automatiche $isBlockedAutomaticAction = $actionCreatesAutoScan || $beforeActionCreatesAutoScan; // Il pulsante delete è ora sempre visibile (se non è un'azione automatica bloccata), // indipendentemente dalla data selezionata $showDeleteButton = !$isBlockedAutomaticAction; // DEBUG TEMPORANEO per URL cyberguru if (str_contains($group['url'], 'cyberguru')) { error_log("DEBUG CYBERGURU: URL = " . $group['url']); error_log("DEBUG CYBERGURU: action = " . ($group['action'] ?? 'NULL')); error_log("DEBUG CYBERGURU: before_scan_action = " . ($group['before_scan_action'] ?? 'NULL')); error_log("DEBUG CYBERGURU: actionCreatesAutoScan = " . ($actionCreatesAutoScan ? 'true' : 'false')); error_log("DEBUG CYBERGURU: beforeActionCreatesAutoScan = " . ($beforeActionCreatesAutoScan ? 'true' : 'false')); error_log("DEBUG CYBERGURU: isBlockedAutomaticAction = " . ($isBlockedAutomaticAction ? 'true' : 'false')); error_log("DEBUG CYBERGURU: showDeleteButton = " . ($showDeleteButton ? 'true' : 'false')); } $showRepeatButton = $isLatestDateScans && $isTodayLatestDate; @endphp
{{ $group['page_title'] ?? 'Page' }}
@if($group['exclude_common_state'])
 URL esclusa dal contesto rilevante per il calcolo degli errori comuni
@endif
 {{ $group['url'] }}
@if($group['before_scan_action'])
@if(Str::startsWith($group['before_scan_action'], '_auto_'))   @endif  Azione preventiva: {{ $group['before_scan_action_metadata'] ? ($group['before_scan_action_metadata']['display_name'] ?? $group['before_scan_action_metadata']['name'] ?? $group['before_scan_action']) : $group['before_scan_action'] }}
@endif @if($group['action'])
@if(Str::startsWith($group['action'], '_auto_'))   @endif  {{ $group['action_metadata'] ? ($group['action_metadata']['display_name'] ?? $group['action_metadata']['name'] ?? $group['action']) : $group['action'] }}
@endif
@foreach($group['devices'] as $device => $deviceData) @php $deviceStatus = $deviceData['device_status'] ?? 'pending'; // Trova il primo errore per questo device $deviceError = null; if (!empty($group['unique_errors'])) { foreach ($group['unique_errors'] as $error) { if (in_array($device, $error['devices'] ?? [])) { $deviceError = $error; break; // Prendi solo il primo errore } } } $hasError = $deviceError !== null; @endphp
{{ ucfirst($device) }}
@foreach($deviceData['systems'] as $system => $systemData) @php $systemStatus = $systemData['status'] ?? 'pending'; @endphp
{{ ucfirst($system) }} {{ $systemData['errors'] ?? 0 }}
@endforeach
@if($hasError)
{{ $deviceError['message'] }}
@endif
@endforeach
@if(($group['requires_base_scan'] ?? false) && !($group['has_base_scan'] ?? false))
Si consiglia di eseguire anche una scansione della pagina base (senza azione) per un'analisi completa.
@endif
@if(isset($group['date_display']) || (isset($group['show_day_difference']) && $group['show_day_difference']))
@if($group['selected_date_mode'] === 'current') @if($group['show_day_difference'] && $group['day_difference'] !== 0) {{ $group['day_difference'] > 0 ? '+' : '' }}{{ $group['day_difference'] }} @endif @if($group['date_display']) {{ $group['date_display'] }} @endif @else @if($group['show_day_difference'] && $group['day_difference'] !== 0) {{ $group['day_difference'] > 0 ? '+' : '' }}{{ $group['day_difference'] }} @endif @endif
@endif
In attesa In coda In corso @if($group['total_errors'] > 0) {{ $group['total_errors'] }} Errors @else No Errors @endif Fallito
@if($showRepeatButton)   @endif
  @if($showDeleteButton)
@csrf @method('DELETE')
@endif
@endforeach
@else
No scans found for this client.
@endif
@endsection