Updated public servers view

Updated public servers view
This commit is contained in:
cp6 2022-03-02 15:36:38 +11:00
parent 026643a7e0
commit a1df4d6b78
2 changed files with 28 additions and 21 deletions

View File

@ -58,11 +58,12 @@ class ServerController extends Controller
->Join('providers as p', 's.provider_id', '=', 'p.id') ->Join('providers as p', 's.provider_id', '=', 'p.id')
->Join('locations as l', 's.location_id', '=', 'l.id') ->Join('locations as l', 's.location_id', '=', 'l.id')
->Join('os as o', 's.os_id', '=', 'o.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('yabs as y', 's.id', '=', 'y.server_id')
->LeftJoin('disk_speed as ds', 'y.id', '=', 'ds.id') ->LeftJoin('disk_speed as ds', 'y.id', '=', 'ds.id')
->where('s.show_public', '=', 1) ->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 view('servers.public-index', compact('servers'));
} }
return response()->view('errors.404', array("status" => 404, "title" => "Page not found", "message" => ""), 404); return response()->view('errors.404', array("status" => 404, "title" => "Page not found", "message" => ""), 404);

View File

@ -9,7 +9,9 @@
<table class="table table-bordered"> <table class="table table-bordered">
<thead class="table-light"> <thead class="table-light">
<tr class="bg-gray-100 bg-"> <tr class="bg-gray-100 bg-">
<th class="nowrap">Name</th> @if(Session::get('show_server_value_hostname') === 1)
<th class="nowrap">Name</th>
@endif
<th class="text-center"><i class="fas fa-box" title="Virt"></i></th> <th class="text-center"><i class="fas fa-box" title="Virt"></i></th>
<th class="text-center">OS</th> <th class="text-center">OS</th>
<th class="text-center"><i class="fas fa-microchip" title="CPU"></i></th> <th class="text-center"><i class="fas fa-microchip" title="CPU"></i></th>
@ -19,26 +21,28 @@
<th class="text-nowrap">Location</th> <th class="text-nowrap">Location</th>
<th class="text-nowrap">Provider</th> <th class="text-nowrap">Provider</th>
<th class="text-nowrap">Price</th> <th class="text-nowrap">Price</th>
<th class="text-nowrap">Had since</th>
<th class="text-nowrap">GB5 S</th> <th class="text-nowrap">GB5 S</th>
<th class="text-nowrap">GB5 M</th> <th class="text-nowrap">GB5 M</th>
<th class="text-nowrap">4k</th> <th class="text-nowrap">4k</th>
<th class="text-nowrap">64k</th> <th class="text-nowrap">64k</th>
<th class="text-nowrap">512k</th> <th class="text-nowrap">512k</th>
<th class="text-nowrap">1m</th> <th class="text-nowrap">1m</th>
<th class="text-nowrap">Had since</th> @if(Session::get('show_server_value_ip') === 1)
<th class="text-nowrap">IPv4</th> <th class="text-nowrap">IPv4</th>
<th class="text-nowrap">IPv6</th> <th class="text-nowrap">IPv6</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@if(!empty($servers)) @if(!empty($servers))
@foreach($servers as $s) @foreach($servers as $s)
<tr> <tr>
<td class="nowrap"> @if(Session::get('show_server_value_hostname') === 1)
@if(Session::get('show_server_value_hostname') === 1) <td class="nowrap">
{{ $s->hostname }} {{ $s->hostname }}
@endif </td>
</td> @endif
<td class="text-center"> <td class="text-center">
{{ App\Models\Server::serviceServerType($s->server_type) }} {{ App\Models\Server::serviceServerType($s->server_type) }}
</td> </td>
@ -69,6 +73,7 @@
@endif @endif
</td> </td>
<td class="text-nowrap">{{ $s->price }} {{$s->currency}} {{\App\Process::paymentTermIntToString($s->term)}}</td> <td class="text-nowrap">{{ $s->price }} {{$s->currency}} {{\App\Process::paymentTermIntToString($s->term)}}</td>
<td class="text-nowrap"> {{ $s->owned_since }}</td>
<td class="text-nowrap"> <td class="text-nowrap">
@if(Session::get('show_server_value_yabs') === 1) @if(Session::get('show_server_value_yabs') === 1)
{{$s->gb5_single}} {{$s->gb5_single}}
@ -97,17 +102,18 @@
@if(Session::get('show_server_value_yabs') === 1) @if(Session::get('show_server_value_yabs') === 1)
{{$s->d_1m}}<small>{{$s->d_1m_type}}</small> {{$s->d_1m}}<small>{{$s->d_1m_type}}</small>
@endif</td> @endif</td>
<td class="text-nowrap"> {{ $s->owned_since }}</td> @if(Session::get('show_server_value_ip') === 1)
<td class="text-nowrap"> <td class="text-nowrap">
@if(Session::get('show_server_value_ip') === 1) @if($s->is_ipv4 === 1)
{{ $s->ipv4 }} {{ $s->ip }}
@endif @endif
</td> </td>
<td class="text-nowrap"> <td class="text-nowrap">
@if(Session::get('show_server_value_ip') === 1) @if($s->is_ipv4 === 0)
{{ $s->ipv6 }} {{ $s->ip }}
@endif @endif
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
@else @else