2023-10-09 09:00:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire\Server\PrivateKey;
|
|
|
|
|
|
|
|
use App\Models\PrivateKey;
|
|
|
|
use App\Models\Server;
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class Show extends Component
|
|
|
|
{
|
|
|
|
public ?Server $server = null;
|
|
|
|
public $privateKeys = [];
|
|
|
|
public $parameters = [];
|
|
|
|
public function mount()
|
|
|
|
{
|
|
|
|
$this->parameters = get_route_parameters();
|
|
|
|
try {
|
2023-10-09 13:08:28 +00:00
|
|
|
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
|
2023-10-09 09:00:18 +00:00
|
|
|
if (is_null($this->server)) {
|
|
|
|
return redirect()->route('server.all');
|
|
|
|
}
|
|
|
|
$this->privateKeys = PrivateKey::ownedByCurrentTeam()->get()->where('is_git_related', false);
|
|
|
|
} catch (\Throwable $e) {
|
|
|
|
return handleError($e, $this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return view('livewire.server.private-key.show');
|
|
|
|
}
|
|
|
|
}
|