From 41413a224f3d3f81a3ee017d308157d503d76d1c Mon Sep 17 00:00:00 2001 From: cp6 Date: Tue, 4 Oct 2022 11:13:57 +1100 Subject: [PATCH] Updated server fixed server_type & virt Updated server fixed server_type & virt Merged server_type & virt into just server_type Updated serviceServerType() for paramater types and a short/long return value --- app/Models/Server.php | 10 +++- resources/views/servers/create.blade.php | 28 ++++------ resources/views/servers/edit.blade.php | 66 ++++++++++-------------- resources/views/servers/show.blade.php | 2 +- 4 files changed, 47 insertions(+), 59 deletions(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index c19d8d0..0d059ed 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -68,19 +68,27 @@ class Server extends Model }); } - public static function serviceServerType($type) + public static function serviceServerType(int $type, bool $short = true): string { if ($type === 1) { return "KVM"; } elseif ($type === 2) { return "OVZ"; } elseif ($type === 3) { + if (!$short) { + return "Dedicated"; + } return "DEDI"; } elseif ($type === 4) { return "LXC"; } elseif ($type === 6) { return "VMware"; + } elseif ($type === 7) { + return "NAT"; } else { + if (!$short) { + return "Semi-dedicated"; + } return "SEMI-DEDI"; } } diff --git a/resources/views/servers/create.blade.php b/resources/views/servers/create.blade.php index a078c85..4b72fe1 100644 --- a/resources/views/servers/create.blade.php +++ b/resources/views/servers/create.blade.php @@ -35,14 +35,16 @@
-
Type
+
Server type
-
+ + + + + + + +
@@ -84,18 +86,6 @@
-
-
-
Virt
-
-
SSH diff --git a/resources/views/servers/edit.blade.php b/resources/views/servers/edit.blade.php index b39b263..67cada8 100644 --- a/resources/views/servers/edit.blade.php +++ b/resources/views/servers/edit.blade.php @@ -31,43 +31,7 @@
-
Type
- -
-
-
- - {{$server_data->os_id}} - -
-
-
-
- - NS1 - ns1 - 255 - {{ $server_data->ns1 }} - -
-
- - NS2 - ns2 - 255 - {{ $server_data->ns2 }} - -
-
-
-
-
-
Virt
+
Server type
+ + {{$server_data->os_id}} + +
+
+
+
+ + NS1 + ns1 + 255 + {{ $server_data->ns1 }} + +
+
+ + NS2 + ns2 + 255 + {{ $server_data->ns2 }} + +
+
SSH ssh_port @@ -105,7 +95,7 @@ {{ $server_data->bandwidth }}
-
+
Promo price was_promo diff --git a/resources/views/servers/show.blade.php b/resources/views/servers/show.blade.php index 249667d..9c0f65d 100644 --- a/resources/views/servers/show.blade.php +++ b/resources/views/servers/show.blade.php @@ -37,7 +37,7 @@ Type - {{ $server_data->serviceServerType($server_data->server_type) }} + {{ $server_data->serviceServerType($server_data->server_type, false) }}