Rework address roles, making Address::role optional, rework determining uplink/downlinks/parent/children
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
@php
|
||||
use App\Models\Address;
|
||||
@endphp
|
||||
|
||||
<!-- $o=System::class -->
|
||||
@extends('layouts.app')
|
||||
|
||||
@@ -135,10 +139,10 @@
|
||||
<a href="{{ url('system/address/sus',[$oo->id]) }}" title="@if($oo->active)Pause @else Activate @endif Address"><i class="bi @if($oo->active)bi-pause-circle @else bi-play-circle @endif"></i></a>
|
||||
<a href="{{ url('system/address/mov',[$o->id,$oo->id]) }}" title="Move Address to another System"><i class="bi bi-arrow-right-square"></i></a>
|
||||
<a href="{{ url('system/address/del',[$oo->id]) }}" title="Delete Address"><i class="bi bi-trash"></i></a>
|
||||
@if ((\App\Models\Address::NODE_HC|\App\Models\Address::NODE_ACTIVE) & $oo->role)
|
||||
@if ((Address::NODE_HC|Address::NODE_NN) & $oo->role_id)
|
||||
<a href="{{ url('system/address/pro',[$oo->id]) }}" title="Promote Address"><i class="bi bi-arrow-up-square"></i></a>
|
||||
@endif
|
||||
@if ((\App\Models\Address::NODE_NC|\App\Models\Address::NODE_HC) & $oo->role)
|
||||
@if ((Address::NODE_NC|Address::NODE_HC) & $oo->role_id)
|
||||
<a href="{{ url('system/address/dem',[$oo->id]) }}" title="Demote Address"><i class="bi bi-arrow-down-square"></i></a>
|
||||
@endif
|
||||
@endif
|
||||
@@ -276,70 +280,7 @@
|
||||
|
||||
<div id="collapse_routing" class="accordion-collapse collapse {{ ($flash=='routing') ? 'show' : '' }}" aria-labelledby="routing" data-bs-parent="#accordion_homepage">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<!-- Zone mail sent to -->
|
||||
<div class="col-6">
|
||||
@if(! $o->setup && ($x=\App\Models\Zone::active()
|
||||
->whereIn('id',$o->zones->pluck('id'))
|
||||
->whereNotIn('id',$o->sessions->pluck('id'))
|
||||
->get())->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($x as $zo)
|
||||
@foreach ($o->match($zo,\App\Models\Address::NODE_ALL) as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->ftn }}</td>
|
||||
<td>
|
||||
@if ($x=$oo->parent())
|
||||
{{ $x->ftn4d }}
|
||||
@else
|
||||
None
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Systems this host collects for -->
|
||||
<div class="col-6">
|
||||
@if($o->sessions->count())
|
||||
<h4>This host collects mail for the following systems:</h4>
|
||||
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>AKA</th>
|
||||
<th>Downlink(s)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($o->sessions->sortBy('zone_id') as $zo)
|
||||
@foreach ($o->match($zo,\App\Models\Address::NODE_ALL) as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->ftn }}</td>
|
||||
<td>{!! (($x=$oo->children()) && $x->count()) ? $x->pluck('ftn4d')->join('<br>') : 'None' !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@include('system.widget.routing')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user