Removed unnessary controller functions that just call a view, HTML/CSS consistency updates

This commit is contained in:
Deon George 2024-04-22 14:27:48 +10:00
parent 001618d719
commit ceffc7ff14
45 changed files with 2009 additions and 2011 deletions

View File

@ -39,7 +39,7 @@ class HomeController extends Controller
})
->get();
return view('file')
return view('widgets.file')
->with('f',$f);
}
@ -73,20 +73,11 @@ class HomeController extends Controller
->with(['echoarea'])
->get();
return view('packet')
return view('widgets.packet')
->with('nm',$nm)
->with('em',$em);
}
/**
* Render a view that summarises the users permissions
*/
public function permissions()
{
return view('auth.permissions')
->with('user',Auth::user());
}
/**
* Show a packet dump
*

View File

@ -323,7 +323,7 @@ class SystemController extends Controller
// Make sure that no other system has this address active.
if ($o->role === Address::NODE_ACTIVE)
return redirect()->back()->withErrors(['demaddress'=>sprintf('%s cannot be demoted any more',$o->ftn3D)]);
return redirect()->back()->withErrors(['address'=>sprintf('%s cannot be demoted any more',$o->ftn3D)]);
$o->role = ($o->role << 1);
$o->save();
@ -494,7 +494,7 @@ class SystemController extends Controller
// Make sure that no other system has this address active.
if ($o->role === Address::NODE_NC)
return redirect()->back()->withErrors(['proaddress'=>sprintf('%s cannot be promoted any more',$o->ftn3D)]);
return redirect()->back()->withErrors(['address'=>sprintf('%s cannot be promoted any more',$o->ftn3D)]);
$o->role = ($o->role >> 1);
$o->save();
@ -564,7 +564,7 @@ class SystemController extends Controller
'active'=>TRUE,
])->single())) {
return redirect()->back()->withErrors(['susaddress'=>sprintf('%s is already active on system [<a href="%s">%s</a>]',$o->ftn,url('system/addedit',$x->system_id),$x->system->name)]);
return redirect()->back()->withErrors(['address'=>sprintf('%s is already active on system [<a href="%s">%s</a>]',$o->ftn,url('system/addedit',$x->system_id),$x->system->name)]);
}
$o->active = (! $o->active);

View File

@ -65,9 +65,4 @@ class UserController extends Controller
return view('user.link');
}
public function register()
{
return view('user/system/register');
}
}

35
public/css/fixes.css vendored
View File

@ -99,3 +99,38 @@ ol {
color: inherit;
background-color: inherit;
}
/* h1 headings reference */
h1>small.float-end {
padding-top: 2rem;
}
h1>small.float-end:before {
color: #acacac;
content: '[';
}
h1>small.float-end:after {
color: #acacac;
content: ']';
}
h1 sup {
text-shadow: none;
font-size: 50%;
top: -1em;
}
h1>small.success {
color: #005300 !important;
}
h1>small.success:before {
color: #00aa00;
content: '[';
}
h1>small.success:after {
color: #00aa00;
content: ']';
}
/* Ensure our greyframe titled boxes are full width */
.titledbox {
margin-right: 0;
margin-left: 0;
}

View File

@ -5,24 +5,16 @@
@endsection
@section('content')
@if (Session('status'))
<div class="row">
<div class="col-8 m-auto">
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
</div>
</div>
@endif
@includeWhen(session()->has('success'),'widgets.success-row',['msg'=>session()->get('success')])
<form class="needs-validation" method="post" action="{{ route('password.email') }}" novalidate>
@csrf
<div class="row">
<div class="col-6 m-auto">
<div class="greyframe titledbox shadow0xb0 text-center">
<h2 class="cap">Forgot Password</h2>
<form class="row g-0 needs-validation" method="post" action="{{ route('password.email') }}" novalidate>
@csrf
<div class="row">
<div class="col-12">
<label for="email" class="form-label">Email</label>
@ -52,8 +44,8 @@
<a class="link-danger" href="{{ url('login') }}">Login</a>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -5,23 +5,16 @@
@endsection
@section('content')
@if (Session('status'))
<div class="row">
<div class="col-8 m-auto">
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
</div>
</div>
@endif
@includeWhen(session()->has('status') || true,'widgets.success-row',['msg'=>session()->get('status')])
<form class="needs-validation" method="post" action="{{ route('password.update') }}" novalidate>
@csrf
<div class="row">
<div class="col-6 m-auto">
<div class="greyframe titledbox shadow0xb0 text-center">
<h2 class="cap">Reset Password</h2>
<form class="row g-0 needs-validation" method="post" action="{{ route('password.update') }}" novalidate>
@csrf
<input type="hidden" name="token" value="{{ $token }}">
<div class="row">
@ -77,8 +70,8 @@
<button type="submit" name="submit" class="btn btn-success float-end">Sign In</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -4,6 +4,8 @@
@endsection
@section('content')
<div class="row">
<div class="col-12">
<h2>{{ auth()->check() ? auth()->user()->name : 'Guest' }}</h2>
<table class="table monotable">
@ -89,6 +91,8 @@
</tr>
</tbody>
</table>
</div>
</div>
@endsection
@section('page-css')

View File

@ -5,14 +5,14 @@
@endsection
@section('content')
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-6 m-auto">
<div class="greyframe titledbox shadow0xb0 text-center">
<h2 class="cap">Register</h2>
<form class="row g-0 needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-12">
<label for="name" class="form-label">Name</label>
@ -82,7 +82,6 @@
<button type="submit" name="submit" class="btn btn-success float-end">Sign In</button>
</div>
</div>
</form>
<div class="row">
<div class="col-12">
@ -92,4 +91,5 @@
</div>
</div>
</div>
</form>
@endsection

View File

@ -5,24 +5,14 @@
@endsection
@section('content')
@if (Session('resent'))
<div class="row">
<div class="col-8 m-auto">
<div class="alert alert-success alert-dismissible" role="alert">
{{ __('A fresh verification link has been sent to your email address.') }}
</div>
</div>
</div>
@endif
<form class="needs-validation" method="post" action="{{ route('verification.resend') }}" novalidate>
@csrf
<div class="row">
<div class="col-6 m-auto">
<div class="greyframe titledbox shadow0xb0 text-center">
<h2 class="cap">Verify</h2>
<form class="row" method="post" action="{{ route('verification.resend') }}" novalidate>
@csrf
<div class="row">
<div class="col-12">
{{ __('Before proceeding, please check your email for a verification link.') }}
@ -30,8 +20,8 @@
<button type="submit" class="btn btn-link p-0" style="text-decoration: none;line-height: 1.0;">{{ __('click here to request another') }}</button>.
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -5,7 +5,7 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">

