mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-02 12:19:57 +00:00
Remove changelog loading logic from upgrade component
This commit is contained in:
@@ -18,8 +18,6 @@ class Upgrade extends Component
|
||||
|
||||
public string $currentVersion = '';
|
||||
|
||||
public array $changelogEntries = [];
|
||||
|
||||
protected $listeners = ['updateAvailable' => 'checkUpdate'];
|
||||
|
||||
public function mount()
|
||||
@@ -36,37 +34,11 @@ class Upgrade extends Component
|
||||
if (isDev()) {
|
||||
$this->isUpgradeAvailable = true;
|
||||
}
|
||||
$this->loadChangelog();
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
public function loadChangelog()
|
||||
{
|
||||
try {
|
||||
$service = app(ChangelogService::class);
|
||||
$currentVersion = str_replace('v', '', $this->currentVersion);
|
||||
|
||||
$this->changelogEntries = $service->getEntries(1)
|
||||
->filter(function ($entry) use ($currentVersion) {
|
||||
$entryVersion = str_replace('v', '', $entry->tag_name);
|
||||
|
||||
return version_compare($entryVersion, $currentVersion, '>');
|
||||
})
|
||||
->take(3)
|
||||
->map(fn ($entry) => [
|
||||
'tag_name' => $entry->tag_name,
|
||||
'title' => $entry->title,
|
||||
'content_html' => $entry->content_html,
|
||||
])
|
||||
->values()
|
||||
->toArray();
|
||||
} catch (\Throwable $e) {
|
||||
$this->changelogEntries = [];
|
||||
}
|
||||
}
|
||||
|
||||
public function upgrade()
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user