From f943fdc5bed4ae4b122d0e03572a09f6337794ff Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 11 Oct 2023 09:57:35 +0200 Subject: [PATCH] fix: use only ip addresses for servers --- app/Http/Livewire/Boarding/Index.php | 2 +- app/Http/Livewire/Server/New/ByIp.php | 16 ++++++++-------- .../views/livewire/boarding/index.blade.php | 2 +- .../views/livewire/server/new/by-ip.blade.php | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Http/Livewire/Boarding/Index.php b/app/Http/Livewire/Boarding/Index.php index c8a53d26e..53065918a 100644 --- a/app/Http/Livewire/Boarding/Index.php +++ b/app/Http/Livewire/Boarding/Index.php @@ -164,7 +164,7 @@ public function saveServer() { $this->validate([ 'remoteServerName' => 'required', - 'remoteServerHost' => 'required', + 'remoteServerHost' => 'required|ip', 'remoteServerPort' => 'required|integer', 'remoteServerUser' => 'required', ]); diff --git a/app/Http/Livewire/Server/New/ByIp.php b/app/Http/Livewire/Server/New/ByIp.php index f5c8529de..ec4827af7 100644 --- a/app/Http/Livewire/Server/New/ByIp.php +++ b/app/Http/Livewire/Server/New/ByIp.php @@ -11,13 +11,13 @@ class ByIp extends Component { public $private_keys; 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_description; public $new_private_key_value; public string $name; - public string|null $description = null; + public ?string $description = null; public string $ip; public string $user = 'root'; public int $port = 22; @@ -26,16 +26,16 @@ class ByIp extends Component protected $rules = [ 'name' => 'required|string', 'description' => 'nullable|string', - 'ip' => 'required', + 'ip' => 'required|ip', 'user' => 'required|string', 'port' => 'required|integer', ]; protected $validationAttributes = [ - 'name' => 'name', - 'description' => 'description', - 'ip' => 'ip', - 'user' => 'user', - 'port' => 'port', + 'name' => 'Name', + 'description' => 'Description', + 'ip' => 'IP Address', + 'user' => 'User', + 'port' => 'Port', ]; public function mount() diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php index 37ed1cfd8..d9a852067 100644 --- a/resources/views/livewire/boarding/index.blade.php +++ b/resources/views/livewire/boarding/index.blade.php @@ -200,7 +200,7 @@ label="Description" id="remoteServerDescription" />
- diff --git a/resources/views/livewire/server/new/by-ip.blade.php b/resources/views/livewire/server/new/by-ip.blade.php index 2c84e6cf3..0a80b14a4 100644 --- a/resources/views/livewire/server/new/by-ip.blade.php +++ b/resources/views/livewire/server/new/by-ip.blade.php @@ -11,8 +11,8 @@
- + helper="An IP Address (127.0.0.1). No domain names." /> +