fix: use only ip addresses for servers

This commit is contained in:
Andras Bacsai 2023-10-11 09:57:35 +02:00
parent a4f1fcba58
commit f943fdc5be
4 changed files with 12 additions and 12 deletions

View File

@ -164,7 +164,7 @@ public function saveServer()
{ {
$this->validate([ $this->validate([
'remoteServerName' => 'required', 'remoteServerName' => 'required',
'remoteServerHost' => 'required', 'remoteServerHost' => 'required|ip',
'remoteServerPort' => 'required|integer', 'remoteServerPort' => 'required|integer',
'remoteServerUser' => 'required', 'remoteServerUser' => 'required',
]); ]);

View File

@ -11,13 +11,13 @@ class ByIp extends Component
{ {
public $private_keys; public $private_keys;
public $limit_reached; public $limit_reached;
public int|null $private_key_id = null; public ?int $private_key_id = null;
public $new_private_key_name; public $new_private_key_name;
public $new_private_key_description; public $new_private_key_description;
public $new_private_key_value; public $new_private_key_value;
public string $name; public string $name;
public string|null $description = null; public ?string $description = null;
public string $ip; public string $ip;
public string $user = 'root'; public string $user = 'root';
public int $port = 22; public int $port = 22;
@ -26,16 +26,16 @@ class ByIp extends Component
protected $rules = [ protected $rules = [
'name' => 'required|string', 'name' => 'required|string',
'description' => 'nullable|string', 'description' => 'nullable|string',
'ip' => 'required', 'ip' => 'required|ip',
'user' => 'required|string', 'user' => 'required|string',
'port' => 'required|integer', 'port' => 'required|integer',
]; ];
protected $validationAttributes = [ protected $validationAttributes = [
'name' => 'name', 'name' => 'Name',
'description' => 'description', 'description' => 'Description',
'ip' => 'ip', 'ip' => 'IP Address',
'user' => 'user', 'user' => 'User',
'port' => 'port', 'port' => 'Port',
]; ];
public function mount() public function mount()

View File

@ -200,7 +200,7 @@
label="Description" id="remoteServerDescription" /> label="Description" id="remoteServerDescription" />
</div> </div>
<div class="flex gap-2"> <div class="flex gap-2">
<x-forms.input required placeholder="Hostname or IP address" label="Hostname or IP Address" <x-forms.input required placeholder="127.0.0.1" label="IP Address"
id="remoteServerHost" /> id="remoteServerHost" />
<x-forms.input required placeholder="Port number of your server. Default is 22." <x-forms.input required placeholder="Port number of your server. Default is 22."
label="Port" id="remoteServerPort" /> label="Port" id="remoteServerPort" />

View File

@ -11,8 +11,8 @@
</div> </div>
<div class="flex gap-2"> <div class="flex gap-2">
<x-forms.input id="ip" label="IP Address" required <x-forms.input id="ip" label="IP Address" required
helper="Could be IP Address (127.0.0.1) or Domain Name (duckduckgo.com)." /> helper="An IP Address (127.0.0.1). No domain names." />
<x-forms.input id="user" label="User" required /> <x-forms.input id="user" label ="User" required />
<x-forms.input type="number" id="port" label="Port" required /> <x-forms.input type="number" id="port" label="Port" required />
</div> </div>
<x-forms.select label="Private Key" id="private_key_id"> <x-forms.select label="Private Key" id="private_key_id">