Consistency and SQL Query optimisations - focused around the UI
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
@php
|
||||
use App\Models\{Address,Zone};
|
||||
@endphp
|
||||
|
||||
@use(App\Models\Address)
|
||||
<!-- $o=System::class -->
|
||||
<div class="row">
|
||||
<!-- Zone mail sent to -->
|
||||
<!-- Zone mail sent to, because we dont have session details for these addresses -->
|
||||
<div class="col-6">
|
||||
@if(! $o->setup && ($x=Zone::active()
|
||||
->whereIn('id',$o->zones->pluck('id'))
|
||||
->whereNotIn('id',$o->sessions->pluck('id'))
|
||||
->get())->count())
|
||||
|
||||
@if($o->aka_unknown()->count())
|
||||
<h4>This host's mail is sent to:</h4>
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
@@ -20,19 +14,17 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($x as $zo)
|
||||
@foreach ($o->match($zo,Address::NODE_ALL) as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->ftn }}</td>
|
||||
<td>
|
||||
@if ($x=$oo->uplink())
|
||||
{{ $x->ftn4d }}
|
||||
@else
|
||||
None
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($o->aka_unknown() as $ao)
|
||||
<tr>
|
||||
<td>{{ $ao->ftn }}</td>
|
||||
<td>
|
||||
@if ($xx=$ao->uplink())
|
||||
{{ $xx->ftn4d }}
|
||||
@else
|
||||
None
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -41,28 +33,62 @@
|
||||
|
||||
<!-- Systems this host collects for -->
|
||||
<div class="col-6">
|
||||
@if($o->sessions->count())
|
||||
<h4>This host collects mail for the following systems:</h4>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@if($o->sessions->count())
|
||||
<h4>This host collects mail for the following systems:</h4>
|
||||
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>AKA</th>
|
||||
<th>For Systems(s)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($o->sessions->sortBy('zone_id') as $zo)
|
||||
@foreach ($o->match($zo,Address::NODE_ALL) as $oo)
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ $oo->ftn }}</td>
|
||||
<td>{!! (($x=$oo->downlinks()) && $x->count()) ? $x->pluck('ftn')->join('<br>') : 'None' !!}</td>
|
||||
<th>AKA</th>
|
||||
<th>Incl Systems(s)</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($o->sessions->sortBy('zone_id') as $zo)
|
||||
@if($zo->pivot->default)
|
||||
<tr>
|
||||
<td>{!! $o->akas->filter(fn($item)=>$item->zone->domain_id === $zo->domain_id)->pluck('ftn')->join('<br>') !!}</td>
|
||||
<td>All <small>(not otherwise routed)</small></td>
|
||||
</tr>
|
||||
@else
|
||||
@foreach ($o->match($zo,Address::NODE_ALL) as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->ftn }}</td>
|
||||
<td>{!! (($x=$oo->downlinks()) && $x->count()) ? $x->pluck('ftn')->join('<br>') : 'None' !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($o->aka_uncommon()->count())
|
||||
<div class="row">
|
||||
<div class="rol-12">
|
||||
<h4>This host's mail not known here:</h4>
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>AKA</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($o->aka_uncommon() as $ao)
|
||||
<tr>
|
||||
<td>{{ $ao->ftn }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user