Fix styling
This commit is contained in:
committed by
github-actions[bot]
parent
41fb6a1fc9
commit
d86274cc37
@@ -8,36 +8,43 @@ use Livewire\Component;
|
||||
class Show extends Component
|
||||
{
|
||||
public PrivateKey $private_key;
|
||||
public $public_key = "Loading...";
|
||||
|
||||
public $public_key = 'Loading...';
|
||||
|
||||
protected $rules = [
|
||||
'private_key.name' => 'required|string',
|
||||
'private_key.description' => 'nullable|string',
|
||||
'private_key.private_key' => 'required|string',
|
||||
'private_key.is_git_related' => 'nullable|boolean'
|
||||
'private_key.is_git_related' => 'nullable|boolean',
|
||||
];
|
||||
|
||||
protected $validationAttributes = [
|
||||
'private_key.name' => 'name',
|
||||
'private_key.description' => 'description',
|
||||
'private_key.private_key' => 'private key'
|
||||
'private_key.private_key' => 'private key',
|
||||
];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
try {
|
||||
$this->private_key = PrivateKey::ownedByCurrentTeam(['name', 'description', 'private_key', 'is_git_related'])->whereUuid(request()->private_key_uuid)->firstOrFail();
|
||||
}catch(\Throwable $e) {
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
}
|
||||
public function loadPublicKey() {
|
||||
|
||||
public function loadPublicKey()
|
||||
{
|
||||
$this->public_key = $this->private_key->publicKey();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
try {
|
||||
if ($this->private_key->isEmpty()) {
|
||||
$this->private_key->delete();
|
||||
currentTeam()->privateKeys = PrivateKey::where('team_id', currentTeam()->id)->get();
|
||||
|
||||
return redirect()->route('security.private-key.index');
|
||||
}
|
||||
$this->dispatch('error', 'This private key is in use and cannot be deleted. Please delete all servers, applications, and GitHub/GitLab apps that use this private key before deleting it.');
|
||||
|
||||
Reference in New Issue
Block a user