feat: Add manual update check functionality to settings page

This commit is contained in:
Andras Bacsai
2024-08-07 11:42:55 +02:00
parent af41ed26ba
commit d3085e1ade
4 changed files with 48 additions and 31 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Livewire\Settings;
use App\Jobs\CheckForUpdatesJob;
use App\Models\InstanceSettings;
use App\Models\Server;
use Cron\CronExpression;
@@ -182,6 +183,18 @@ class Index extends Component
}
}
public function checkManually()
{
CheckForUpdatesJob::dispatchSync();
$this->dispatch('updateAvailable');
$settings = InstanceSettings::get();
if ($settings->new_version_available) {
$this->dispatch('success', 'New version available!');
} else {
$this->dispatch('success', 'No new version available.');
}
}
public function render()
{
return view('livewire.settings.index');