diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 6ee375b..497358c 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -58,11 +58,12 @@ 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('ips as i', 's.id', '=', 'i.service_id') ->LeftJoin('yabs as y', 's.id', '=', 'y.server_id') ->LeftJoin('disk_speed as ds', 'y.id', '=', 'ds.id') ->where('s.show_public', '=', 1) - ->get(['pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'pr.service_id', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'y.*', 'y.id as yabs_id', 'ds.*', 's.*']); - + ->get(['pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'pr.service_id', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'y.*', 'y.id as yabs_id', 'ds.*', 's.*', 'i.address as ip', 'i.is_ipv4']); + return view('servers.public-index', compact('servers')); } return response()->view('errors.404', array("status" => 404, "title" => "Page not found", "message" => ""), 404); diff --git a/resources/views/servers/public-index.blade.php b/resources/views/servers/public-index.blade.php index bb67a29..50b4c2d 100644 --- a/resources/views/servers/public-index.blade.php +++ b/resources/views/servers/public-index.blade.php @@ -9,7 +9,9 @@ - + @if(Session::get('show_server_value_hostname') === 1) + + @endif @@ -19,26 +21,28 @@ + - - - + @if(Session::get('show_server_value_ip') === 1) + + + @endif @if(!empty($servers)) @foreach($servers as $s) - + + @endif @@ -69,6 +73,7 @@ @endif + - - - + @if(Session::get('show_server_value_ip') === 1) + + + @endif @endforeach @else
NameName OS Location Provider PriceHad since GB5 S GB5 M 4k 64k 512k 1mHad sinceIPv4IPv6IPv4IPv6
- @if(Session::get('show_server_value_hostname') === 1) + @if(Session::get('show_server_value_hostname') === 1) + {{ $s->hostname }} - @endif - {{ App\Models\Server::serviceServerType($s->server_type) }} {{ $s->price }} {{$s->currency}} {{\App\Process::paymentTermIntToString($s->term)}} {{ $s->owned_since }} @if(Session::get('show_server_value_yabs') === 1) {{$s->gb5_single}} @@ -97,17 +102,18 @@ @if(Session::get('show_server_value_yabs') === 1) {{$s->d_1m}}{{$s->d_1m_type}} @endif {{ $s->owned_since }} - @if(Session::get('show_server_value_ip') === 1) - {{ $s->ipv4 }} - @endif - - @if(Session::get('show_server_value_ip') === 1) - {{ $s->ipv6 }} - @endif - + @if($s->is_ipv4 === 1) + {{ $s->ip }} + @endif + + @if($s->is_ipv4 === 0) + {{ $s->ip }} + @endif +