clrghouz/resources/views/system/widget/routing.blade.php

94 lines
2.1 KiB
PHP
Raw Permalink Normal View History

@use(App\Models\Address)
<!-- $o=System::class -->
<div class="row">
<!-- Zone mail sent to, because we dont have session details for these addresses -->
<div class="col-6">
@if($o->aka_unknown()->count())
<h4>This host's mail is sent to:</h4>
<table class="table monotable">
<thead>
<tr>
<th>AKA</th>
<th>Uplink</th>
</tr>
</thead>
<tbody>
@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>
@endif
</div>
<!-- Systems this host collects for -->
<div class="col-6">
<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>Incl Systems(s)</th>
</tr>
</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>