2023-04-28 15:08:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
|
2023-06-15 11:23:48 +02:00
|
|
|
use App\Actions\Server\UpdateCoolify;
|
2023-06-15 10:48:13 +02:00
|
|
|
use Masmerise\Toaster\Toaster;
|
2023-04-28 15:08:48 +02:00
|
|
|
use Livewire\Component;
|
|
|
|
|
2023-06-15 10:48:13 +02:00
|
|
|
class Upgrade extends Component
|
2023-04-28 15:08:48 +02:00
|
|
|
{
|
2023-06-15 10:48:13 +02:00
|
|
|
public bool $showProgress = false;
|
2023-04-28 15:08:48 +02:00
|
|
|
public function upgrade()
|
|
|
|
{
|
2023-05-25 22:33:47 +02:00
|
|
|
try {
|
2023-06-15 10:48:13 +02:00
|
|
|
$this->showProgress = true;
|
2023-06-15 11:23:48 +02:00
|
|
|
resolve(UpdateCoolify::class)(true);
|
2023-06-15 10:48:13 +02:00
|
|
|
Toaster::success('Update started.');
|
2023-05-25 22:33:47 +02:00
|
|
|
} catch (\Exception $e) {
|
2023-06-09 15:55:21 +02:00
|
|
|
return general_error_handler(err: $e, that: $this);
|
2023-05-25 22:33:47 +02:00
|
|
|
}
|
2023-04-28 15:08:48 +02:00
|
|
|
}
|
|
|
|
}
|