clrghouz/resources/views/domain/list.blade.php
Deon George d53ca09c0c
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m49s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s
Remove deprecated Domain::managed()
2024-05-29 19:35:51 +10:00

107 lines
2.4 KiB
PHP

@extends('layouts.app')
@section('htmlheader_title')
Known FTN Networks
@endsection
@php
use App\Models\Domain;
@endphp
@section('content')
<div class="row">
<div class="col-12">
<h2>List of known FTN Networks</h2>
<p>Here is a list of known <strong class="highlight">FTN Networks</strong>.</p>
<table class="table monotable" id="ftnlist">
<thead>
<tr>
<th>Domain</th>
<th>Zones</th>
<th>Active</th>
<th>Available Here</th>
<th>Head Quarters</th>
<th>Known Systems</th>
</tr>
</thead>
<tbody>
@foreach (Domain::public()->orderBy('name')->with(['zones.addresses.system'])->get() as $do)
<tr>
<td>
@if($do->active)
<a href="{{ url('domain/view',$do->id) }}">{{ $do->name }}</a>
@else
{{ $do->name }}
@endif
</td>
<td>{{ $do->zones->where('active',TRUE)->pluck('zone_id')->sort()->join(', ') }}</td>
<td class="text-end">{{ $do->active ? 'Active' : 'Not Active' }}</td>
<td class="text-end">{{ $do->isManaged() ? 'YES' : 'NO' }}</td>
<td>
@foreach (($x=$do->zones->pluck('addresses')->flatten())->where('role',\App\Models\Address::NODE_ZC)->sortBy('zone.zone_id') as $ao)
{{ $ao->system->sysop }}, <a href="{{ url('system/view',$ao->system_id) }}">{{ $ao->system->name }}</a><br>
@endforeach
</td>
<td class="text-end">{{ $x->pluck('system')->unique('name')->count() }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@section('page-css')
@css('datatables')
@append
@section('page-scripts')
@js('datatables')
<script type="text/javascript">
$(document).ready(function() {
$('table tr').click(function() {
var href = $(this).find('a:not(.disabled)').attr('href');
if (href)
window.location = href;
});
$('#ftnlist').DataTable({
paging: true,
pageLength: 25,
searching: true,
autoWidth: false,
conditionalPaging: {
style: 'fade',
speed: 500 // optional
},
columnDefs: [
{
targets: 1,
type: 'num-fmt',
render: {
'sort': function (data,type,row,meta) {
return data ? parseFloat(data) : 0;
},
}
},
{
targets: [2],
visible: false,
},
],
orderFixed: [2, 'asc'],
rowGroup: {
dataSrc: [2],
},
language: {
paginate: {
previous: '&lt;&lt;',
next: '&gt;&gt;'
}
},
});
});
</script>
@append