Import nodelists

This commit is contained in:
Deon George
2021-06-25 21:31:57 +10:00
parent 1f04f8374e
commit 64215ebcea
11 changed files with 446 additions and 149 deletions

View File

@@ -79,10 +79,20 @@
<td>-</td>
</tr>
<!-- Other Nodes -->
@foreach ($oz->addresses()->active()->FTNorder()->whereNull('hub_id')->with(['system','zone.domain'])->get() as $ao)
@if ($ao->role == 'Host')
<tr>
<td>{{ sprintf('NC-%s-%05d',$oz->domain->name,$ao->host_id) }}</td>
<td>{{ $ao->system->sysop }}</td>
<td>{{ $ao->system->location }}</td>
<td>{{ $ao->role }}</td>
<td>{{ $oz->zone_id }}:{{ $ao->host_id }}/0.0<span>@</span>{{ $oz->domain->name }}</td>
<td>-</td>
</tr>
@endif
<tr>
<td>{{ $ao->system->name($ao) }}</td>
<td>{{ $ao->system->full_name($ao) }}</td>
<td>{{ $ao->system->sysop }}</td>
<td>{{ $ao->system->location }}</td>
<td>{{ $ao->role }}</td>
@@ -93,7 +103,7 @@
<!-- If this node is a hub -->
@foreach ($oz->addresses()->active()->FTNorder()->where('hub_id',$ao->id)->with(['system','zone.domain'])->get() as $aoo)
<tr>
<td>{{ $aoo->system->name($aoo) }}</td>
<td>{{ $aoo->system->full_name($aoo) }}</td>
<td>{{ $aoo->system->sysop }}</td>
<td>{{ $ao->system->location }}</td>
<td>{{ $aoo->role }}</td>

View File

@@ -9,6 +9,10 @@
@endsection
@section('content')
@if ($o->exists)
<h1>{{ $o->name }}</h1>
@endif
<div class="accordion accordion-flush" id="accordion_homepage">
@if ($o->exists)

View File

@@ -12,7 +12,7 @@
</div>
<div class="row">
<div class="col-10">
<div class="col-12">
<p>This system is aware of the following systems:</p>
@if (\App\Models\System::count() == 0)
@@ -22,33 +22,30 @@
<p class="pad">There are no systems - you need to ask an admin to create one for you.</p>
@endcan
@else
<table class="table monotable">
@can('admin',(new \App\Models\System))
<p>You can <a href="{{ url('ftn/system/addedit') }}">Add New System</a>.</p>
@endcan
<table class="table monotable" id="systems">
<thead>
<tr>
<th>ID</th>
<th>System</th>
<th>Sysop</th>
<th>Location</th>
<th>Active</th>
<th>ZeroTier ID</th>
<th>Connect</th>
<th>Address</th>
<th>ZeroTier ID</th>
</tr>
</thead>
<tbody>
@can('admin',(new \App\Models\System))
<tr>
<td colspan="7"><a href="{{ url('ftn/system/addedit') }}">Add New System</a></td>
</tr>
@endcan
@foreach (\App\Models\System::orderBy('name')->cursor() as $oo)
@foreach (\App\Models\System::active()->orderBy('name')->cursor() as $oo)
<tr>
<td><a href="{{ url('ftn/system/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
<td>{{ $oo->name }}</td>
<td>{{ $oo->sysop }}</td>
<td>{{ $oo->location }}</td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>-</td>
<td>
@switch($oo->method)
@case(23)<a href="telnet://{{ $oo->address }}:{{ $oo->port }}">Telnet</a>@break
@@ -57,6 +54,8 @@
@default No details
@endswitch
</td>
<td>{{ join(',',$oo->addresses->pluck('ftn')->toArray()) }}</td>
<td>{{ $oo->zt_id }}</td>
</tr>
@endforeach
</tbody>
@@ -67,6 +66,13 @@
@endsection
@section('page-scripts')
<link type="text/css" rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap5.min.css" media="screen" >
<link type="text/css" rel="stylesheet" href="{{ asset('plugin/dataTables/dataTables.bootstrap5.css') }}" media="screen">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript">
$('table tr').click(function() {
var href = $(this).find('a').attr('href');
@@ -74,5 +80,17 @@
if (href)
window.location = href;
});
$('#systems').DataTable({
paging: true,
pageLength: 25,
searching: true,
columnDefs: [
{
targets: [5,6],
visible: false,
}
],
});
</script>
@append