Move system update output under actions and remove search
This commit is contained in:
@@ -306,28 +306,13 @@ class ServerUpdates extends Page implements HasActions, HasTable
|
|||||||
})
|
})
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
->label(__('Package'))
|
->label(__('Package')),
|
||||||
->searchable(),
|
|
||||||
TextColumn::make('current_version')
|
TextColumn::make('current_version')
|
||||||
->label(__('Current Version')),
|
->label(__('Current Version')),
|
||||||
TextColumn::make('new_version')
|
TextColumn::make('new_version')
|
||||||
->label(__('New Version')),
|
->label(__('New Version')),
|
||||||
])
|
])
|
||||||
->emptyStateHeading(__('No updates available'))
|
->emptyStateHeading(__('No updates available'))
|
||||||
->emptyStateDescription(__('Your system packages are up to date.'))
|
->emptyStateDescription(__('Your system packages are up to date.'));
|
||||||
->headerActions([
|
|
||||||
Action::make('refresh')
|
|
||||||
->label(__('Refresh'))
|
|
||||||
->icon('heroicon-o-arrow-path')
|
|
||||||
->action(fn () => $this->loadUpdates(true, true)),
|
|
||||||
Action::make('runUpdates')
|
|
||||||
->label(__('Run Updates'))
|
|
||||||
->icon('heroicon-o-arrow-path-rounded-square')
|
|
||||||
->color('primary')
|
|
||||||
->requiresConfirmation()
|
|
||||||
->modalHeading(__('Install updates'))
|
|
||||||
->modalDescription(__('This will run apt-get upgrade on the server. Continue?'))
|
|
||||||
->action(fn () => $this->runUpdates()),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,24 +72,53 @@
|
|||||||
@endif
|
@endif
|
||||||
</x-filament::section>
|
</x-filament::section>
|
||||||
|
|
||||||
{{ $this->table }}
|
<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">
|
||||||
@if ($refreshOutputAt)
|
<div class="text-sm font-semibold text-gray-900 dark:text-gray-100">
|
||||||
<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">
|
{{ __('System Packages') }}
|
||||||
<summary class="cursor-pointer list-none text-sm font-semibold text-gray-900 dark:text-gray-100">
|
|
||||||
{{ $refreshOutputTitle ?? __('System Update Output') }}
|
|
||||||
<span class="ml-2 text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
||||||
{{ __('Last run at :time', ['time' => $refreshOutputAt]) }}
|
|
||||||
</span>
|
|
||||||
</summary>
|
|
||||||
<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>
|
||||||
</details>
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
@endif
|
<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-actions::modals />
|
||||||
</x-filament-panels::page>
|
</x-filament-panels::page>
|
||||||
|
|||||||
Reference in New Issue
Block a user