125 lines
6.1 KiB
PHP
125 lines
6.1 KiB
PHP
<x-filament-panels::page>
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
{{ __('Jabali Panel Update') }}
|
|
</x-slot>
|
|
<x-slot name="description">
|
|
{{ __('Update the panel codebase and assets.') }}
|
|
</x-slot>
|
|
|
|
<div class="grid gap-4 md:grid-cols-3">
|
|
<div class="rounded-lg border border-gray-200 bg-white p-4 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<div class="text-xs uppercase text-gray-500 dark:text-gray-400">{{ __('Current Version') }}</div>
|
|
<div class="mt-1 text-lg font-semibold text-gray-900 dark:text-gray-100">{{ $currentVersion ?? 'unknown' }}</div>
|
|
</div>
|
|
<div class="rounded-lg border border-gray-200 bg-white p-4 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<div class="text-xs uppercase text-gray-500 dark:text-gray-400">{{ __('Status') }}</div>
|
|
<div class="mt-1 text-lg font-semibold text-gray-900 dark:text-gray-100">{{ $this->updateStatusLabel }}</div>
|
|
</div>
|
|
<div class="rounded-lg border border-gray-200 bg-white p-4 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<div class="text-xs uppercase text-gray-500 dark:text-gray-400">{{ __('Last Checked') }}</div>
|
|
<div class="mt-1 text-lg font-semibold text-gray-900 dark:text-gray-100">{{ $lastCheckedAt ?? __('Not checked') }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if (! empty($recentChanges))
|
|
<div class="mt-4 rounded-lg border border-gray-200 bg-white p-4 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<div class="text-xs font-semibold uppercase text-gray-500 dark:text-gray-400">{{ __('Recent Changes') }}</div>
|
|
<ul class="mt-2 list-inside list-disc space-y-1 text-gray-700 dark:text-gray-200">
|
|
@foreach ($recentChanges as $change)
|
|
<li>{{ $change }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="mt-4 flex flex-wrap items-center gap-2">
|
|
<x-filament::button
|
|
icon="heroicon-o-magnifying-glass"
|
|
color="gray"
|
|
wire:click="checkForUpdates"
|
|
wire:loading.attr="disabled"
|
|
wire:target="checkForUpdates"
|
|
>
|
|
{{ __('Check for updates') }}
|
|
</x-filament::button>
|
|
|
|
<x-filament::button
|
|
icon="heroicon-o-arrow-path-rounded-square"
|
|
color="primary"
|
|
wire:click="performUpgrade"
|
|
wire:loading.attr="disabled"
|
|
wire:target="performUpgrade"
|
|
>
|
|
{{ __('Upgrade now') }}
|
|
</x-filament::button>
|
|
</div>
|
|
|
|
@if ($jabaliOutput !== null)
|
|
<details class="mt-4 rounded border border-gray-200 bg-white p-4 shadow-sm open:shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<summary class="cursor-pointer list-none text-sm font-semibold text-gray-900 dark:text-gray-100">
|
|
{{ $jabaliOutputTitle ?? __('Jabali Update Output') }}
|
|
@if ($jabaliOutputAt)
|
|
<span class="ml-2 text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
{{ __('Last run at :time', ['time' => $jabaliOutputAt]) }}
|
|
</span>
|
|
@endif
|
|
</summary>
|
|
<div class="mt-3 text-sm text-gray-700 dark:text-gray-200">
|
|
<pre class="whitespace-pre-wrap break-words rounded bg-gray-50 p-4 text-xs text-gray-800 dark:bg-gray-900/50 dark:text-gray-200">{{ $jabaliOutput }}</pre>
|
|
</div>
|
|
</details>
|
|
@endif
|
|
</x-filament::section>
|
|
|
|
<div class="mt-6 rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
|
<div class="text-sm font-semibold text-gray-900 dark:text-gray-100">
|
|
{{ __('System Packages') }}
|
|
</div>
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<x-filament::button
|
|
icon="heroicon-o-arrow-path"
|
|
color="gray"
|
|
wire:click="loadUpdates(true, true)"
|
|
wire:loading.attr="disabled"
|
|
wire:target="loadUpdates"
|
|
>
|
|
{{ __('Refresh') }}
|
|
</x-filament::button>
|
|
|
|
<x-filament::button
|
|
icon="heroicon-o-arrow-path-rounded-square"
|
|
color="primary"
|
|
wire:click="runUpdates"
|
|
wire:loading.attr="disabled"
|
|
wire:target="runUpdates"
|
|
>
|
|
{{ __('Run Updates') }}
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
|
|
@if ($refreshOutputAt)
|
|
<div class="mt-4 rounded border border-gray-200 bg-white p-4 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-900">
|
|
<div class="flex flex-wrap items-center justify-between gap-2 text-sm font-semibold text-gray-900 dark:text-gray-100">
|
|
<span>{{ $refreshOutputTitle ?? __('Update Refresh Output') }}</span>
|
|
<span class="text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
{{ __('Last run at :time', ['time' => $refreshOutputAt]) }}
|
|
</span>
|
|
</div>
|
|
<div class="mt-3 text-sm text-gray-700 dark:text-gray-200">
|
|
@php
|
|
$outputLines = is_array($refreshOutput) ? $refreshOutput : [$refreshOutput];
|
|
@endphp
|
|
<pre class="whitespace-pre-wrap break-words rounded bg-gray-50 p-4 text-xs text-gray-800 dark:bg-gray-900/50 dark:text-gray-200">{{ implode("\n", $outputLines) }}</pre>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
{{ $this->table }}
|
|
|
|
<x-filament-actions::modals />
|
|
</x-filament-panels::page>
|