@extends("admin.layouts.app") @section("title", __("admin.updates.title")) @section("content") @php $describe = function (array $issue): string { $params = array_map(fn ($v) => is_array($v) ? implode(', ', $v) : (string) $v, $issue['params'] ?? []); return __('admin.updates.issue.'.$issue['code'], $params); }; $when = fn (?string $iso) => $iso ? \Illuminate\Support\Carbon::parse($iso)->timezone(config('app.timezone'))->format(date_fmt().' H:i') : ''; $release = $latest['latest'] ?? null; // Picked up (no request left, nothing running) but still "queued" minutes later: the process that took it ended // without a word (killed, out of memory, a fatal error). Said so, and the buttons are back, instead of waiting for ever. $lost = $request === null && ! $running && ($status['state'] ?? '') === 'queued' && ! empty($status['updated_at']) && \Illuminate\Support\Carbon::parse($status['updated_at'])->lt(now()->subMinutes(5)); $active = ! $lost && (($request !== null) || $running || in_array($status['state'] ?? '', ['queued', 'preparing', 'applying', 'rolling_back'], true)); $late = $request && \Illuminate\Support\Carbon::parse($request['requested_at'])->lt(now()->subMinutes(2)); $blockingCodes = array_column($report['blocking'] ?? [], 'code'); $onlyMajor = $blockingCodes === ['major_version']; @endphp

{{ __('admin.updates.cli_hint_short') }} php artisan pnlcs:update

@if($unfinished)
{{ __('admin.updates.unfinished', ['command' => 'php artisan pnlcs:update-rollback']) }}
@endif
{{ __('admin.updates.installed') }}
{{ $installed }}
{{ $mode === 'git' ? __('admin.updates.mode_git') : '' }}
@csrf
@csrf
{{ isset($latest['checked_at']) ? __('admin.updates.last_checked', ['when' => $when($latest['checked_at'])]) : __('admin.updates.never_checked') }}
@if(isset($latest['error']))
{{ __('admin.updates.check_failed', ['error' => $latest['error']]) }}
@elseif($latest && ! $release)
{{ __('admin.updates.up_to_date', ['version' => $installed, 'channel' => __('admin.updates.channel_name.'.($latest['channel'] ?? $channel))]) }}
@endif @if($status && ($active || $lost || in_array($status['state'] ?? '', ['updated', 'refused', 'rolled_back', 'failed', 'rollback_failed', 'error'], true))) @php $finalState = $lost ? 'lost' : ($status['state'] ?? ''); $summary = $lost ? __('admin.updates.request_lost', ['command' => 'php artisan pnlcs:update --check']) : (in_array($finalState, ['updated', 'refused', 'rolled_back', 'failed', 'rollback_failed', 'error'], true) ? __('admin.updates.done.'.$finalState, ['version' => $status['version'] ?? '']) : null); $tone = ['updated' => 'alert-success', 'refused' => 'alert-warning', 'rolled_back' => 'alert-warning', 'failed' => 'alert-danger', 'rollback_failed' => 'alert-danger', 'error' => 'alert-danger', 'lost' => 'alert-danger'][$finalState] ?? 'alert-info'; $progress = [ 'status' => $status, 'statusUrl' => route('admin.config.updates.status'), 'now' => now()->toIso8601String(), 'labels' => ['state' => __('admin.updates.status'), 'step' => __('admin.updates.step')], 'steps' => [ 'apply' => ['download', 'check', 'maintenance', 'database', 'files', 'migrate', 'caches', 'health'], 'prepare' => ['download', 'check'], 'rolling_back' => ['files', 'database'], ], ]; @endphp
{{ $active ? __('admin.updates.progress') : __('admin.updates.last_result') }}
@if($active)
{{ __('admin.updates.elapsed') }}
{{ __('admin.updates.reconnecting') }}
{{ __('admin.updates.progress_hint') }}
@else
{{ $summary }}
@if(! empty($status['message']))
{{ __('admin.updates.details') }}
{{ $status['message'] }}
@endif @endif @if($late)
{{ __('admin.updates.scheduler_late', ['command' => 'php artisan pnlcs:update --from-request']) }}
@endif
@endif @if($release)
{{ __('admin.updates.available', ['version' => $release['version']]) }} @if($release['pre_release']){{ __('admin.updates.beta_badge') }}@endif @if(! empty($release['url'])){{ __('admin.updates.view_release') }}@endif
@if(trim($release['notes'] ?? '') !== '')
{{ __('admin.updates.release_notes') }}
{{ $release['notes'] }}
@endif
@csrf @if($onlyMajor) @endif
@csrf

