@extends('admin.layouts.app') @section('title', __('admin.sync.title') . ' — ' . __('admin.brand.name')) @section('page_title', __('admin.sync.title')) @php $dash = '—'; $fmt = function ($ts) use ($dash) { if (!$ts) return $dash; return \Illuminate\Support\Carbon::parse($ts)->format('Y-m-d H:i:s'); }; $rel = function ($ts) use ($dash) { if (!$ts) return $dash; return \Illuminate\Support\Carbon::parse($ts)->diffForHumans(); }; /** Status → tailwind-ish color tuple. */ $statusColor = [ 'pending' => ['bg' => '#fef3c7', 'fg' => '#92400e', 'border' => '#fde68a'], 'running' => ['bg' => '#dbeafe', 'fg' => '#1e40af', 'border' => '#93c5fd'], 'succeeded' => ['bg' => '#dcfce7', 'fg' => '#166534', 'border' => '#86efac'], 'partial' => ['bg' => '#fed7aa', 'fg' => '#9a3412', 'border' => '#fdba74'], 'failed' => ['bg' => '#fee2e2', 'fg' => '#991b1b', 'border' => '#fca5a5'], ]; @endphp {{-- Alpine.js is already loaded by admin.layouts.app — loading it again would double-bind every directive on this page. --}} @push('styles') @endpush @section('content') @include('admin.partials.flash')
{{-- ────────────── Live banner (Alpine-controlled) ────────────── --}} {{-- ────────────── Stats + run buttons ────────────── --}}
{{-- Startups --}}

{{ __('admin.sync.boards.startups') }} #{{ $startupBoardId }}

{{ __('admin.sync.boards.startups_subtitle') }}

{{ __('admin.sync.fields.total') }}

{{ number_format($startupCount) }}

{{ __('admin.sync.fields.from_monday') }}

{{ number_format($startupFromMonday) }}

{{ __('admin.sync.fields.from_dashboard') }}

{{ number_format($startupFromDash) }}

{{ __('admin.sync.fields.last_sync') }}: {{ $fmt($startupLastSync) }}

@csrf

💡 {{ __('admin.sync.fields.limit') }} = 0 → {{ __('admin.sync.pull_all') }}

{{-- Investors --}}

{{ __('admin.sync.boards.investors') }} #{{ $investorBoardId }}

{{ __('admin.sync.boards.investors_subtitle') }}

{{ __('admin.sync.fields.total') }}

{{ number_format($investorCount) }}

{{ __('admin.sync.fields.last_sync') }}: {{ $fmt($investorLastSync) }}

@csrf

💡 {{ __('admin.sync.fields.limit') }} = 0 → {{ __('admin.sync.pull_all') }}

{{-- ────────────── Recent runs table ────────────── --}}

📜 {{ __('admin.sync.sections.recent') }}

{{ $recentRuns->count() }} / {{ \App\Models\SyncRun::count() }}
@if ($recentRuns->isEmpty())
{{ __('admin.sync.empty_runs') }}
@else
@foreach ($recentRuns as $r) @endforeach
{{ __('admin.sync.fields.run_id') }} {{ __('admin.sync.fields.module') }} {{ __('admin.sync.fields.status') }} {{ __('admin.sync.fields.upserted') }} {{ __('admin.sync.fields.errored') }} {{ __('admin.sync.fields.duration') }} {{ __('admin.sync.fields.triggered_by') }} {{ __('admin.sync.fields.queued_at') }}
#{{ $r->id }} {{ __('admin.sync.boards.' . $r->module) }} @if ($r->status === 'running') @endif {{ __('admin.sync.status_labels.' . $r->status) }} {{ number_format($r->items_upserted) }} / {{ number_format($r->items_processed) }} @if ($r->total_estimated && $r->isActive())
@endif
@if ($r->items_errored > 0) {{ number_format($r->items_errored) }} @else 0 @endif @if ($r->duration_ms !== null) {{ $r->durationSeconds() }}s @else {{ $dash }} @endif @if ($r->admin) {{ $r->admin->name }} @else {{ $dash }} @endif {{ $rel($r->created_at) }} {{ __('admin.sync.fields.view') }}
@endif
{{-- Alpine component: poll active runs every 3s and reload page when any finish. --}} @endsection