2023-04-14 08:00:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class CheckUpdate extends Component
|
|
|
|
{
|
|
|
|
public $updateAvailable = false;
|
2023-04-27 11:02:24 +00:00
|
|
|
public $latestVersion = 'latest';
|
2023-04-14 08:00:42 +00:00
|
|
|
protected $currentVersion;
|
|
|
|
protected $image = 'ghcr.io/coollabsio/coolify';
|
|
|
|
|
|
|
|
public function checkUpdate()
|
|
|
|
{
|
2023-05-24 12:26:50 +00:00
|
|
|
$this->latestVersion = get_latest_version_of_coolify();
|
2023-05-09 12:46:22 +00:00
|
|
|
$this->currentVersion = config('version');
|
2023-04-27 11:02:24 +00:00
|
|
|
if ($this->latestVersion === 'latest') {
|
|
|
|
$this->updateAvailable = true;
|
|
|
|
return;
|
|
|
|
}
|
2023-04-14 08:00:42 +00:00
|
|
|
version_compare($this->currentVersion, $this->latestVersion, '<') ? $this->updateAvailable = true : $this->updateAvailable = false;
|
|
|
|
}
|
|
|
|
}
|