This commit is contained in:
Andras Bacsai
2023-06-15 11:39:15 +02:00
parent 766a3d490a
commit cdf6e600bd
5 changed files with 80 additions and 96 deletions

View File

@@ -1,24 +0,0 @@
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class CheckUpdate extends Component
{
public $updateAvailable = false;
public $latestVersion = 'latest';
protected $currentVersion;
protected $image = 'ghcr.io/coollabsio/coolify';
public function checkUpdate()
{
$this->latestVersion = get_latest_version_of_coolify();
$this->currentVersion = config('version');
if ($this->latestVersion === 'latest') {
$this->updateAvailable = true;
return;
}
version_compare($this->currentVersion, $this->latestVersion, '<') ? $this->updateAvailable = true : $this->updateAvailable = false;
}
}

View File

@@ -9,6 +9,18 @@ use Livewire\Component;
class Upgrade extends Component
{
public bool $showProgress = false;
public bool $isUpgradeAvailable = false;
public function checkUpdate()
{
$latestVersion = get_latest_version_of_coolify();
$currentVersion = config('version');
version_compare($currentVersion, $latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;
if (config('app.env') === 'local') {
$this->isUpgradeAvailable = true;
}
ray($this->isUpgradeAvailable);
}
public function upgrade()
{
try {