mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Actions\Server\EditServer;
|
||||
use App\Actions\Server\RebootServer;
|
||||
use App\Actions\Server\Update;
|
||||
use App\Facades\Toast;
|
||||
use App\Helpers\HtmxResponse;
|
||||
use App\Models\Server;
|
||||
@ -64,4 +65,24 @@ public function edit(Request $request, Server $server): RedirectResponse
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function checkUpdates(Server $server): RedirectResponse
|
||||
{
|
||||
$this->authorize('manage', $server);
|
||||
|
||||
$server->checkForUpdates();
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function update(Server $server): HtmxResponse
|
||||
{
|
||||
$this->authorize('manage', $server);
|
||||
|
||||
app(Update::class)->update($server);
|
||||
|
||||
Toast::info('Updating server. This may take a few minutes.');
|
||||
|
||||
return htmx()->back();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user