View File

@ -4,14 +4,12 @@
@endsection
@section('content')
<div class="row pt-0">
<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>
</div>
<div class="col-12 pt-2">
<table class="table monotable" id="ftnlist">
<thead>
<tr>

View File

@ -5,7 +5,9 @@
@endsection
@section('content')
<h1>{{ $o->name }} <small class="float-end pt-4">Last Update: {{ $o->updated_at->format('Y-m-d H:i') }}</small></h1>
<div class="row">
<div class="col-12">
<h1>{{ $o->name }} <small class="float-end">Last Update: {{ $o->updated_at->format('Y-m-d H:i') }}</small></h1>
<div class="accordion" id="accordion_homepage">
<!-- About -->
@ -23,7 +25,7 @@
</div>
<!-- Echomail -->
<div class="accordion-item open">
<div class="accordion-item">
<h3 class="accordion-header">
<span class="accordion-button collapsed" id="echoareas" data-bs-toggle="collapse" data-bs-target="#collapse_echoareas" aria-expanded="false" aria-controls="collapse_echoareas">Echo Areas</span>
</h3>
@ -173,6 +175,8 @@
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-css')

View File

@ -5,7 +5,7 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">

View File

@ -4,9 +4,9 @@
@endsection
@section('content')
<div class="row pt-3">
<div class="row">
<div class="col-12">
<h3>Echomail</h3>
<h1>Echomail [{{ $o->msgid ?: '-' }}] <small class="float-end">#{{ $o->id }}</small></h1>
@include('widgets.message',['msg'=>$o])
</div>

View File

@ -6,7 +6,7 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">

View File

@ -1,6 +1,6 @@
<!-- Bootstrap & Jquery App -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous"></script>
<script type="text/javascript" src="https:///cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous"></script>
<!-- JavaScript Bundle with Popper -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

View File

@ -4,9 +4,9 @@
@endsection
@section('content')
<div class="row pt-3">
<div class="row">
<div class="col-12">
<h3>Netmail</h3>
<h1>Netmail [{{ $o->msgid ?: '-' }}] <small class="float-end">#{{ $o->id }}</small></h1>
@include('widgets.message',['msg'=>$o])
</div>

View File

@ -4,7 +4,7 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" enctype="multipart/form-data" novalidate>
<form class="needs-validation" method="post" enctype="multipart/form-data" novalidate>
@csrf
<div class="row">

View File

@ -10,20 +10,16 @@ use App\Classes\Protocol\{Binkp,EMSI,DNS};
@endsection
@section('content')
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-12">
<h2>Site Setup</h2>
</div>
</div>
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">@if($o->exists) Update @else Initial @endif Setup</h2>
<form class="row g-0 needs-validation" method="post" novalidate>
@csrf
<div class="row">
<!-- System -->
<div class="col-4">
@ -298,10 +294,10 @@ use App\Classes\Protocol\{Binkp,EMSI,DNS};
</div>
@endcan
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('page-css')

View File

@ -7,8 +7,6 @@
<div class="row">
<div class="col-12">
<h2>System Status</h2>
</div>
</div>
<div class="accordion" id="accordion_status">
<!-- Totals -->
@ -200,6 +198,8 @@
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-css')

View File

