@extends('layouts.cabinet') @section('title', $source->name . ' — Массовые загрузки') @php $itemLabels = [ 'pending' => ['Обрабатывается', 'bg-gray-100 text-gray-600'], 'active' => ['Опубликовано', 'bg-brand-50 text-brand-700'], 'blocked' => ['Отклонено', 'bg-red-50 text-red-700'], 'skipped' => ['Пропущено', 'bg-amber-50 text-amber-800'], 'failed' => ['Ошибка', 'bg-red-50 text-red-700'], 'gone' => ['Снято (нет в файле)', 'bg-gray-100 text-gray-500'], ]; @endphp @section('cabinet')
‹ К списку

{{ $source->name }}

{{ $source->source_type === 'url' ? 'По ссылке' : 'Файл' }} · YML @if ($source->last_run_at) · обновлён {{ $source->last_run_at->diffForHumans() }} @endif
@if ($source->source_type === 'url')
@csrf
@endif
{{-- Окно-запрос: что сделать с объявлениями (обязательный выбор) --}}

Удалить «{{ $source->name }}»

Что сделать с объявлениями этого импорта ({{ $adsCount }} шт.)? Выберите вариант:

@csrf @method('DELETE')
@if (session('status'))
{{ session('status') }}
@endif @if ($source->status === 'error')
Ошибка: {{ $source->last_error }}
@elseif (in_array($source->status, ['queued', 'running']))
Импорт обрабатывается в фоне — обновите страницу, чтобы увидеть прогресс.
@endif {{-- Сводка по статусам --}}
@foreach ($itemLabels as $st => [$label, $cls])
{{ $counts[$st] ?? 0 }}
{{ $label }}
@endforeach
{{-- Список товаров --}}
@forelse ($items as $item)
@if ($item->ad) {{ $item->ad->title }} @else Оффер #{{ $item->offer_id }} @endif
#{{ $item->offer_id }} @if ($item->reason) · {{ $item->reason }} @endif
@php [$label, $cls] = $itemLabels[$item->status] ?? [$item->status, 'bg-gray-100 text-gray-600']; @endphp {{ $label }}
@empty
Пока нет обработанных товаров.
@endforelse
{{ $items->links() }}
@endsection