<x-layouts.app :title="__('serp_checks.title').' — TrafficPumper'"><x-customer-shell><header class="tp-page-header"><div><p>{{__('customer.rank_tracking')}}</p><h1>{{__('serp_checks.title')}}</h1><span>{{__('serp_checks.description')}}</span></div></header>@error('serp')<div class="alert alert-warning">{{$message}}</div>@enderror @if(!config('serp.enabled')||app(\App\Serp\Operations\ActivationManager::class)->allowsNormal()===false)<div class="alert alert-secondary">{{__('serp_checks.unavailable')}}</div>@endif
<section class="tp-metric-grid tp-serp-metrics"><x-metric-card :label="__('serp_checks.total')" :value="$summary['total']" icon="⌕"/><x-metric-card :label="__('serp_checks.pending')" :value="$summary['pending']" icon="◷"/><x-metric-card :label="__('serp_checks.running')" :value="$summary['running']" icon="↻"/><x-metric-card :label="__('serp_checks.completed')" :value="$summary['completed']" icon="✓"/><x-metric-card :label="__('serp_checks.failed')" :value="$summary['failed']" icon="!"/><x-metric-card :label="__('serp_checks.last24')" :value="$summary['last24']" icon="◴"/></section>
<section class="tp-panel"><form method="GET" class="tp-serp-filters"><input name="q" class="form-control" value="{{request('q')}}" placeholder="{{__('serp_checks.search')}}"><select name="project" class="form-select"><option value="">{{__('serp_checks.all_projects')}}</option>@foreach($projects as $project)<option value="{{$project->ulid}}" @selected(request('project')===$project->ulid)>{{$project->name}}</option>@endforeach</select><select name="keyword" class="form-select"><option value="">{{__('serp_checks.all_keywords')}}</option>@foreach($keywords as $keyword)<option value="{{$keyword->ulid}}" @selected(request('keyword')===$keyword->ulid)>{{$keyword->phrase}}</option>@endforeach</select><select name="status" class="form-select"><option value="">{{__('serp_checks.all_statuses')}}</option>@foreach(\App\Enums\SerpCheckStatus::cases() as $status)<option value="{{$status->value}}" @selected(request('status')===$status->value)>{{$status->label()}}</option>@endforeach</select><select name="device" class="form-select"><option value="">{{__('serp_checks.device')}}</option>@foreach(\App\Enums\KeywordDevice::cases() as $device)<option value="{{$device->value}}" @selected(request('device')===$device->value)>{{$device->label()}}</option>@endforeach</select><input type="date" name="from" value="{{request('from')}}" class="form-control"><input type="date" name="to" value="{{request('to')}}" class="form-control"><button class="btn btn-primary">{{__('serp_checks.filter')}}</button><a class="btn btn-outline-secondary" href="{{route('serp-checks.index')}}">{{__('serp_checks.clear')}}</a></form></section>
<section class="tp-panel"><div class="table-responsive"><table class="table tp-data-table"><thead><tr><th>{{__('serp_checks.keyword')}}</th><th>{{__('serp_checks.project')}}</th><th>{{__('serp_checks.type')}}</th><th>{{__('serp_checks.status')}}</th><th>{{__('serp_checks.rank')}}</th><th>{{__('serp_checks.device')}}</th><th>{{__('serp_checks.target')}}</th><th>{{__('serp_checks.requested')}}</th><th>{{__('serp_checks.completed_at')}}</th><th>{{__('serp_checks.action')}}</th></tr></thead><tbody>@forelse($checks as $check)<tr><td>{{$check->phrase}}</td><td>{{$check->keyword->project->name}}</td><td>{{__('serp_checks.'.($check->origin==='scheduled'?'scheduled':'manual'))}}</td><td><span class="badge tp-status-{{$check->status->value}}">{{$check->status->label()}}</span></td><td>{{$check->detected_rank?'#'.$check->detected_rank:($check->status===\App\Enums\SerpCheckStatus::Completed?'100+':'—')}}</td><td>{{$check->device->label()}}</td><td>{{$check->country_code}} / {{$check->language_code}}</td><td>{{$check->created_at->translatedFormat('d M Y H:i')}}</td><td>{{$check->completed_at?->translatedFormat('d M Y H:i')??'—'}}</td><td><a href="{{route('serp-checks.show',$check)}}">{{__('serp_checks.view')}}</a></td></tr>@empty<tr><td colspan="10"><x-empty-state :title="__('serp_checks.no_filter')" :description="__('serp_checks.no_checks')"/></td></tr>@endforelse</tbody></table></div>{{$checks->links()}}</section></x-customer-shell></x-layouts.app>
