change/modify/delete/add private keys

This commit is contained in:
Andras Bacsai
2023-05-03 12:38:57 +02:00
parent 906b4ce158
commit 612460ca16
16 changed files with 169 additions and 24 deletions

View File

@@ -15,7 +15,7 @@ class ByIp extends Component
public $new_private_key_value;
public string $name;
public string $description;
public string|null $description = null;
public string $ip;
public string $user = 'root';
public int $port = 22;
@@ -29,20 +29,6 @@ class ByIp extends Component
{
$this->private_key_id = $private_key_id;
}
public function addPrivateKey()
{
$this->new_private_key_value = trim($this->new_private_key_value);
if (!str_ends_with($this->new_private_key_value, "\n")) {
$this->new_private_key_value .= "\n";
}
PrivateKey::create([
'name' => $this->new_private_key_name,
'description' => $this->new_private_key_description,
'private_key' => $this->new_private_key_value,
'team_id' => session('currentTeam')->id
]);
session('currentTeam')->privateKeys = $this->private_keys = PrivateKey::where('team_id', session('currentTeam')->id)->get();
}
public function submit()
{
if (!$this->private_key_id) {