Update app/Livewire/Server/Security/Patches.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -67,8 +67,18 @@ class Patches extends Component
|
|||||||
|
|
||||||
public function updateAllPackages()
|
public function updateAllPackages()
|
||||||
{
|
{
|
||||||
|
if (! $this->packageManager || ! $this->osId) {
|
||||||
|
$this->dispatch('error', message: 'Run “Check for updates” first.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$activity = UpdatePackage::run(server: $this->server, packageManager: $this->packageManager, osId: $this->osId, all: true);
|
$activity = UpdatePackage::run(
|
||||||
|
server: $this->server,
|
||||||
|
packageManager: $this->packageManager,
|
||||||
|
osId: $this->osId,
|
||||||
|
all: true
|
||||||
|
);
|
||||||
$this->dispatch('activityMonitor', $activity->id, ServerPackageUpdated::class);
|
$this->dispatch('activityMonitor', $activity->id, ServerPackageUpdated::class);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->dispatch('error', message: $e->getMessage());
|
$this->dispatch('error', message: $e->getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user