Added System, fixed something with Domain, added 403, start of some other items

This commit is contained in:
Deon George
2021-06-18 00:08:30 +10:00
parent 1e7c05cb90
commit 491d3d55c3
17 changed files with 451 additions and 16 deletions

View File

@@ -0,0 +1,46 @@
@extends('layouts.app')
@section('htmlheader_title')
Permissions for {{ auth()->check() ? auth()->user()->name : 'Guest' }}
@endsection
@section('content')
<h2>{{ auth()->check() ? auth()->user()->name : 'Guest' }}</h2>
<table class="table monotable">
<thead>
<tr>
<th>Test</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr>
<td>isAdmin</td>
<td>@can('admin')YES @else NO @endcan</td>
</tr>
<tr>
<td>Domains</td>
<td>
<table class="table table-sm">
<thead>
<tr>
<th>Domain</th>
<th>Result</th>
</tr>
</thead>
<tbody>
@foreach (\App\Models\Domain::orderBy('name')->get() as $o)
<tr>
<td>{{ $o->name }}</td>
<td>@can('admin',$o)YES @else NO @endcan</td>
</tr>
@endforeach
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
@endsection

View File

@@ -35,10 +35,10 @@
<label for="active" class="form-label">Active</label>
<div class="input-group has-validation">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="active" id="active_yes" value="1" required @if($o->active)checked @endif>
<input type="radio" class="btn-check" name="active" id="active_yes" value="1" required @if(old('active',$o->active))checked @endif>
<label class="btn btn-outline-success" for="active_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="active" id="active_no" value="0" required @if(! $o->active)checked @endif>
<input type="radio" class="btn-check btn-danger" name="active" id="active_no" value="0" required @if(! old('active',$o->active))checked @endif>
<label class="btn btn-outline-danger" for="active_no">No</label>
</div>
</div>
@@ -47,7 +47,7 @@
<div class="row">
<div class="col-4">
<label for="name" class="form-label">DNS Domain</label>
<label for="dnsdomain" class="form-label">DNS Domain</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-globe"></i></span>
<input type="text" class="form-control @error('dnsdomain') is-invalid @enderror" id="dnsdomain" placeholder="DNS Domain (if applicable)" name="dnsdomain" value="{{ old('dnsdomain',$o->dnsdomain) }}">
@@ -63,17 +63,14 @@
<label for="public" class="form-label">Public</label>
<div class="input-group has-validation">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="public" id="public_yes" value="1" required @if($o->public)checked @endif>
<input type="radio" class="btn-check" name="public" id="public_yes" value="1" required @if(old('public',$o->public))checked @endif>
<label class="btn btn-outline-success" for="public_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="public" id="public_no" value="0" required @if(! $o->public)checked @endif>
<input type="radio" class="btn-check btn-danger" name="public" id="public_no" value="0" required @if(! old('public',$o->public))checked @endif>
<label class="btn btn-outline-danger" for="public_no">No</label>
</div>
</div>
</div>
<div class="col-4">
more text
</div>
</div>
<div class="row">

View File

@@ -6,7 +6,7 @@
@section('content')
<div class="row">
<div class="col-12">
<h2>About the FTN Clearing House</h2>
<h2>About FTN Domains</h2>
<p>In FTN network addresses, a domain is the 5th dimension and used when a system supports 5D addressing, ie: zone:hub/host@<strong class="highlight">domain</strong>.</p>
<p>Domains are used with zones to uniquely identify a FTN network.</p>
<p><small>Some legacy Fidonet software is not 5D aware and may behave unexpectedly when a domain is used</small></p>
@@ -18,28 +18,34 @@
<p>This system is aware of the following domains:</p>
@if (\App\Models\Domain::count() == 0)
<p>There are no domains setup, to <a href="{{ url('ftn/domain/addedit') }}">set up your first</a>.</p>
@can('admin',(new \App\Models\Domain))
<p>There are no domains setup, to <a href="{{ url('ftn/domain/addedit') }}">set up your first</a>.</p>
@else
<p class="pad">There are no domains - you need to ask an admin to create one for you.</p>
@endcan
@else
<table class="table monotable">
<thead>
<tr>
<th>ID</th>
<th>Active</th>
<th>Domain</th>
<th>Active</th>
<th>DNS domain</th>
<th>Zones</th>
</tr>
</thead>
<tbody>
@can('admin',(new \App\Models\Domain()))
<tr>
<td colspan="5"><a href="{{ url('ftn/domain/addedit') }}">Add New Domain</a></td>
</tr>
@endcan
@foreach (\App\Models\Domain::orderBy('name')->cursor() as $oo)
<tr>
<td><a href="{{ url('ftn/domain/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>{{ $oo->name }}</td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>{{ $oo->dnsdomain }}</td>
<td>{{ join(', ',$oo->zones->pluck('zone_id')->toArray()) }}</td>
</tr>

