add server form fixes

This commit is contained in:
Andras Bacsai
2023-05-02 09:20:08 +02:00
parent 4ebae8dcf6
commit 77c86400c0
2 changed files with 11 additions and 5 deletions

View File

@@ -14,12 +14,15 @@ class ByIp extends Component
public $new_private_key_description;
public $new_private_key_value;
public string $name;
public string $description;
public string $ip;
public string $user = 'root';
public int $port = 22;
public function mount()
{
$this->name = generateRandomName();
$this->private_keys = PrivateKey::where('team_id', session('currentTeam')->id)->get();
}
public function setPrivateKey($private_key_id)
@@ -43,7 +46,8 @@ class ByIp extends Component
public function submit()
{
$server = Server::create([
'name' => generateRandomName(),
'name' => $this->name,
'description' => $this->description,
'ip' => $this->ip,
'user' => $this->user,
'port' => $this->port,