/
dimamir
/
coolify
Обзор
Документация
Войти
/
dimamir
/
coolify
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
app/Livewire/Upgrade.php
46 строк
1 KB
Andras Bacsai
fix: manual update should be executed only once + better UX
10 ноя 2024, 23:26
10 ноя 2024, 23:26
704e251
Код
Авторство
О чём код?
<?php namespace App\Livewire; use App\Actions\Server\UpdateCoolify; use App\Models\InstanceSettings; use Livewire\Component; class Upgrade extends Component { public bool $showProgress = false; public bool $updateInProgress = false; public bool $isUpgradeAvailable = false; public string $latestVersion = ''; protected $listeners = ['updateAvailable' => 'checkUpdate']; public function checkUpdate() { try { $this->latestVersion = get_latest_version_of_coolify(); $this->isUpgradeAvailable = data_get(InstanceSettings::get(), 'new_version_available', false); if (isDev()) { $this->isUpgradeAvailable = true; } } catch (\Throwable $e) { return handleError($e, $this); } } public function upgrade() { try { if ($this->updateInProgress) { return; } $this->updateInProgress = true; UpdateCoolify::run(manual_update: true); } catch (\Throwable $e) { return handleError($e, $this); } } }