change/modify/delete/add private keys
This commit is contained in:
26
app/Http/Livewire/Server/PrivateKey.php
Normal file
26
app/Http/Livewire/Server/PrivateKey.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Server;
|
||||
|
||||
use App\Models\PrivateKey as ModelsPrivateKey;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Livewire\Component;
|
||||
|
||||
class PrivateKey extends Component
|
||||
{
|
||||
public $private_keys;
|
||||
public $parameters;
|
||||
public function setPrivateKey($private_key_id)
|
||||
{
|
||||
Server::where('uuid', $this->parameters['server_uuid'])->update([
|
||||
'private_key_id' => $private_key_id
|
||||
]);
|
||||
return redirect()->route('server.show', $this->parameters['server_uuid']);
|
||||
}
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = Route::current()->parameters();
|
||||
$this->private_keys = ModelsPrivateKey::where('team_id', session('currentTeam')->id)->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user