@ -6,9 +6,13 @@
@endsection
@section('content')
<div class="row">
<div class="col-12">
@if($o->exists)
<h1>{{ $o->name }}@if($o->setup)<sup class="success" style="text-shadow: 0 0; font-size: 50%; top: -1em;">*</sup>@endif</h1>
@if($o->setup)<sup class="success" style="float:right;top:-2em;">* This Host</sup>@endif
<h1>
{{ $o->name }}@if($o->setup)<sup class="success">*</sup>@endif
@if($o->setup)<small class="success float-end">* This Host</small>@endif
</h1>
@endif
@if($o->zcs->count())
@ -25,7 +29,7 @@
<div id="collapse_system" class="accordion-collapse collapse {{ (! $flash=session()->pull('accordion')) ? 'show' : '' }}" aria-labelledby="system" data-bs-parent="#accordion_homepage">
<div class="accordion-body">
@include('system.form-system')
@include('system.widget.form-system')
</div>
</div>
</div>
@ -38,6 +42,8 @@
<div id="collapse_addresses" class="accordion-collapse collapse {{ ($flash=='address') ? 'show' : '' }}" aria-labelledby="addresses" data-bs-parent="#accordion_homepage">
<div class="accordion-body">
<div class="row">
<div class="col-12">
<p>FidoNet addresses are constructed in the format <strong class="highlight">zone</strong>:<strong class="highlight">net</strong>/<strong class="highlight">node</strong>.<strong class="highlight">point</strong><span>@</span><strong class="highlight">domain</strong>.</p>
<div class="accordion accordion-flush" id="accordion_ftnaddress">
@ -114,7 +120,7 @@
<tbody>
@foreach ($o->addresses->sortBy(function($item) { return sprintf('%04x%04x%04x%04x%04x',$item->zone->zone_id,$item->region_id,$item->host_id,$item->node_id,$item->point_id); }) as $oo)
<tr>
<td @if($oo->trashed()) class="trashed" @elseif (! $oo->active) class="inactive" @endif>{{ $oo->ftn }} <span class="float-end"><i title="@if($oo->validated)Mail flowing @else Mail held @endif" class="bi @if($oo->validated)bi-activity @else bi-radioactive @endif"></i></span></td>
<td @if($oo->trashed()) class="trashed" @elseif (! $oo->active) class="inactive" @endif>{{ $oo->ftn }}<span class="float-end"><i title="@if($oo->validated)Mail flowing @else Mail held @endif" class="bi @if($oo->validated)bi-activity @else bi-radioactive @endif"></i></span></td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td class="text-end">{{ $oo->security }}</td>
<td>{{ $oo->role_name }}</td>
@ -144,28 +150,27 @@
@endforeach
</tbody>
</table>
@error('susaddress')
<span class="btn btn-sm btn-danger" role="alert" style="text-align: left;">
{!! $message !!}
</span>
@enderror
@error('demaddress')
<span class="btn btn-sm btn-danger" role="alert" style="text-align: left;">
{!! $message !!}
</span>
@enderror
@error('proaddress')
<span class="btn btn-sm btn-danger" role="alert" style="text-align: left;">
{!! $message !!}
</span>
@enderror
@endif
</div>
</div>
@error('address')
<div class="row pb-5">
<div class="col-12">
<span class="btn btn-sm btn-danger" role="alert" style="text-align: left;">
{!! $message !!}
</span>
</div>
</div>
@enderror
@can('admin',$o)
@include('system.form-address')
<div class="row pb-2">
<div class="col-12">
@include('system.widget.form-address')
</div>
</div>
@else
You'll need to ask an admin to assign addresses.
@ -232,7 +237,7 @@
<p>No session details exist</p>
@endif
@include('system.form-session')
@include('system.widget.form-session')
</div>
</div>
</div>
@ -246,7 +251,7 @@
<div id="collapse_echoarea" class="accordion-collapse collapse {{ ($flash=='echoarea') ? 'show' : '' }}" aria-labelledby="echoarea" data-bs-parent="#accordion_homepage">
<div class="accordion-body">
<p>This system can subscribe to the following echoareas:</p>
@include('system.form-echoarea')
@include('system.widget.form-echoarea')
</div>
</div>
</div>
@ -260,7 +265,7 @@
<div id="collapse_filearea" class="accordion-collapse collapse {{ ($flash=='filearea') ? 'show' : '' }}" aria-labelledby="filearea" data-bs-parent="#accordion_homepage">
<div class="accordion-body">
<p>This system can subscribe to the following fileareas:</p>
@include('system.form-filearea')
@include('system.widget.form-filearea')
</div>
</div>
</div>
@ -638,14 +643,17 @@
</div>
</div>
@endif
@else
@include('system.form-system')
@include('system.widget.form-system')
@endif
</div>
@include('widgets.modal_packet')
@include('widgets.modal_files')
@include('widgets.modal_purge')
</div>
</div>
@endsection
@section('page-css')
@ -657,18 +665,18 @@
@endsection
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
$('.default').click(function() {
$(document).ready(function () {
$('.default').click(function () {
var item = this;
icon = $(item).find('i');
$.ajax({
type: 'POST',
data: {sid: {{$o->id}},_token: '{{csrf_token()}}',set:(icon.hasClass('bi-square') ? 1 : 0)},
beforeSend: function() {
data: {sid: {{$o->id}}, _token: '{{csrf_token()}}', set: (icon.hasClass('bi-square') ? 1 : 0)},
beforeSend: function () {
$(item).find('i').addClass('spinner-grow spinner-grow-sm');
},
success: function() {
success: function () {
if (icon.hasClass('bi-square')) {
icon.removeClass('bi-square');
icon.addClass('bi-check-square');
@ -679,13 +687,13 @@
$(item).find('i').removeClass('spinner-grow spinner-grow-sm');
},
error: function(e) {
error: function (e) {
$(item).find('i').removeClass('spinner-grow spinner-grow-sm');
if (e.status != 412)
alert('That didnt work? Please try again....');
},
url: '{{ url('zone/api/default') }}/'+item.attributes.itemid.nodeValue,
url: '{{ url('zone/api/default') }}/' + item.attributes.itemid.nodeValue,
cache: false
})
});

View File

@ -6,16 +6,16 @@
@endsection
@section('content')
<div class="row pt-0">
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-12">
<h2>Merge Address {{ $o->ftn }}</h2>
<p>{{ $o->system->sysop }} : {{ $o->system->name }}</p>
</div>
<div class="col-12">
<form method="POST">
@csrf
<table class="table monotable">
<thead>
<tr>
@ -63,9 +63,9 @@
</table>
<button type="submit" name="submit" class="btn btn-success float-end">Merge</button>
</div>
</div>
</form>
</div>
@include('error')
</div>
@include('widgets.error')
@endsection

View File

@ -11,9 +11,9 @@
</div>
</div>
@include('widgets.success')
@includeWhen(session()->has('success'),'widgets.success',['msg'=>session()->get('success')])
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row pt-0">

View File

@ -1,14 +0,0 @@
<form class="row g-0 needs-validation" method="post" novalidate>
@csrf
<input type="hidden" name="system_id" value="{{ $o->id }}">
<div class="row">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">@can('update',$o) @if($o->exists) Update @else Add @endif @endif System</h2>
@include('system.widget.form-system')
</div>
</div>
</div>
</form>

View File

@ -6,7 +6,7 @@
@section('content')
<div class="row">
<div class="col-12">
<h2>BBS Systems</h2>
<h2>About BBS Systems</h2>
<p>BBS Systems Send and Receive Echomail and Files.</p>
</div>
</div>

View File

@ -4,7 +4,7 @@
@endsection
@section('content')
<div class="row pt-0">
<div class="row">
<div class="col-12">
<h2>List of Connectable Systems</h2>

View File

@ -5,22 +5,20 @@ Move Address
@endsection
@section('content')
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-12">
<h1>{{ $o->system->name }} - {{ $o->ftn }}@if($o->system->setup)<sup class="success" style="text-shadow: 0 0; font-size: 50%; top: -1em;">*</sup>@endif</h1>
@if($o->system->setup)<sup class="success" style="float:right;top:-2em;">* This Host</sup>@endif
</div>
</div>
<h1>
{{ $o->system->name }} - {{ $o->ftn }}@if($o->system->setup)<sup class="success">*</sup>@endif
@if($o->system->setup)<small class="success float-end">* This Host</small>@endif
</h1>
<div class="row pt-0">
<div class="col-12">
<!-- @todo The list of presented system should only be those that the user can see -->
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">Move Address</h2>
<form class="row g-0 needs-validation" method="post" novalidate>
@csrf
<div class="row">
<!-- Choose System -->
<div class="col-4">
@ -105,10 +103,10 @@ Move Address
</div>
@endcan
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('page-css')

View File

@ -1,9 +1,7 @@
<form class="row g-0 needs-validation" method="post" action="{{ url('system/address/add',$o->id) }}" novalidate>
<input type="hidden" id="action" name="action" value="">
<form class="needs-validation" method="post" action="{{ url('system/address/add',$o->id) }}" novalidate>
@csrf
<input type="hidden" id="action" name="action" value="">
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">Assign New/Update Existing Address</h2>
@ -192,8 +190,7 @@
@endcan
</div>
</div>
</div>
</div>
</form>
@section('page-scripts')

View File

@ -3,7 +3,7 @@
->orderBy('zone_id')
->get())->count())
<form class="row g-0 needs-validation" method="post" action="{{ url('system/echoarea',$o->id) }}" novalidate>
<form class="needs-validation" method="post" action="{{ url('system/echoarea',$o->id) }}" novalidate>
@csrf
<div class="row pt-0">

View File

@ -3,7 +3,7 @@
->orderBy('zone_id')
->get())->count())
<form class="row g-0 needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" novalidate>
<form class="needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" novalidate>
@csrf
<div class="row pt-0">

View File

@ -4,9 +4,7 @@
->whereNotIn('id',$o->sessions->pluck('id'))
->get())->count())
<hr>
<form class="row g-0 needs-validation" method="post" action="{{ url('system/session/add',$o->id) }}" novalidate>
<form class="needs-validation" method="post" action="{{ url('system/session/add',$o->id) }}" novalidate>
@csrf
<div class="row pt-0">

View File

@ -1,452 +1,14 @@
<!-- $o = System::class -->
<div class="row pt-0">
<div class="col-12">
<h4 class="mb-0 pb-2">System Users</h4>
<div class="row pt-0">
<!-- Users -->
<div class="col-4">
<label for="users" class="form-label">Owners</label>
<div class="input-group has-validation">
<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="">&nbsp;</option>
@foreach (\App\Models\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>
<span class="invalid-feedback" role="alert">
@error('users')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<h4 class="mb-0 pb-2">System Details</h4>
<div class="row pt-0">
<!-- Name -->
<div class="col-4">
<label for="name" class="form-label">BBS Name</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-pc"></i></span>
<input type="text" class="form-control @error('name') is-invalid @enderror" id="name" placeholder="Name" name="name" value="{{ old('name',$o->name) }}" required @cannot('update',$o)readonly @endcannot autofocus>
<span id="search-icon" style="width: 0;"><i style="border-radius: 50%;" class="spinner-border spinner-border-sm text-dark d-none"></i></span>
<div id="system_search_results"></div>
<span class="invalid-feedback" role="alert">
@error('name')
{{ $message }}
@else
A name is required.
@enderror
</span>
</div>
</div>
<!-- ZeroTier ID -->
<div class="col-3">
<label for="zt_id" class="form-label">ZeroTier ID</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-shield-lock-fill"></i></span>
<input type="text" class="form-control @error('zt_id') is-invalid @enderror" id="zt_id" placeholder="ZeroTier" name="zt_id" value="{{ old('zt_id',$o->zt_id) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('zt_id')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Active -->
<div class="offset-2 col-2">
@can('update',$o)
<label for="active" class="form-label">Active</label>
<div class="input-group">
<div class="btn-group" role="group">
<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(! old('active',$o->active))checked @endif>
<label class="btn btn-outline-danger" for="active_no">No</label>
</div>
</div>
@endcan
</div>
</div>
<div class="row">
<!-- Sysop -->
<div class="col-4">
<label for="sysop" class="form-label">Sysop</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-person-fill"></i></span>
<input type="text" class="form-control @error('sysop') is-invalid @enderror" id="sysop" placeholder="Sysop" name="sysop" value="{{ old('sysop',$o->sysop) }}" required @cannot('admin',$o)readonly @endcannot autocomplete="name">
<span class="invalid-feedback" role="alert">
@error('sysop')
{{ $message }}
@else
A Sysop's name is required.
@enderror
</span>
</div>
</div>
<!-- Location -->
<div class="col-4">
<label for="location" class="form-label">Location</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('location') is-invalid @enderror" id="location" placeholder="Location" name="location" value="{{ old('location',$o->location) }}" required @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('location')
{{ $message }}
@else
System location is required.
@enderror
</span>
</div>
</div>
<!-- Hold -->
<div class="offset-1 col-2">
@can('update',$o)
<label for="hold" class="form-label">Hold Mail <i class="bi bi-info-circle" title="Dont give the node any mail regardless of poll mode"></i></label>
<div class="input-group">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="hold" id="hold_yes" value="1" required @if(old('hold',$o->hold))checked @endif>
<label class="btn btn-outline-warning" for="hold_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="hold" id="hold_no" value="0" required @if(! old('hold',$o->hold))checked @endif>
<label class="btn btn-outline-success" for="hold_no">No</label>
</div>
</div>
@endcan
</div>
</div>
<div class="row">
<!-- Address -->
<div class="col-5">
<label for="address" class="form-label">BBS Internet Hostname</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-globe"></i></span>
<input type="text" class="w-75 form-control @error('address') is-invalid @enderror" id="address" placeholder="FQDN" name="address" value="{{ old('address',$o->address) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('address')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Phone -->
<div class="col-3">
<label for="phone" class="form-label">Phone</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-telephone-fill"></i></span>
<input type="text" class="form-control @error('phone') is-invalid @enderror" id="phone" placeholder="Phone" name="phone" value="{{ old('phone',$o->phone) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('phone')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Poll Mode -->
<div class="offset-1 col-3">
@can('update',$o)
<label for="pollmode" class="form-label">Poll Mode <i class="bi bi-info-circle" title="Poll node when mail available, poll on a schedule or hold mail for collection"></i></label>
<div class="input-group has-validation">
<div class="btn-group @error('pollmode') is-invalid @enderror" role="group">
<input type="radio" class="btn-check" name="pollmode" id="poll_crash" value="2" @if((int)old('pollmode',($o->pollmode === TRUE) ? 2 : 0) === 2)checked @endif>
<label class="btn btn-outline-success" for="poll_crash">Crash</label>
<input type="radio" class="btn-check btn-danger" name="pollmode" id="poll_normal" value="1" @if((int)old('pollmode',($o->pollmode === FALSE) ? 1 : 0) === 1)checked @endif>
<label class="btn btn-outline-secondary" for="poll_normal">Normal</label>
<input type="radio" class="btn-check btn-danger" name="pollmode" id="poll_hold" value="0" @if((int)old('pollmode',is_null($o->pollmode) ? 0 : 1) === 0)checked @endif>
<label class="btn btn-outline-warning" for="poll_hold">Hold</label>
</div>
<span class="invalid-feedback" role="alert">
@error('pollmode')
{{ $message }}
@enderror
</span>
</div>
@endcan
</div>
</div>
</div>
</div>
<div class="row">
<!-- Mailer Details -->
<div class="col-12">
<h4 class="pt-4 mb-0 pb-2">Mailer Details</h4>
<!-- Mailer Ports -->
<div class="pt-0 row">
<div class="col-3">
@foreach (\App\Models\Mailer::all() as $mo)
@php($x=$o->mailers->find($mo))
<div class="pt-0 row">
<div class="col-12">
<label for="mailer_port_{{ $mo->id }}" class="form-label w-100">{{ $mo->name }} <span class="float-end text-warning">{{ $x?->pivot->last_poll }}</span></label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-modem-fill"></i></span>
<input type="text" class="form-control text-end @error('mailer_details.'.$mo->id.'.port') is-invalid @enderror" id="mailer_port_{{ $mo->id }}" placeholder="Port" name="mailer_details[{{ $mo->id }}][port]" value="{{ old('mailer_details.'.$mo->id.'.port',$x?->pivot->port) }}" @cannot($action,$o)readonly @endcannot>
<div class="input-group-text">
<input type="checkbox" class="form-control-input" name="mailer_details[{{ $mo->id }}][active]" value="1" title="Active" @if(old('mailer_details.'.$mo->id.'.active',$x?->pivot->active))checked @endif>
</div>
<span class="invalid-feedback" role="alert">
@error('mailer_details.'.$mo->id.'.port')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
@endforeach
</div>
<!-- Mail Packet -->
<div class="col-2">
<label for="pkt_type" class="form-label">Mail Packet</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-ui-radios"></i></span>
<select class="form-select @error('pkt_type') is-invalid @enderror" id="pkt_type" name="pkt_type" @cannot($action,$o)readonly @endcannot>
@foreach (\App\Classes\FTN\Packet::PACKET_TYPES as $type => $class)
<option value="{{ $type }}" @if(old('pkt_type',$o->pkt_type ?: config('fido.packet_default')) === $type)selected @endif>{{ $type }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('pkt_type')
{{ $message }}
@enderror
</span>
</div>
</div>
<div class="offset-3 col-4 @if((old('pollmode') === "0") || is_null($o->pollmode))d-none @endif" id="heartbeat_option">
@can('admin',$o)
<div class="row p-0">
<div class="offset-3 col-6">
<label for="method" class="form-label">Heartbeat <i class="bi bi-info-circle" title="Attempt contact after last seen"></i></label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hourglass-bottom"></i></span>
<input type="text" class="form-control text-end @error('heartbeat') is-invalid @enderror" id="heartbeat" placeholder="Hours" name="heartbeat" value="{{ old('heartbeat',$o->heartbeat) }}">
<span class="invalid-feedback" role="alert">
@error('heartbeat')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
@endcan
@if (! is_null($o->pollmode))
<div class="row">
<div class="offset-3 col-9 bg-secondary rounded p-2 small">
@if($job = $o->poll())
<div class="row p-0">
<div class="col-4 text-dark">
@if($job->attempts)Last: @else Scheduled: @endif
</div>
<div class="col-8">
<strong class="highlight">{{ $job->created_at }}</strong>
</div>
</div>
<div class="row">
<div class="col-4 text-dark">
Attempts:
</div>
<div class="col-8">
<strong class="highlight">{{ $job->attempts ?: 0 }}</strong>
</div>
</div>
@if ($job->attempts)
<div class="row">
<div class="col-4 text-dark">
Next:
</div>
<div class="col-8">
<strong class="highlight">{{ $job->available_at->diffForHumans(now(),$job->available_at->isFuture() ? \Carbon\CarbonInterface::DIFF_ABSOLUTE : \Carbon\CarbonInterface::DIFF_RELATIVE_TO_NOW) }}</strong>
</div>
</div>
@endif
@else
<div class="row p-0">
<div class="col-4 text-dark">
Last Poll:
</div>
<div class="col-8">
<strong class="highlight">{{ ($x=$o->logs->where('originate',TRUE)->last())?->created_at ?: 'Never' }}</strong>
</div>
</div>
<div class="row">
<div class="col-4 text-dark">
Method:
</div>
<div class="col-8">
<strong class="highlight">{{ $x ? $x->mailer->name : '-' }}</strong>
</div>
</div>
@if ($o->heartbeat)
<div class="row">
<div class="col-4 text-dark">
Next Heartbeat:
</div>
<div class="col-8">
<strong class="highlight">{{ $x ? $x->created_at->addHours($o->heartbeat) : Carbon::now() }}</strong>
</div>
</div>
@endif
@endif
<div class="row">
<div class="col-4 text-dark">
Status:
</div>
<div class="col-8">
<strong class="highlight">
@if ($job) Queued
@elseif ($o->autohold)Auto Hold
@else
@switch($o->pollmode)
@case(TRUE) Crash @break;
@case(FALSE) Normal @break;
@default Hold
@endswitch
@endif
</strong>
</div>
</div>
</div>
</div>
{{--
<div class="col-12">
<table class="table monotable m-0 p-0 small noborder">
<tbody xstyle="border-style:dotted;">
<tr>
<td class="cap text-end">Status :</td>
<td>
@if ($job) Queued
@elseif ($o->autohold)Auto Hold
@else
@switch($o->pollmode)
@case(TRUE) Crash @break;
@case(FALSE) Normal @break;
@default Hold
@endswitch
@endif
</td>
</tr>
</tbody>
</table>
</div>
--}}
@endif
</div>
</div>
</div>
</div>
<div class="row">
<!-- BBS Details -->
<div class="col-12">
<h4 class="pt-4 mb-0 pb-2">BBS Details</h4>
<div class="pt-0 row">
<div class="col-2">
<label for="method" class="form-label">Connection Method</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-wifi"></i></span>
<select class="form-select @error('method') is-invalid @enderror" id="method" name="method" @cannot($action,$o)readonly @endcannot>
<option></option>
<option value="23" @if(old('method',$o->method) == 23)selected @endif>Telnet</option>
<option value="22" @if(old('method',$o->method) == 22)selected @endif>SSH</option>
<option value="519" @if(old('method',$o->method) == 519)selected @endif>Rlogin</option>
</select>
</div>
</div>
<div class="col-2">
<label for="method" class="form-label">Port</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-wifi"></i></span>
<input type="text" class="form-control text-end @error('port') is-invalid @enderror" id="port" placeholder="Port" name="port" value="{{ old('port',$o->port) }}" @cannot($action,$o)readonly @endcannot>
</div>
</div>
</div>
</div>
</div>
@can('admin',$o)
<div class="row">
<!-- Notes -->
<div class="col-12">
<label for="notes" class="form-label">Notes</label>
<textarea class="form-control" rows=3 name="notes" placeholder="Notes...">{{ old('notes',$o->notes) }}</textarea>
</div>
</div>
@endcan
<div class="row">
<div class="col-12">
@if($o->exists)
@can($action,$o)
<a href="{{ url('system') }}" class="btn btn-danger">Cancel</a>
<button type="submit" name="submit" class="btn btn-success float-end">@if ($o->exists)Save @else Add @endif</button>
@else
<form class="needs-validation" method="post" novalidate>
@csrf
<input type="hidden" name="system_id" value="{{ $o->id }}">
<span><small><strong>NOTE:</strong> You'll be able to update these details after registration is completed.</small></span>
<button type="submit" class="btn btn-success float-end" name="submit" value="register">Register</button>
@endcan
@else
<button type="submit" class="btn btn-success float-end" name="submit" value="create">Register</button>
@endif
<div class="row pt-0">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">@can('update',$o) @if($o->exists) Update @else Add @endif @endif System</h2>
@include('system.widget.system')
</div>
</div>
@section('page-css')
@css('select2')
@append
@section('page-scripts')
@js('select2')
<script type="text/javascript">
$(document).ready(function() {
$('#users').select2({
@cannot('admin')disabled: true @endcannot
/*multiple: true*/
});
$('#poll_normal').on('click',function() {
$('#heartbeat_option').removeClass('d-none');
})
$('#poll_crash').on('click',function() {
$('#heartbeat_option').removeClass('d-none');
})
$('#poll_hold').on('click',function() {
$('#heartbeat_option').addClass('d-none');
console.log('hold');
})
})
</script>
@append
</div>
</div>
</form>

View File

@ -0,0 +1,452 @@
<!-- $o = System::class -->
<div class="row pt-0">
<div class="col-12">
<h4 class="mb-0 pb-2">System Users</h4>
<div class="row pt-0">
<!-- Users -->
<div class="col-4">
<label for="users" class="form-label">Owners</label>
<div class="input-group has-validation">
<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="">&nbsp;</option>
@foreach (\App\Models\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>
<span class="invalid-feedback" role="alert">
@error('users')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-12">
<h4 class="mb-0 pb-2">System Details</h4>
<div class="row pt-0">
<!-- Name -->
<div class="col-4">
<label for="name" class="form-label">BBS Name</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-pc"></i></span>
<input type="text" class="form-control @error('name') is-invalid @enderror" id="name" placeholder="Name" name="name" value="{{ old('name',$o->name) }}" required @cannot('update',$o)readonly @endcannot autofocus>
<span id="search-icon" style="width: 0;"><i style="border-radius: 50%;" class="spinner-border spinner-border-sm text-dark d-none"></i></span>
<div id="system_search_results"></div>
<span class="invalid-feedback" role="alert">
@error('name')
{{ $message }}
@else
A name is required.
@enderror
</span>
</div>
</div>
<!-- ZeroTier ID -->
<div class="col-3">
<label for="zt_id" class="form-label">ZeroTier ID</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-shield-lock-fill"></i></span>
<input type="text" class="form-control @error('zt_id') is-invalid @enderror" id="zt_id" placeholder="ZeroTier" name="zt_id" value="{{ old('zt_id',$o->zt_id) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('zt_id')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Active -->
<div class="offset-2 col-2">
@can('update',$o)
<label for="active" class="form-label">Active</label>
<div class="input-group">
<div class="btn-group" role="group">
<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(! old('active',$o->active))checked @endif>
<label class="btn btn-outline-danger" for="active_no">No</label>
</div>
</div>
@endcan
</div>
</div>
<div class="row">
<!-- Sysop -->
<div class="col-4">
<label for="sysop" class="form-label">Sysop</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-person-fill"></i></span>
<input type="text" class="form-control @error('sysop') is-invalid @enderror" id="sysop" placeholder="Sysop" name="sysop" value="{{ old('sysop',$o->sysop) }}" required @cannot('admin',$o)readonly @endcannot autocomplete="name">
<span class="invalid-feedback" role="alert">
@error('sysop')
{{ $message }}
@else
A Sysop's name is required.
@enderror
</span>
</div>
</div>
<!-- Location -->
<div class="col-4">
<label for="location" class="form-label">Location</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('location') is-invalid @enderror" id="location" placeholder="Location" name="location" value="{{ old('location',$o->location) }}" required @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('location')
{{ $message }}
@else
System location is required.
@enderror
</span>
</div>
</div>
<!-- Hold -->
<div class="offset-1 col-2">
@can('update',$o)
<label for="hold" class="form-label">Hold Mail <i class="bi bi-info-circle" title="Dont give the node any mail regardless of poll mode"></i></label>
<div class="input-group">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="hold" id="hold_yes" value="1" required @if(old('hold',$o->hold))checked @endif>
<label class="btn btn-outline-warning" for="hold_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="hold" id="hold_no" value="0" required @if(! old('hold',$o->hold))checked @endif>
<label class="btn btn-outline-success" for="hold_no">No</label>
</div>
</div>
@endcan
</div>
</div>
<div class="row">
<!-- Address -->
<div class="col-5">
<label for="address" class="form-label">BBS Internet Hostname</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-globe"></i></span>
<input type="text" class="w-75 form-control @error('address') is-invalid @enderror" id="address" placeholder="FQDN" name="address" value="{{ old('address',$o->address) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('address')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Phone -->
<div class="col-3">
<label for="phone" class="form-label">Phone</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-telephone-fill"></i></span>
<input type="text" class="form-control @error('phone') is-invalid @enderror" id="phone" placeholder="Phone" name="phone" value="{{ old('phone',$o->phone) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('phone')
{{ $message }}
@enderror
</span>
</div>
</div>
<!-- Poll Mode -->
<div class="offset-1 col-3">
@can('update',$o)
<label for="pollmode" class="form-label">Poll Mode <i class="bi bi-info-circle" title="Poll node when mail available, poll on a schedule or hold mail for collection"></i></label>
<div class="input-group has-validation">
<div class="btn-group @error('pollmode') is-invalid @enderror" role="group">
<input type="radio" class="btn-check" name="pollmode" id="poll_crash" value="2" @if((int)old('pollmode',($o->pollmode === TRUE) ? 2 : 0) === 2)checked @endif>
<label class="btn btn-outline-success" for="poll_crash">Crash</label>
<input type="radio" class="btn-check btn-danger" name="pollmode" id="poll_normal" value="1" @if((int)old('pollmode',($o->pollmode === FALSE) ? 1 : 0) === 1)checked @endif>
<label class="btn btn-outline-secondary" for="poll_normal">Normal</label>
<input type="radio" class="btn-check btn-danger" name="pollmode" id="poll_hold" value="0" @if((int)old('pollmode',is_null($o->pollmode) ? 0 : 1) === 0)checked @endif>
<label class="btn btn-outline-warning" for="poll_hold">Hold</label>
</div>
<span class="invalid-feedback" role="alert">
@error('pollmode')
{{ $message }}
@enderror
</span>
</div>
@endcan
</div>
</div>
</div>
</div>
<div class="row pt-4">
<!-- Mailer Details -->
<div class="col-12">
<h4 class="mb-0 pb-2">Mailer Details</h4>
<!-- Mailer Ports -->
<div class="row pt-0">
<div class="col-3">
@foreach (\App\Models\Mailer::all() as $mo)
@php($x=$o->mailers->find($mo))
<div class="row pt-0">
<div class="col-12">
<label for="mailer_port_{{ $mo->id }}" class="form-label w-100">{{ $mo->name }} <span class="float-end text-warning">{{ $x?->pivot->last_poll }}</span></label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-modem-fill"></i></span>
<input type="text" class="form-control text-end @error('mailer_details.'.$mo->id.'.port') is-invalid @enderror" id="mailer_port_{{ $mo->id }}" placeholder="Port" name="mailer_details[{{ $mo->id }}][port]" value="{{ old('mailer_details.'.$mo->id.'.port',$x?->pivot->port) }}" @cannot($action,$o)readonly @endcannot>
<div class="input-group-text">
<input type="checkbox" class="form-control-input" name="mailer_details[{{ $mo->id }}][active]" value="1" title="Active" @if(old('mailer_details.'.$mo->id.'.active',$x?->pivot->active))checked @endif>
</div>
<span class="invalid-feedback" role="alert">
@error('mailer_details.'.$mo->id.'.port')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
@endforeach
</div>
<!-- Mail Packet -->
<div class="col-2">
<label for="pkt_type" class="form-label">Mail Packet</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-ui-radios"></i></span>
<select class="form-select @error('pkt_type') is-invalid @enderror" id="pkt_type" name="pkt_type" @cannot($action,$o)readonly @endcannot>
@foreach (\App\Classes\FTN\Packet::PACKET_TYPES as $type => $class)
<option value="{{ $type }}" @if(old('pkt_type',$o->pkt_type ?: config('fido.packet_default')) === $type)selected @endif>{{ $type }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('pkt_type')
{{ $message }}
@enderror
</span>
</div>
</div>
<div class="offset-3 col-4 @if((old('pollmode') === "0") || is_null($o->pollmode))d-none @endif" id="heartbeat_option">
@can('admin',$o)
<div class="row p-0">
<div class="offset-3 col-6">
<label for="method" class="form-label">Heartbeat <i class="bi bi-info-circle" title="Attempt contact after last seen"></i></label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hourglass-bottom"></i></span>
<input type="text" class="form-control text-end @error('heartbeat') is-invalid @enderror" id="heartbeat" placeholder="Hours" name="heartbeat" value="{{ old('heartbeat',$o->heartbeat) }}">
<span class="invalid-feedback" role="alert">
@error('heartbeat')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
@endcan
@if (! is_null($o->pollmode))
<div class="row">
<div class="offset-3 col-9 bg-secondary rounded p-2 small">
@if($job = $o->poll())
<div class="row p-0">
<div class="col-4 text-dark">
@if($job->attempts)Last: @else Scheduled: @endif
</div>
<div class="col-8">
<strong class="highlight">{{ $job->created_at }}</strong>
</div>
</div>
<div class="row">
<div class="col-4 text-dark">
Attempts:
</div>
<div class="col-8">
<strong class="highlight">{{ $job->attempts ?: 0 }}</strong>
</div>
</div>
@if ($job->attempts)
<div class="row">
<div class="col-4 text-dark">
Next:
</div>
<div class="col-8">
<strong class="highlight">{{ $job->available_at->diffForHumans(now(),$job->available_at->isFuture() ? \Carbon\CarbonInterface::DIFF_ABSOLUTE : \Carbon\CarbonInterface::DIFF_RELATIVE_TO_NOW) }}</strong>
</div>
</div>
@endif
@else
<div class="row p-0">
<div class="col-4 text-dark">
Last Poll:
</div>
<div class="col-8">
<strong class="highlight">{{ ($x=$o->logs->where('originate',TRUE)->last())?->created_at ?: 'Never' }}</strong>
</div>
</div>
<div class="row">
<div class="col-4 text-dark">
Method:
</div>
<div class="col-8">
<strong class="highlight">{{ $x ? $x->mailer->name : '-' }}</strong>
</div>
</div>
@if ($o->heartbeat)
<div class="row">
<div class="col-4 text-dark">
Next Heartbeat:
</div>
<div class="col-8">
<strong class="highlight">{{ $x ? $x->created_at->addHours($o->heartbeat) : Carbon::now() }}</strong>
</div>
</div>
@endif
@endif
<div class="row">
<div class="col-4 text-dark">
Status:
</div>
<div class="col-8">
<strong class="highlight">
@if ($job) Queued
@elseif ($o->autohold)Auto Hold
@else
@switch($o->pollmode)
@case(TRUE) Crash @break;
@case(FALSE) Normal @break;
@default Hold
@endswitch
@endif
</strong>
</div>
</div>
</div>
</div>
{{--
<div class="col-12">
<table class="table monotable m-0 p-0 small noborder">
<tbody xstyle="border-style:dotted;">
<tr>
<td class="cap text-end">Status :</td>
<td>
@if ($job) Queued
@elseif ($o->autohold)Auto Hold
@else
@switch($o->pollmode)
@case(TRUE) Crash @break;
@case(FALSE) Normal @break;
@default Hold
@endswitch
@endif
</td>
</tr>
</tbody>
</table>
</div>
--}}
@endif
</div>
</div>
</div>
</div>
<div class="row pt-4">
<!-- BBS Details -->
<div class="col-12">
<h4 class="mb-0 pb-2">BBS Details</h4>
<div class="row pt-0">
<div class="col-2">
<label for="method" class="form-label">Connection Method</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-wifi"></i></span>
<select class="form-select @error('method') is-invalid @enderror" id="method" name="method" @cannot($action,$o)readonly @endcannot>
<option></option>
<option value="23" @if(old('method',$o->method) == 23)selected @endif>Telnet</option>
<option value="22" @if(old('method',$o->method) == 22)selected @endif>SSH</option>
<option value="519" @if(old('method',$o->method) == 519)selected @endif>Rlogin</option>
</select>
</div>
</div>
<div class="col-2">
<label for="method" class="form-label">Port</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-wifi"></i></span>
<input type="text" class="form-control text-end @error('port') is-invalid @enderror" id="port" placeholder="Port" name="port" value="{{ old('port',$o->port) }}" @cannot($action,$o)readonly @endcannot>
</div>
</div>
</div>
</div>
</div>
@can('admin',$o)
<div class="row">
<!-- Notes -->
<div class="col-12">
<label for="notes" class="form-label">Notes</label>
<textarea class="form-control" rows=3 name="notes" placeholder="Notes...">{{ old('notes',$o->notes) }}</textarea>
</div>
</div>
@endcan
<div class="row">
<div class="col-12">
@if($o->exists)
@can($action,$o)
<a href="{{ url('system') }}" class="btn btn-danger">Cancel</a>
<button type="submit" name="submit" class="btn btn-success float-end">@if ($o->exists)Save @else Add @endif</button>
@else
<input type="hidden" name="system_id" value="{{ $o->id }}">
<span><small><strong>NOTE:</strong> You'll be able to update these details after registration is completed.</small></span>
<button type="submit" class="btn btn-success float-end" name="submit" value="register">Register</button>
@endcan
@else
<button type="submit" class="btn btn-success float-end" name="submit" value="create">Register</button>
@endif
</div>
</div>
@section('page-css')
@css('select2')
@append
@section('page-scripts')
@js('select2')
<script type="text/javascript">
$(document).ready(function() {
$('#users').select2({
@cannot('admin')disabled: true @endcannot
/*multiple: true*/
});
$('#poll_normal').on('click',function() {
$('#heartbeat_option').removeClass('d-none');
})
$('#poll_crash').on('click',function() {
$('#heartbeat_option').removeClass('d-none');
})
$('#poll_hold').on('click',function() {
$('#heartbeat_option').addClass('d-none');
console.log('hold');
})
})
</script>
@append

View File

@ -5,14 +5,12 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<div class="row pt-0">
<div class="col-12">
<h2 class="cap">@if($o->exists) Update @else Add @endif User</h2>
<div class="row">
@ -130,10 +128,8 @@
</div>
</div>
</div>
</div>
</div>
<div class="row pt-5">
<div class="row">
<div class="col-12">
<h3>Systems</h3>

View File

@ -4,14 +4,10 @@
@endsection
@section('content')
<div class="row">
<div class="row">
<div class="col-12">
<h2>System Users</h2>
</div>
</div>
<div class="col-12">
<p>This system is aware of the following users @can('admin',(new \App\Models\User))(you can <a href="{{ url('user/addedit') }}">add</a> more)@endcan:</p>
<table class="table monotable" id="user">
<thead>

View File

@ -4,11 +4,13 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<input type="hidden" id="address_id" name="address_id">
<div class="row">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">Enter your Link code</h2>
@ -67,6 +69,8 @@
</div>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@ -5,7 +5,7 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" autocomplete="off" novalidate>
<form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf
<div class="row">

View File

@ -27,14 +27,14 @@
<p>Otherwise, if all is good, we'll send a netmail to <strong class="highlight">{{ $o->sysop }}</strong> at <strong class="highlight">{{ $o->access_mailer }}</strong></p> with further details.
<form class="row g-0 needs-validation" method="post" autocomplete="off" action="{{ url('user/system/link') }}" novalidate>
<form class="needs-validation" method="post" autocomplete="off" action="{{ url('user/system/link') }}" novalidate>
@csrf
<input type="hidden" name="system_id" value="{{ $o->id }}">
<input type="hidden" name="name" value="{{ $o->name }}">
<div class="row">
<div class="col-12 pb-2">
<div class="row pb-2">
<div class="col-12">
<input type="submit" name="action" class="btn btn-success" value="Link">
</div>
</div>

View File

@ -0,0 +1,5 @@
<div class="row">
<div class="col-8 m-auto">
@include('widgets.success')
</div>
</div>

View File

@ -1,10 +1,5 @@
<!-- Success -->
@if(session()->has('success'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
<h4 class="text-success"><i class="bi bi-hand-thumbs-up"></i> Success!</h4>
<ul>
<li>{{ session()->get('success') }}</li>
</ul>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
@endif
<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="bi bi-hand-thumbs-up"></i> {{ $msg }}
<button type="button" class="btn btn-sm btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

View File

@ -5,7 +5,7 @@
@endsection
@section('content')
<form class="row g-0 needs-validation" method="post" novalidate>
<form class="needs-validation" method="post" novalidate>
@csrf
<div class="row">

View File

@ -50,10 +50,14 @@ Route::view('system/list','system.list');
Route::get('system/view/{o}',[SystemController::class,'view'])
->where('o','[0-9]+');
Route::get('search',[HomeController::class,'search']);
Route::view('user/permissions','auth.permissions');
Route::middleware(['auth','verified','activeuser'])->group(function () {
Route::view('dashboard','dashboard');
/* ACCOUNT PATHS */
Route::view('user/update','user/update');
/* DOMAIN PATHS */
Route::view('domain','domain.home');
Route::get('domain/api/hosts/{o}/{region}',[DomainController::class,'api_hosts'])
@ -121,7 +125,6 @@ Route::middleware(['auth','verified','activeuser'])->group(function () {
Route::post('packet/contents/{o}/{packet}',[HomeController::class,'packet_contents'])
->where('o','[0-9]+')
->where('packet','[[:xdigit:]]+');
Route::get('permissions',[HomeController::class,'permissions']);
Route::match(['get','post'],'user/system/register',[SystemController::class,'register']);
Route::match(['post'],'user/system/link',[SystemController::class,'system_link']);