add server form fixes
This commit is contained in:
parent
4ebae8dcf6
commit
77c86400c0
@ -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,
|
||||
|
@ -1,18 +1,20 @@
|
||||
<div>
|
||||
<form wire:submit.prevent='submit'>
|
||||
<form class="flex flex-col" wire:submit.prevent='submit'>
|
||||
<x-form-input id="name" label="Name" required />
|
||||
<x-form-input id="description" label="Description" required />
|
||||
<x-form-input id="ip" label="IP Address" required />
|
||||
<x-form-input id="user" label="User" />
|
||||
<x-form-input type="number" id="port" label="Port" />
|
||||
<button type="submit">
|
||||
<button class="mt-4" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
<div>Select a private key:</div>
|
||||
<h1>Select a private key</h1>
|
||||
@foreach ($private_keys as $key)
|
||||
<button @if ($private_key_id == $key->id) class="bg-green-500" @endif
|
||||
wire:click="setPrivateKey('{{ $key->id }}')">{{ $key->name }}</button>
|
||||
@endforeach
|
||||
<div> Add a new One:</div>
|
||||
<h2>Add a new One</h2>
|
||||
<form wire:submit.prevent='addPrivateKey'>
|
||||
<x-form-input id="new_private_key_name" label="Name" required />
|
||||
<x-form-input id="new_private_key_description" label="Longer Description" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user