From e4c961ebb9e954ea6cc9d662a2af3897408403cd Mon Sep 17 00:00:00 2001 From: cp6 Date: Sat, 19 Feb 2022 23:34:37 +1100 Subject: [PATCH] Updated servers show controller and blade view Updated servers show controller and blade view --- app/Http/Controllers/ServerController.php | 10 +- resources/views/servers/show.blade.php | 267 +++++++++++----------- 2 files changed, 141 insertions(+), 136 deletions(-) diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 8c6796c..bef50af 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -143,15 +143,21 @@ class ServerController extends Controller ->join('providers as p', 's.provider_id', '=', 'p.id') ->join('locations as l', 's.location_id', '=', 'l.id') ->join('os as o', 's.os_id', '=', 'o.id') + ->Leftjoin('yabs as y', 's.id', '=', 'y.server_id') + ->Leftjoin('disk_speed as ds', 'y.id', '=', 'ds.id') ->where('s.id', '=', $server->id) - ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'pr.*']); + ->get(['s.*', 'p.name as provider', 'l.name as location', 'o.name as os_name', 'pr.*', 'y.*', 'ds.*']); + + $network_speeds = json_decode(DB::table('network_speed') + ->where('network_speed.server_id', '=', $server->id) + ->get(),true); $labels = DB::table('labels_assigned as l') ->join('labels', 'l.label_id', '=', 'labels.id') ->where('l.service_id', '=', $server->id) ->get(['labels.label']); - return view('servers.show', compact(['server', 'server_extras', 'labels'])); + return view('servers.show', compact(['server', 'server_extras', 'network_speeds', 'labels'])); } public function edit(Server $server) diff --git a/resources/views/servers/show.blade.php b/resources/views/servers/show.blade.php index 4523e54..93dd35d 100644 --- a/resources/views/servers/show.blade.php +++ b/resources/views/servers/show.blade.php @@ -4,178 +4,177 @@ {{ __('Server details') }}
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Labels - @foreach($labels as $label) - @if($loop->last) - {{$label->label}} - @else - {{$label->label}}, - @endif - @endforeach -
Id{{ $server->id }}
Name{{ $server->hostname }}
OS{{ $server->osIdAsString((string)$server->os_id) }}
Location{{ $server_extras[0]->location }}
Provider{{ $server_extras[0]->provider_name }}
Ipv4{{ $server->ipv4 }}
Ipv6{{ $server->ipv6 }}
Price{{ $server_extras[0]->price }} {{ $server_extras[0]->currency }}
Term{{ $server_extras[0]->term }}
NS1{{ $server->ns1 }}
NS2{{ $server->ns2 }}
Server type{{ $server->serviceServerType($server->server_type) }}
Owned since - @if(!is_null($server->owned_since)) - {{ date_format(new DateTime($server->owned_since), 'jS F Y') }} - @endif -
Next due date - @if(!is_null($server_extras[0]->next_due_date)) - {{ date_format(new DateTime($server_extras[0]->next_due_date), 'jS F Y') }} - @endif -
Created on{{ date_format($server->created_at, 'jS F Y') }}
Last updated{{ date_format($server->updated_at, 'jS F Y') }}
-
-
-
- +
+ + Go back + + + Edit + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @foreach($network_speeds as $ns) + + + + + @endforeach + +
GB5 Single/Multi + {{$server_extras[0]->gb5_single}} / {{$server_extras[0]->gb5_multi}} +
CPU{{$server_extras[0]->cpu}}
AES{{ ($server_extras[0]->aes === 1) ? 'Yes' : 'No' }}
VM{{ ($server_extras[0]->vm === 1) ? 'Yes' : 'No' }}
Disk 4k{{$server_extras[0]->d_4k}} {{$server_extras[0]->d_4k_type}}
Disk 64k{{$server_extras[0]->d_64k}} {{$server_extras[0]->d_64k_type}}
Disk 512k{{$server_extras[0]->d_512k}} {{$server_extras[0]->d_512k_type}}
Disk 1m{{$server_extras[0]->d_1m}} {{$server_extras[0]->d_1m_type}}
Network speed (s/r)
{{$ns['location']}}{{$ns['send']}} {{$ns['send_type']}} {{$ns['receive']}} {{$ns['receive_type']}}
- - Go back - - - Edit -
-
+ @if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)

Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}