Rework address roles, making Address::role optional, rework determining uplink/downlinks/parent/children
This commit is contained in:
68
resources/views/system/widget/routing.blade.php
Normal file
68
resources/views/system/widget/routing.blade.php
Normal file
@@ -0,0 +1,68 @@
|
||||
@php
|
||||
use App\Models\{Address,Zone};
|
||||
@endphp
|
||||
|
||||
<div class="row">
|
||||
<!-- Zone mail sent to -->
|
||||
<div class="col-6">
|
||||
@if(! $o->setup && ($x=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,Address::NODE_ALL) as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->ftn }}</td>
|
||||
<td>
|
||||
@if ($x=$oo->uplink())
|
||||
{{ $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>For Systems(s)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($o->sessions->sortBy('zone_id') as $zo)
|
||||
@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
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
@@ -1,3 +1,7 @@
|
||||
@php
|
||||
use App\Models\{Mailer,User};
|
||||
@endphp
|
||||
|
||||
<!-- $o = System::class -->
|
||||
<div class="row">
|
||||
<div class="col-xl-9 col-12">
|
||||
@@ -14,7 +18,7 @@
|
||||
<span class="input-group-text"><i class="bi bi-people-fill"></i></span>
|
||||
<select style="width: 80%;" class="form-select @error('users') is-invalid @enderror" id="users" name="users[]">
|
||||
<option value=""> </option>
|
||||
@foreach (\App\Models\User::orderBy('name')->active()->get() as $uo)
|
||||
@foreach (User::orderBy('name')->active()->get() as $uo)
|
||||
<option value="{{ $uo->id }}" @if(in_array($uo->id,old('users',$o->users->pluck('id')->toArray())))selected @endif>{{ $uo->name }} <small>({{ $uo->email }})</small></option>
|
||||
@endforeach
|
||||
</select>
|
||||
@@ -145,7 +149,7 @@
|
||||
<!-- Mailer Ports -->
|
||||
<div class="row pt-0">
|
||||
<div class="col-3">
|
||||
@foreach (\App\Models\Mailer::all() as $mo)
|
||||
@foreach (Mailer::all() as $mo)
|
||||
@php($x=$o->mailers->find($mo))
|
||||
<div class="row pt-0">
|
||||
<div class="col-12">
|
||||
@@ -282,6 +286,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- @todo This is only relevant for uplinks, so hide it if this system isnt an uplink -->
|
||||
<div class="col-12 @if((old('pollmode') === "0") || is_null($o->pollmode))d-none @endif" id="heartbeat_option">
|
||||
@can('admin',$o)
|
||||
<div class="row p-0">
|
||||
|
Reference in New Issue
Block a user