This commit is contained in:
Andras Bacsai
2023-06-16 12:35:40 +02:00
parent 7456fc1ac7
commit 3589b92ec9
84 changed files with 285 additions and 244 deletions

View File

@@ -10,12 +10,13 @@ class Upgrade extends Component
{
public bool $showProgress = false;
public bool $isUpgradeAvailable = false;
public string $latestVersion = '';
public function checkUpdate()
{
$latestVersion = get_latest_version_of_coolify();
$this->latestVersion = get_latest_version_of_coolify();
$currentVersion = config('version');
version_compare($currentVersion, $latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;
version_compare($currentVersion, $this->latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;
if (isDev()) {
$this->isUpgradeAvailable = true;
}
@@ -25,7 +26,7 @@ class Upgrade extends Component
try {
$this->showProgress = true;
resolve(UpdateCoolify::class)(true);
Toaster::success('Upgrading Coolify to latest version...');
Toaster::success("Upgrading Coolify to {$this->latestVersion} version...");
} catch (\Exception $e) {
return general_error_handler(err: $e, that: $this);
}