{{ __('admin.updates.apply_hint') }}

@endif @if($report && $release)
{{ __('admin.updates.report_title', ['version' => $report['to']]) }}
{{ $report['ok'] ? __('admin.updates.report_ok') : __('admin.updates.report_blocked') }}
@if(! empty($report['blocking']))
{{ __('admin.updates.blocking') }}
@endif @if(! empty($report['warnings']))
{{ __('admin.updates.warnings') }}
@endif
{{ __('admin.updates.your_changes') }}

{{ __('admin.updates.files_summary', ['write' => $report['plan']['write'] ?? 0, 'delete' => $report['plan']['delete'] ?? 0]) }}

@foreach(['merged' => 'merged_files', 'kept' => 'kept_files'] as $key => $label) @if(! empty($report['plan'][$key]))
{{ __('admin.updates.'.$label, ['count' => count($report['plan'][$key])]) }}
    @foreach($report['plan'][$key] as $path)
  • {{ $path }}
  • @endforeach
@endif @endforeach @if(! empty($report['plan']['resolved']))
{{ __('admin.updates.resolved_files', ['count' => count($report['plan']['resolved'])]) }}
    @foreach($report['plan']['resolved'] as $item)
  • {{ $item['path'] }} · {{ __('admin.updates.choice_'.$item['resolution']) }}
  • @endforeach
@endif @if(! empty($report['conflicts']))
{{ __('admin.updates.conflicts_title', ['count' => count($report['conflicts'])]) }}

{{ __('admin.updates.conflicts_hint', ['path' => 'storage/app/pnlcs-update/set-aside']) }}

@csrf @foreach($report['conflicts'] as $i => $conflict) @php $current = old("choice.{$i}", $choices[$conflict['path']] ?? ''); $canEdit = array_key_exists($conflict['path'], $editable); @endphp
{{ $conflict['path'] }}
{{ __('admin.updates.conflict_kind.'.$conflict['kind']) }}
@if($conflict['kind'] === 'operator_directory')
{{ __('admin.updates.operator_directory_hint') }}
@else
@if($canEdit) @endif
@if($canEdit)
{{ __('admin.updates.editor_hint') }}
{{ __('admin.updates.download_merged') }} {{ __('admin.updates.or_upload') }}
@endif @endif
@endforeach
@endif
@endif
{{ __('admin.updates.bar_setting') }}
{{ $barOff ? __('admin.updates.bar_setting_off') : __('admin.updates.bar_setting_on') }}
@csrf
{{ __('admin.updates.history') }}
@if($history === [])
{{ __('admin.updates.history_empty') }}
@else
@foreach($history as $entry) @endforeach
{{ __('admin.updates.col_date') }} {{ __('admin.updates.col_from') }} {{ __('admin.updates.col_to') }} {{ __('admin.updates.col_by') }} {{ __('admin.updates.col_result') }}
{{ $when($entry['at'] ?? null) }} {{ $entry['from'] ?? '' }} {{ $entry['to'] ?? '' }} {{ $entry['by'] ?? '' }} {{ __('admin.updates.history_result.'.($entry['result'] ?? 'failed')) }}
@endif
@push('scripts') @endpush @endsection