View File

@@ -0,0 +1,15 @@
@extends('layouts.auth')
@section('htmlheader_title')
403
@endsection
@section('content')
<div class="row">
<div class="col-6 m-auto">
<h3>403 - Not allowed</h3>
<p>Sorry, it appears you are not allowed to do that.</p>
<p><a href="{{ url('/') }}" class="goback">Home</a></p>
</div>
</div>
@endsection

View File

@@ -4,6 +4,7 @@
<dl>
<dt>Network Admin</dt>
<dd><a href="{{ url('ftn/domain') }}">Domains</a></dd>
<dd><a href="{{ url('ftn/system') }}">Systems</a></dd>
<dd><a href="{{ url('ftn/zone') }}" >Zones</a></dd>
<dd><a href="{{ url('ftn/node') }}" >Nodes</a></dd>
</dl>

View File

@@ -0,0 +1,8 @@
@extends('layouts.app')
@section('htmlheader_title')
Setup
@endsection
@section('content')
<h2>Site Setup</h2>
@endsection

View File

@@ -0,0 +1,76 @@
@extends('layouts.app')
@section('htmlheader_title')
Systems
@endsection
@section('content')
<div class="row">
<div class="col-12">
<h2>BBS Systems</h2>
<p>BBS Systems Send and Receive Echomail and Files.</p>
</div>
</div>
<div class="row">
<div class="col-6">
<p>This system is aware of the following systems:</p>
@if (\App\Models\System::count() == 0)
@can('admin',(new \App\Models\System))
<p>There are no systems setup, to <a href="{{ url('ftn/system/addedit') }}">set up your first</a>.</p>
@else
<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">
<thead>
<tr>
<th>ID</th>
<th>System</th>
<th>Sysop</th>
<th>Location</th>
<th>Active</th>
<th>Connect</th>
</tr>
</thead>
<tbody>
@can('admin',(new \App\Models\System))
<tr>
<td colspan="6"><a href="{{ url('ftn/domain/addedit') }}">Add New System</a></td>
</tr>
@endcan
@foreach (\App\Models\System::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>
@switch($oo->method)
@case(23)<a href="telnet://{{ $oo->address }}:{{ $oo->port }}">Telnet</a>@break
@case(22)<a href="ssh://{{ $oo->address }}:{{ $oo->port }}">SSH</a>@break
@case(519)<a href="rlogin://{{ $oo->address }}:{{ $oo->port }}">SSH</a>@break
@default No details
@endswitch
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
</div>
@endsection
@section('page-scripts')
<script type="text/javascript">
$('table tr').click(function() {
var href = $(this).find('a').attr('href');
if (href)
window.location = href;
});
</script>
@append

View File

@@ -0,0 +1,51 @@
@extends('layouts.app')
@section('htmlheader_title')
Users
@endsection
@section('content')
<div class="row">
<div class="col-8">
<p>Current Users:</p>
<table class="table monotable">
<thead>
<tr>
<th>ID</th>
<th>Email</th>
<th>Name</th>
<th>Verified</th>
<th>Last On</th>
</tr>
</thead>
<tbody>
@can('admin',(new \App\Models\Domain()))
<tr>
<td colspan="5"><a href="{{ url('user/addedit') }}">Add New User</a></td>
</tr>
@endcan
@foreach (\App\Models\User::orderBy('email')->cursor() as $oo)
<tr class="{{ $oo->admin ? 'admin' : '' }}">
<td><a href="{{ url('user/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
<td>{{ $oo->email }}</td>
<td>{{ $oo->name }}</td>
<td>{{ $oo->email_verified_at ? $oo->email_verified_at->format('Y-m-d') : '-' }}</td>
<td>{{-- $oo->last_on --}}TBA</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@section('page-scripts')
<script type="text/javascript">
$('table tr').click(function() {
var href = $(this).find('a').attr('href');
if (href)
window.location = href;
});
</script>
@append