Compare commits

...

10 Commits

36 changed files with 573 additions and 867 deletions

View File

@ -20,12 +20,13 @@ class PageAssets
'datatables' => [ 'datatables' => [
'base' => [ 'base' => [
'css' => [ 'css' => [
'//cdn.datatables.net/2.1.2/css/dataTables.bootstrap4.css', '//cdn.datatables.net/1.10.25/css/dataTables.bootstrap5.css',
//'//cdn.datatables.net/2.1.2/css/dataTables.dataTables.min.css', //'//cdn.datatables.net/2.1.2/css/dataTables.dataTables.min.css',
'/plugin/dataTables/dataTables.bootstrap5.css',
], ],
'js' => [ 'js' => [
'//cdn.datatables.net/2.1.2/js/dataTables.min.js', '//cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js',
'//cdn.datatables.net/2.1.2/js/dataTables.bootstrap4.min.js', '//cdn.datatables.net/1.10.25/js/dataTables.bootstrap5.min.js',
], ],
], ],
'buttons' => [ 'buttons' => [
@ -42,7 +43,8 @@ class PageAssets
], ],
'conditionalpaging' => [ 'conditionalpaging' => [
'js' => [ 'js' => [
'//cdn.datatables.net/plug-ins/2.0.5/features/conditionalPaging/dataTables.conditionalPaging.min.js', //'//cdn.datatables.net/plug-ins/2.0.5/features/conditionalPaging/dataTables.conditionalPaging.min.js',
'/plugin/dataTables/dataTables.conditionalPaging.js',
], ],
], ],
'fixedheader' => [ 'fixedheader' => [
@ -69,13 +71,13 @@ class PageAssets
], ],
'rowgroup' => [ 'rowgroup' => [
'css' => [ 'css' => [
'//cdn.datatables.net/rowgroup/1.5.0/css/rowGroup.bootstrap4.min.css', '//cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.bootstrap4.min.css',
//'//cdn.datatables.net/rowgroup/1.5.0/css/rowGroup.dataTables.min.css', //'//cdn.datatables.net/rowgroup/1.5.0/css/rowGroup.dataTables.min.css',
], ],
'js' => [ 'js' => [
'//cdn.datatables.net/rowgroup/1.5.0/js/dataTables.rowGroup.min.js', '//cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js',
//'//cdn.datatables.net/rowgroup/1.5.0/js/rowGroup.dataTables.min.js', //'//cdn.datatables.net/rowgroup/1.5.0/js/rowGroup.dataTables.min.js',
'//cdn.datatables.net/rowgroup/1.5.0/js/rowGroup.bootstrap4.min.js', '//cdn.datatables.net/rowgroup/1.1.2/js/rowGroup.bootstrap5.min.js',
], ],
], ],
'searchpanes' => [ 'searchpanes' => [
@ -109,17 +111,14 @@ class PageAssets
'select2' => [ 'select2' => [
'base' => [ 'base' => [
'css' => [ 'css' => [
'//cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css', '//cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css',
'//cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css',
], ],
'js' => [ 'js' => [
'//cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js', '//cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.full.min.js',
],
],
'autofocus' => [
'js' => [
'/plugin/select2/fix-autofocus.js', '/plugin/select2/fix-autofocus.js',
], ],
] ],
], ],
'simplemde' => [ 'simplemde' => [
'base' => [ 'base' => [

View File

@ -49,6 +49,9 @@ class SystemController extends Controller
$o->autohold = FALSE; $o->autohold = FALSE;
$o->save(); $o->save();
if ($o->wasRecentlyCreated)
$o->users()->attach(Auth::id());
$mailers = collect($request->post('mailer_details')) $mailers = collect($request->post('mailer_details'))
->filter(function($item) { return $item['port']; }) ->filter(function($item) { return $item['port']; })
->transform(function($item) { $item['active'] = Arr::get($item,'active',FALSE); return $item; }); ->transform(function($item) { $item['active'] = Arr::get($item,'active',FALSE); return $item; });
@ -170,7 +173,9 @@ class SystemController extends Controller
// Make sure that no other system has this address active. // Make sure that no other system has this address active.
if ($o->role_id === Address::NODE_NN) if ($o->role_id === Address::NODE_NN)
return redirect()->back()->withErrors(['address'=>sprintf('%s cannot be demoted any more',$o->ftn3D)]); return redirect()
->back()
->withErrors(['address'=>sprintf('%s cannot be demoted any more',$o->ftn3D)]);
$off = $o->role_id; $off = $o->role_id;
$o->role &= ~$off; $o->role &= ~$off;
@ -178,7 +183,8 @@ class SystemController extends Controller
$o->save(); $o->save();
return redirect()->to(sprintf('system/addedit/%d',$o->system_id)); return redirect()
->to(sprintf('system/addedit/%d',$o->system_id));
} }
public function address_merge(AddressMerge $request,int $id) public function address_merge(AddressMerge $request,int $id)
@ -348,8 +354,10 @@ class SystemController extends Controller
session()->flash('accordion','address'); session()->flash('accordion','address');
// Make sure that no other system has this address active. // Make sure that no other system has this address active.
if ($o->role_id === Address::NODE_NC) if ($o->role_id === Address::NODE_HC)
return redirect()->back()->withErrors(['address'=>sprintf('%s cannot be promoted any more',$o->ftn3D)]); return redirect()
->back()
->withErrors(['address'=>sprintf('%s cannot be promoted any more',$o->ftn3D)]);
$off = $o->role_id; $off = $o->role_id;
$o->role &= ~$off; $o->role &= ~$off;
@ -357,7 +365,8 @@ class SystemController extends Controller
$o->save(); $o->save();
return redirect()->to(sprintf('system/addedit/%d',$o->system_id)); return redirect()
->to(sprintf('system/addedit/%d',$o->system_id));
} }
/** /**
@ -621,39 +630,19 @@ class SystemController extends Controller
*/ */
public function register(SystemRegisterRequest $request) public function register(SystemRegisterRequest $request)
{ {
if ($request->action === 'register' && $request->name && is_numeric($request->name)) // During the BBS linking process, if the user selected a system will link to confirm it
return view('user.system.widget.register_confirm') if ($request->action === 'register' && $request->system_id && is_numeric($request->system_id))
->with('o',System::findOrFail($request->name)); return redirect()
->to(sprintf('user/system/register_confirm/%d',$request->system_id));
$o = System::findOrNew(is_numeric($request->system_id) ? $request->system_id : NULL); // Re-flash our previously input data, we must be creating a new system
session()->flashInput([
'name'=>$request->system_id,
'sysop'=>Auth::user()->name,
]);
// If the system doesnt exist, we'll create it return redirect()
if (! $o->exist) { ->to('system/addedit');
$o->sysop = Auth::user()->name;
foreach (['name','zt_id','location','phone','method','address','port'] as $item)
if ($request->{$item})
$o->{$item} = $request->{$item};
$o->active = TRUE;
}
if ($request->post('submit')) {
Auth::user()->systems()->save($o);
// @todo if the system already exists and part of one of our networks, we'll need to send the registration email to confirm the address.
// @todo mark the system (or addresses) as "pending" at this stage until it is confirmed
return redirect()->to(url('system/addedit',$o->id));
}
// Re-flash our previously input data
if ($request->old)
session()->flashInput($request->old);
return view('system.widget.system')
->with('action',$request->action)
->with('o',$o)
->with('errors',new ViewErrorBag);
} }
/** /**
@ -695,9 +684,16 @@ class SystemController extends Controller
$this->authorize('update_nn',$o); $this->authorize('update_nn',$o);
session()->flash('accordion','session'); session()->flash('accordion','session');
// Remove the subscription to file/echo areas for each address affected
foreach ($o->akas->where('zone_id',$zo->id) as $ao) {
$ao->echoareas()->detach();
$ao->fileareas()->detach();
}
$o->sessions()->detach($zo); $o->sessions()->detach($zo);
return redirect()->to(sprintf('system/addedit/%d',$o->id)); return redirect()
->to(sprintf('system/addedit/%d',$o->id));
} }
// @todo Can this be consolidated with system_register() // @todo Can this be consolidated with system_register()

View File

@ -64,7 +64,9 @@ class UserController extends Controller
'code', 'Invalid Code!' 'code', 'Invalid Code!'
); );
return back()->withErrors($validator); return back()
->withInput()
->withErrors($validator);
} }
} }

View File

@ -56,8 +56,11 @@ class SystemRegisterRequest extends FormRequest
return []; return [];
$so = $this->route('o'); $so = $this->route('o');
// When we have selected a system during the register/linking process
if ((! $so) && ($request->action === 'register')) if ((! $so) && ($request->action === 'register'))
return []; // If system ID is not numeric, then its a new system
return is_numeric($request->system_id) ? ['system_id'=>'required|exists:systems,id'] : [];
return array_filter(array_merge([ return array_filter(array_merge([
'name' => 'required|min:3', 'name' => 'required|min:3',
@ -68,14 +71,16 @@ class SystemRegisterRequest extends FormRequest
'port' => 'nullable|digits_between:2,5', 'port' => 'nullable|digits_between:2,5',
'method' => 'nullable|numeric', 'method' => 'nullable|numeric',
'mailer_details.*' => 'nullable|array', 'mailer_details.*' => 'nullable|array',
// @todo Port should be present if active is true
'mailer_details.*.port' => 'nullable|digits_between:2,5', 'mailer_details.*.port' => 'nullable|digits_between:2,5',
'mailer_details.*.active' => 'sometimes|boolean',
'zt_id' => 'nullable|size:10|regex:/^([A-Fa-f0-9]){10}$/|unique:systems,zt_id,'.($so ? $so->id : 0), 'zt_id' => 'nullable|size:10|regex:/^([A-Fa-f0-9]){10}$/|unique:systems,zt_id,'.($so ? $so->id : 0),
'pkt_type' => ['required',Rule::in(array_keys(Packet::PACKET_TYPES))], 'pkt_type' => ['required',Rule::in(array_keys(Packet::PACKET_TYPES))],
],($so && $so->exists) ? [
'users' => 'nullable|array|min:1|max:2',
'active' => 'required|boolean', 'active' => 'required|boolean',
'hold' => 'sometimes|boolean', 'hold' => 'sometimes|boolean',
'pollmode' => 'required|integer|min:0|max:2', 'pollmode' => 'required|integer|min:0|max:2',
],($so && $so->exists) ? [
'users' => 'nullable|array|min:1|max:2',
'heartbeat' => [ 'heartbeat' => [
'nullable', 'nullable',
'integer', 'integer',

View File

@ -25,6 +25,13 @@ class SystemPolicy
{ {
use HandlesAuthorization; use HandlesAuthorization;
public function admin(User $user, System $system): bool
{
// Site Admins can always create
// If it doesnt exist, then a user can create it.
return ($user->isAdmin() || (! $system->exists));
}
/** /**
* Determine whether the user can create the model. * Determine whether the user can create the model.
* *
@ -70,9 +77,9 @@ class SystemPolicy
if ($user->isAdmin()) if ($user->isAdmin())
return TRUE; return TRUE;
// If it doesnt exist, then its a false. // If it doesnt exist, then its a true (they are creating it).
if (! $system->exists) if (! $system->exists)
return FALSE; return TRUE;
// @todo Permit ZC, RC, NC, HUB user // @todo Permit ZC, RC, NC, HUB user

View File

@ -118,7 +118,8 @@ class System extends Model
->select(['zones.id','zones.zone_id','domain_id','zones.active']) ->select(['zones.id','zones.zone_id','domain_id','zones.active'])
->join('domains',['domains.id'=>'zones.domain_id']) ->join('domains',['domains.id'=>'zones.domain_id'])
->withPivot(['sespass','pktpass','ticpass','fixpass','zt_ipv4','zt_ipv6','default']) ->withPivot(['sespass','pktpass','ticpass','fixpass','zt_ipv4','zt_ipv6','default'])
->orderBy('domains.name'); ->orderBy('domains.name')
->dontCache();
} }
/** /**

View File

@ -2,6 +2,7 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Notifications\ChannelManager; use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -9,14 +10,16 @@ use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use App\Events\Echomail as EchomailEvent; use App\Events\Echomail as EchomailEvent;
use App\Events\Matrix\Message; use App\Events\Matrix\Message;
use App\Helpers\PageAssets;
use App\Listeners\EchomailListener; use App\Listeners\EchomailListener;
use App\Listeners\Matrix\MessageListener; use App\Listeners\Matrix\MessageListener;
use App\Notifications\Channels\{EchomailChannel,MatrixChannel,NetmailChannel}; use App\Notifications\Channels\{EchomailChannel,MatrixChannel,NetmailChannel};
use App\Models\{Echomail,Netmail,User}; use App\Models\{Echomail,Netmail,System,User};
use App\Traits\Single; use App\Traits\Single;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
@ -79,5 +82,11 @@ class AppServiceProvider extends ServiceProvider
EchomailEvent::class, EchomailEvent::class,
EchomailListener::class, EchomailListener::class,
); );
// Custom Aliases
$loader = AliasLoader::getInstance();
$loader->alias('PageAssets',PageAssets::class);
Route::model('so',System::class);
} }
} }

View File

@ -5,6 +5,7 @@ namespace App\Providers;
use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
// @deprecated - now using pa()
class CustomBladeServiceProvider extends ServiceProvider class CustomBladeServiceProvider extends ServiceProvider
{ {
/** /**
@ -31,14 +32,6 @@ class CustomBladeServiceProvider extends ServiceProvider
'<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="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">'; '<link type="text/css" rel="stylesheet" href="'.asset('plugin/dataTables/dataTables.bootstrap5.css').'" media="screen">';
case 'select2':
return
'<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css">';
case 'simplemde':
return
'<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">';
default: default:
throw new \Exception('Unknown CSS: '.$expression); throw new \Exception('Unknown CSS: '.$expression);
} }
@ -62,15 +55,6 @@ class CustomBladeServiceProvider extends ServiceProvider
'<script type="text/javascript" src="https://code.highcharts.com/modules/export-data.js"></script>'. '<script type="text/javascript" src="https://code.highcharts.com/modules/export-data.js"></script>'.
'<script type="text/javascript" src="https://code.highcharts.com/themes/dark-unica.js"></script>'; '<script type="text/javascript" src="https://code.highcharts.com/themes/dark-unica.js"></script>';
case 'select2':
return
'<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>'.
'<script type="text/javascript" src="'.asset('plugin/select2/fix-autofocus.js').'"></script>';
case 'simplemde':
return
'<script type="text/javascript" src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>';
default: default:
throw new \Exception('Unknown JS: '.$expression); throw new \Exception('Unknown JS: '.$expression);
} }

34
public/css/fixes.css vendored
View File

@ -1,15 +1,27 @@
/* Fixes for select 2 and our theme */ /* Fixes for select 2 and our theme */
/* /* The opened input box */
.select2 .select2-container .select2-container--classic { width: 80% !important;} .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
*/ line-height: 1.0;
.select2-container .select2-selection--single { border-radius: 0 4px 4px 0; height: inherit;} border: 1px solid #aaa;
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 36px; } }
.select2-container--classic .select2-selection--single .select2-selection__arrow { line-height: 36px; }
.select2-results { color: #000; } .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option {
/* line-height: 1.2;
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable, padding: 0.3rem 0.2rem 0.3rem 0.4rem;
*/ font-size: 85%;
.select2-container--default .select2-results__option--selected { background-color: #024cc4; color: #eeeeee;} }
select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear, .select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear
{
width: 0.5rem;
height: 0.5rem;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered .select2-selection__placeholder
{
line-height: 1.0;
font-size: 90%;
}
/* Bootstrap 5 fixes */ /* Bootstrap 5 fixes */
/* select import, round the right side */ /* select import, round the right side */

View File

@ -0,0 +1,27 @@
<div class="form-group">
@if(isset($label))
<label {{ $attributes->only(['class'])->merge(['class'=>'form-label']) }} for="{{ $id ?? $name }}">{!! html_entity_decode($label) !!}</label>
@endisset
<div class="input-group has-validation">
@if(isset($icon) || isset($prepend))
{{-- // messes with the icon box, we have rounded corners on the right side
<div class="input-group-prepend">
--}}
<span class="input-group-text">@isset($icon)<i class="bi {{ $icon }}"></i>@endisset @isset($prepend){!! $prepend !!}@endisset</span>
{{--
</div>
--}}
@endif
{{ $slot }}
<span class="invalid-feedback">
@error((! empty($old)) ? $old : $name)
{{ $message }}
@elseif(isset($feedback))
{{ $feedback }}
@enderror
</span>
</div>
@isset($helper)
<span class="input-helper">{!! html_entity_decode($helper) !!}</span>
@endif
</div>

View File

@ -0,0 +1,61 @@
<x-form.base {{ $attributes }}>
<input type="hidden" id="{{ $name }}_disabled" name="{{ $name }}" value="" disabled>
<select style="width: 80%" class="form-select @error((! empty($old)) ? $old : $name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @required(isset($required) && $required) @disabled(isset($disabled) && $disabled)>
@if(empty($value) || isset($addnew) || isset($choose))
<option value=""></option>
@isset($addnew)
<option value="new">{{ $addnew ?: 'Add New' }}</option>
@endisset
@endif
@isset($options)
@empty($groupby)
@foreach($options as $option)
@continue(! Arr::get($option,'value'))
<option value="{{ Arr::get($option,'id') }}" @selected(Arr::get($option,'id') == old($old ?? $name,$value ?? ''))>{{ Arr::get($option,'value') }}</option>
@endforeach
@else
@foreach($options->groupBy($groupby) as $group)
<optgroup label="{{ $groupby == 'active' ? (Arr::get($group->first(),$groupby) ? 'Active' : 'Not Active') : Arr::get($group->first(),$groupby) }}">
@foreach($group as $option)
@continue(! Arr::get($option,'value'))
<option value="{{ Arr::get($option,'id') }}" @selected(Arr::get($option,'id') == old($old ?? $name,$value ?? ''))>{{ Arr::get($option,'value') }}</option>
@endforeach
</optgroup>
@endforeach
@endempty
@endisset
</select>
</x-form.base>
@pa(select2)
@section('page-scripts')
<script type="text/javascript">
// Select doesnt support read only so we'll use disable and a new field
function {{$id ?? $name}}_readonly(on) {
if (on) {
$('#{{ $name }}').prop('disabled',true);
$('#{{ $name }}_disabled').prop('disabled',false).val($('#{{ $name }}').val());
} else {
$('#{{ $name }}').prop('disabled',false);
$('#{{ $name }}_disabled').prop('disabled',true);
}
}
$(document).ready(function() {
$('#{{ $id ?? $name }}').select2({
theme: 'bootstrap-5',
dropdownAutoWidth: true,
width: 'style',
allowClear: true,
placeholder: '{{ $placeholder ?? '' }}',
@isset($addvalues)
tags: true,
@endisset
});
});
</script>
@append

View File

@ -1,5 +1,5 @@
@use(App\Models\Echoarea)
<!-- $o=Domain::class --> <!-- $o=Domain::class -->
@use(App\Models\Echoarea)
@extends('layouts.app') @extends('layouts.app')
@ -8,7 +8,7 @@
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -137,22 +137,12 @@
</div> </div>
<div class="col-4"> <div class="col-4">
@if ($o->isManaged()) @if ($o->isManaged())
<label for="nodestatus_id" class="form-label">Echoarea Node Status</label> @php
<div class="input-group has-validation"> $helper = (! $o->nodestatus_id)
<span class="input-group-text"><i class="bi bi-journal-text"></i></span> ? sprintf('Add a <a href="%s">NEW Echoarea</a>. This echoarea is used to send node status messages.',url('echoarea/addedit'))
<select style="width: 80%;" class="form-select @error('nodestatus_id') is-invalid @enderror" id="nodestatus_id" name="nodestatus_id" @cannot('admin',$o)disabled @endcannot> : sprintf('<a href="%s">Edit</a> Echoarea',url('echoarea/addedit',[$o->nodestatus_id]));
<option value="">&nbsp;</option> @endphp
@foreach (Echoarea::active()->where('domain_id',$o->id)->orderBy('description')->cursor() as $oo) <x-form.select name="nodestatus_id" icon="bi-journal-text" label="Echoarea Node Status" :helper="$helper" :value="$o->nodestatus_id" :options="Echoarea::select('id','description')->active()->where('domain_id',$o->id)->orderBy('description')->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->description])"/>
<option value="{{ $oo->id }}" @if(old('nodestatus_id',$o->nodestatus_id)==$oo->id)selected @endif>{{ $oo->description }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('nodestatus_id')
{{ $message }}
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('echoarea/addedit') }}">NEW Echoarea</a>. This echoarea is used to send node status messages.</span>
</div>
@endif @endif
</div> </div>
</div> </div>
@ -195,21 +185,10 @@
</form> </form>
@endsection @endsection
@section('page-css') @pa(simplemde)
@css('simplemde')
@css('select2')
@append
@section('page-scripts') @section('page-scripts')
@js('simplemde') <script type="text/javascript">
@js('select2') var simplemde = new SimpleMDE({ element: $("#homepage")[0] });
</script>
@can('admin',$o)
<script type="text/javascript">
var simplemde = new SimpleMDE({ element: $("#homepage")[0] });
$(document).ready(function() {
$('#nodestatus_id').select2();
});
</script>
@endcan
@append @append

View File

@ -1,3 +1,4 @@
<!-- $o=Echoarea::class -->
@use(App\Models\Domain) @use(App\Models\Domain)
@extends('layouts.app') @extends('layouts.app')
@ -7,7 +8,7 @@
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -17,24 +18,12 @@
<div class="row"> <div class="row">
<div class="col-3"> <div class="col-3">
<label for="domain" class="form-label">Domain</label> @php
<div class="input-group has-validation"> $helper = (! $o->domain_id)
<span class="input-group-text"><i class="bi bi-tag-fill"></i></span> ? sprintf('Add a <a href="%s">NEW Domain</a>',url('domain/addedit'))
<select class="form-select @error('domain_id') is-invalid @enderror" id="domain" name="domain_id" required @cannot('admin',$o)disabled @endcannot> : NULL;
<option value="">&nbsp;</option> @endphp
@foreach (Domain::active()->orderBy('name')->cursor() as $oo) <x-form.select name="domain_id" icon="bi-tag-fill" label="Domain" feedback="Domain is required" :helper="$helper" :value="$o->domain_id" :options="Domain::active()->orderBy('name')->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
<option value="{{ $oo->id }}" @if(old('domain_id',$o->domain_id)==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@else
A domain is required.
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('domain/addedit') }}">NEW Domain</a></span>
</div>
</div> </div>
<div class="col-3"> <div class="col-3">
@ -170,7 +159,7 @@
<div class="col-12"> <div class="col-12">
<h3>Exporting to the following adresses:</h3> <h3>Exporting to the following adresses:</h3>
<table class="table monotable" id="system"> <table class="table monotable" id="systems">
<thead> <thead>
<tr> <tr>
<th>System</th> <th>System</th>
@ -185,7 +174,7 @@
@foreach ($o->addresses as $ao) @foreach ($o->addresses as $ao)
<tr> <tr>
<td><a href="{{ url('system/addedit',[$ao->system_id]) }}">{{ $ao->system->full_name($ao) }}</a> @auth<span class="float-end"><small>@if($ao->is_hosted)<sup>{{ $ao->is_default ? '**' : '*' }}</sup>@elseif($ao->system->setup)<sup class="success">+</sup>@endif[{{ $ao->system_id }}]</small></span>@endauth</td> <td><a href="{{ url('system/addedit',[$ao->system_id]) }}">{{ $ao->system->full_name($ao) }}</a> @auth<span class="float-end"><small>@if($ao->is_hosted)<sup>{{ $ao->is_default ? '**' : '*' }}</sup>@elseif($ao->system->setup)<sup class="success">+</sup>@endif[{{ $ao->system_id }}]</small></span>@endauth</td>
<td>{{ $ao->ftn_3d }}</td> <td>{{ $ao->ftn4d }}</td>
<td>{{ $ao->system->last_seen?->format('Y-m-d H:i') ?: '-' }}</td> <td>{{ $ao->system->last_seen?->format('Y-m-d H:i') ?: '-' }}</td>
<td>{{ ($x=$o->waiting($ao))->count() ? $x->first()->datetime->format('Y-m-d H:i') : '-' }}</td> <td>{{ ($x=$o->waiting($ao))->count() ? $x->first()->datetime->format('Y-m-d H:i') : '-' }}</td>
<td class="text-end">{{ number_format($x->count()) }}</td> <td class="text-end">{{ number_format($x->count()) }}</td>
@ -198,4 +187,24 @@
@endif @endif
@endcan @endcan
</form> </form>
@endsection @endsection
@pa(datatables,conditionalpaging)
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
$('#systems').DataTable({
paging: true,
pageLength: 25,
searching: true,
ordering: true,
order: [1,'asc'],
conditionalPaging: {
style: 'fade',
speed: 500 // optional
},
});
});
</script>
@append

View File

@ -1,6 +1,7 @@
<!-- $o=Filearea::class --> <!-- $o=Filearea::class -->
@use(App\Models\Domain) @use(App\Models\Domain)
@use(App\Classes\FTN\Message) @use(App\Classes\FTN\Message)
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
@ -8,7 +9,7 @@
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -18,24 +19,12 @@
<div class="row"> <div class="row">
<div class="col-3"> <div class="col-3">
<label for="domain" class="form-label">Domain</label> @php
<div class="input-group has-validation"> $helper = (! $o->domain_id)
<span class="input-group-text"><i class="bi bi-tag-fill"></i></span> ? sprintf('Add a <a href="%s">NEW Domain</a>',url('domain/addedit'))
<select class="form-select @error('domain_id') is-invalid @enderror" id="domain" name="domain_id" required @cannot('admin',$o)disabled @endcannot> : NULL;
<option value="">&nbsp;</option> @endphp
@foreach (Domain::active()->orderBy('name')->cursor() as $oo) <x-form.select name="domain_id" icon="bi-tag-fill" label="Domain" feedback="Domain is required" :helper="$helper" :value="$o->domain_id" :options="Domain::active()->orderBy('name')->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
<option value="{{ $oo->id }}" @if(old('domain_id',$o->domain_id)==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@else
A domain is required.
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('domain/addedit') }}">NEW Domain</a></span>
</div>
</div> </div>
<div class="col-4"> <div class="col-4">
@ -157,6 +146,8 @@
</div> </div>
</div> </div>
<!-- @todo Show exported systems and files waiting -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
@if ($o->files->count()) @if ($o->files->count())
@ -191,13 +182,9 @@
</form> </form>
@endsection @endsection
@section('page-css') @pa(datatables,conditionalpaging)
@css('datatables')
@append
@section('page-scripts') @section('page-scripts')
@js('datatables')
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#files').DataTable({ $('#files').DataTable({

View File

@ -20,8 +20,6 @@
{{-- Scripts --}} {{-- Scripts --}}
@section('scripts') @section('scripts')
@include('layouts.partials.scripts') @include('layouts.partials.scripts')
@yield('page-scripts')
@show @show
</body> </body>
</html> </html>

View File

@ -10,11 +10,15 @@
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<!-- CSS only --> <!-- CSS only -->
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css"> <link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
<link type="text/css" rel="stylesheet" href="{{ url('oldschool/css/main.css') }}" media="screen"> <link type="text/css" rel="stylesheet" href="{{ url('oldschool/css/main.css') }}" media="screen">
<!-- Page Asset Styles -->
{!! PageAssets::css() !!}
<!-- Page Styles -->
@yield('page-css') @yield('page-css')
@if(file_exists('css/fixes.css')) @if(file_exists('css/fixes.css'))
@ -22,5 +26,6 @@
<link rel="stylesheet" href="{{ asset('css/fixes.css') }}"> <link rel="stylesheet" href="{{ asset('css/fixes.css') }}">
@endif @endif
<!-- Favicon -->
<link type="image/png" rel="icon" href="{{ asset('favicon.ico') }}"> <link type="image/png" rel="icon" href="{{ asset('favicon.ico') }}">
</head> </head>

View File

@ -3,7 +3,7 @@
<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 --> <!-- 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> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<!-- Additional Utilities --> <!-- Additional Utilities -->
<script src="{{ asset('plugin/bootstrap3-typeahead/bootstrap3-typeahead.min.js') }}"></script> <script src="{{ asset('plugin/bootstrap3-typeahead/bootstrap3-typeahead.min.js') }}"></script>
@ -36,4 +36,10 @@
}, false) }, false)
}); });
})() })()
</script> </script>
<!-- Page Script Assets -->
{!! PageAssets::js() !!}
<!-- Page Scripts -->
@yield('page-scripts')

View File

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

View File

@ -1,8 +1,8 @@
<!-- $o = Setup::class --> <!-- $o = Setup::class -->
@php @use(App\Classes\Protocol\Binkp)
use App\Models\Setup; @use(App\Classes\Protocol\EMSI)
use App\Classes\Protocol\{Binkp,EMSI,DNS}; @use(App\Models\Setup)
@endphp @use(App\Models\System)
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
@ -10,7 +10,7 @@ use App\Classes\Protocol\{Binkp,EMSI,DNS};
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -23,30 +23,12 @@ use App\Classes\Protocol\{Binkp,EMSI,DNS};
<div class="row"> <div class="row">
<!-- System --> <!-- System -->
<div class="col-4"> <div class="col-4">
<label for="system_id" class="form-label">System</label> @php
<div class="input-group has-validation"> $helper = (! $o->system_id)
<span class="input-group-text"><i class="bi bi-tag-fill"></i></span> ? sprintf('Add a <a href="%s">NEW System"</a>',url('system/addedit'))
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system_id" name="system_id" required @cannot('admin',$o)disabled @endcannot> : sprintf('<a href="%s">Edit</a> System',url('system/addedit',[$o->system_id]));
<option value="">&nbsp;</option> @endphp
@foreach (\App\Models\System::active()->cursor() as $oo) <x-form.select name="system_id" icon="bi-tag-fill" label="System" feedback="A system is required" placeholder="Select System" :helper="$helper" :value="$o->system_id" :options="System::select(['id','name'])->active()->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
<option value="{{ $oo->id }}" @if(old('system_id',$o->system_id)==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@else
A system is required.
@enderror
</span>
<span class="input-helper">
@if(! $o->system_id)
Add a <a href="{{ url('system/addedit') }}">NEW System</a>
@else
<a href="{{ url('system/addedit',[$o->system_id]) }}">Edit</a> System
@endif
</span>
</div>
</div> </div>
<!-- System Addresses --> <!-- System Addresses -->
@ -301,23 +283,9 @@ use App\Classes\Protocol\{Binkp,EMSI,DNS};
@endsection @endsection
@section('page-css') @section('page-css')
@css('select2')
<style> <style>
#content h3 { #content h3 {
margin-bottom: 5px; margin-bottom: 5px;
} }
#content ul li:last-child {
margin-bottom: inherit;
}
</style> </style>
@append
@section('page-scripts')
@js('select2')
<script type="text/javascript">
$(document).ready(function() {
$('#system_id').select2();
});
</script>
@append @append

View File

@ -1,8 +1,8 @@
<!-- $o=System::class -->
@use(App\Models\Address) @use(App\Models\Address)
@use(App\Models\Echomail) @use(App\Models\Echomail)
@use(App\Models\File) @use(App\Models\File)
@use(App\Models\Netmail) @use(App\Models\Netmail)
<!-- $o=System::class -->
@extends('layouts.app') @extends('layouts.app')
@ -142,10 +142,10 @@
<a href="{{ url('system/address/sus',[$oo->id]) }}" title="@if($oo->active)Pause @else Activate @endif Address"><i class="bi @if($oo->active)bi-pause-circle @else bi-play-circle @endif"></i></a> <a href="{{ url('system/address/sus',[$oo->id]) }}" title="@if($oo->active)Pause @else Activate @endif Address"><i class="bi @if($oo->active)bi-pause-circle @else bi-play-circle @endif"></i></a>
<a href="{{ url('system/address/mov',[$o->id,$oo->id]) }}" title="Move Address to another System"><i class="bi bi-arrow-right-square"></i></a> <a href="{{ url('system/address/mov',[$o->id,$oo->id]) }}" title="Move Address to another System"><i class="bi bi-arrow-right-square"></i></a>
<a href="{{ url('system/address/del',[$oo->id]) }}" title="Delete Address"><i class="bi bi-trash"></i></a> <a href="{{ url('system/address/del',[$oo->id]) }}" title="Delete Address"><i class="bi bi-trash"></i></a>
@if ((Address::NODE_HC|Address::NODE_NN) & $oo->role_id) @if ($oo->role_id === Address::NODE_NN)
<a href="{{ url('system/address/pro',[$oo->id]) }}" title="Promote Address"><i class="bi bi-arrow-up-square"></i></a> <a href="{{ url('system/address/pro',[$oo->id]) }}" title="Promote Address"><i class="bi bi-arrow-up-square"></i></a>
@endif @endif
@if ((Address::NODE_NC|Address::NODE_HC) & $oo->role_id) @if ($oo->role_id === Address::NODE_HC)
<a href="{{ url('system/address/dem',[$oo->id]) }}" title="Demote Address"><i class="bi bi-arrow-down-square"></i></a> <a href="{{ url('system/address/dem',[$oo->id]) }}" title="Demote Address"><i class="bi bi-arrow-down-square"></i></a>
@endif @endif
@endif @endif
@ -617,39 +617,47 @@
@section('page-scripts') @section('page-scripts')
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
@can('admin') if (window.location.hash) {
$('.default').click(function () { $('#collapse_'+window.location.hash.substring(1)).show();
var item = this; $('#collapse_system').collapse()
icon = $(item).find('i'); }
$.ajax({ @if($o->exists)
type: 'POST', @can('admin')
data: {sid: {{$o->id}}, _token: '{{csrf_token()}}', set: (icon.hasClass('bi-square') ? 1 : 0)}, $('.default').click(function () {
beforeSend: function () { var item = this;
$(item).find('i').addClass('spinner-grow spinner-grow-sm'); icon = $(item).find('i');
},
success: function () {
if (icon.hasClass('bi-square')) {
icon.removeClass('bi-square');
icon.addClass('bi-check-square');
} else {
icon.removeClass('bi-check-square');
icon.addClass('bi-square');
}
$(item).find('i').removeClass('spinner-grow spinner-grow-sm'); $.ajax({
}, type: 'POST',
error: function (e) { data: {sid: {{$o->id}}, _token: '{{csrf_token()}}', set: (icon.hasClass('bi-square') ? 1 : 0)},
$(item).find('i').removeClass('spinner-grow spinner-grow-sm'); beforeSend: function () {
$(item).find('i').addClass('spinner-grow spinner-grow-sm');
},
success: function () {
if (icon.hasClass('bi-square')) {
icon.removeClass('bi-square');
icon.addClass('bi-check-square');
} else {
icon.removeClass('bi-check-square');
icon.addClass('bi-square');
}
$(item).find('i').removeClass('spinner-grow spinner-grow-sm');
},
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,
cache: false
})
});
@endcan
@endif
if (e.status != 412)
alert('That didnt work? Please try again....');
},
url: '{{ url('zone/api/default') }}/' + item.attributes.itemid.nodeValue,
cache: false
})
});
@endcan
$('data.validated').on('click',function(item) { $('data.validated').on('click',function(item) {
that = $(this); that = $(this);
var values = item.delegateTarget.value.split(':'); var values = item.delegateTarget.value.split(':');

View File

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

View File

@ -1,3 +1,5 @@
<!-- $ao=Address::class -->
<!-- $o=System::class -->
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
@ -13,74 +15,38 @@
@includeWhen(session()->has('success'),'widgets.success',['msg'=>session()->get('success')]) @includeWhen(session()->has('success'),'widgets.success',['msg'=>session()->get('success')])
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row pt-0"> <div class="row pt-0">
<div class="col-2"> <div class="col-2">
<label for="to" class="form-label">To</label> <x-form.select name="to" icon="bi-robot" label="To" feedback="To name required" :value="($x=collect(config('fido.areafilefix')))->first()" :options="$x->map(fn($item)=>['id'=>$item,'value'=>$item])" required/>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-ui-radios"></i></span>
<select class="form-select @error('to') is-invalid @enderror" id="to" name="to">
@foreach (config('fido.areafilefix') as $name)
<option value="{{ $name }}" @if(old('to' === $name ))selected @endif>{{ $name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('to')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
<div class="offset-2 col-3"> <div class="offset-2 col-3">
<label for="tftn_id" class="form-label">Address</label> <x-form.select name="tftn_id" icon="bi-ui-radios" label="Uplink Address" feedback="Uplink address required" :value="($x=collect(config('fido.areafilefix')))->first()" :options="$o->akas->where('zone_id',$zo->id)->map(fn($item)=>['id'=>$item->id,'value'=>$item->ftn])" required/>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-ui-radios"></i></span>
<select class="form-select @error('tftn_id') is-invalid @enderror" id="tftn_id" name="tftn_id">
@foreach ($o->akas->where('zone_id',$zo->id) as $ao)
<option value="{{ $ao->id }}" @if(old('tftn_id' === $ao->id))selected @endif>{{ $ao->ftn }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('tftn_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<!-- SUBJECT -->
<div class="col-3"> <div class="col-3">
<label for="subject" class="form-label">Subject</label> <label for="subject" class="form-label">Subject</label>
<div class="input-group"> <div class="input-group has-validation">
<span class="input-group-text @error('subject') is-invalid @enderror"><i class="bi bi-wifi"></i></span> <span class="input-group-text @error('subject') is-invalid @enderror"><i class="bi bi-pass"></i></span>
<input type="text" class="form-control" id="subject" placeholder="Areafix Password" name="subject" value="{{ old('subject',$ao->pass_fix) }}"> <input type="text" class="form-control" id="subject" placeholder="Areafix Password" name="subject" value="{{ old('subject',$ao->pass_fix) }}" required>
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('subject') @error('subject')
{{ $message }} {{ $message }}
@else
Area/filefix password is required
@enderror @enderror
</span> </span>
</div> </div>
</div> </div>
<div class="offset-1 col-3"> <div class="offset-1 col-3">
<label for="fftn_id" class="form-label">From</label> <x-form.select name="fftn_id" icon="bi-ui-radios" label="Our address" feedback="Our address required" :value="$ao->id" :options="$setup->system->akas->where('zone_id',$zo->id)->map(fn($item)=>['id'=>$item->id,'value'=>$item->ftn])" required/>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-ui-radios"></i></span>
<select class="form-select @error('fftn_id') is-invalid @enderror" id="fftn_id" name="fftn_id">
@foreach ($setup->system->akas->where('zone_id',$zo->id) as $ao)
<option value="{{ $ao->id }}" @if(old('fftn_id' === $ao->id))selected @endif>{{ $ao->ftn }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('fftn_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
</div> </div>
@ -88,10 +54,12 @@
<!-- Message --> <!-- Message -->
<div class="col-12"> <div class="col-12">
<label for="msg" class="form-label">Message</label> <label for="msg" class="form-label">Message</label>
<textarea class="form-control @error('msg') is-invalid @enderror" rows=10 name="msg" placeholder="Message...">{{ old('msg') }}</textarea> <textarea class="form-control @error('msg') is-invalid @enderror" rows=10 name="msg" placeholder="Message..." required>{{ old('msg') }}</textarea>
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('msg') @error('msg')
{{ $message }} {{ $message }}
@else
Area/filefix commands are required
@enderror @enderror
</span> </span>
</div> </div>
@ -103,14 +71,4 @@
</div> </div>
</div> </div>
</form> </form>
@endsection @endsection
@section('page-css')
@append
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
});
</script>
@append

View File

@ -1,3 +1,6 @@
<!-- $o=Address::class -->
@use(App\Models\System)
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
@ -5,7 +8,7 @@ Move Address
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -22,26 +25,11 @@ Move Address
<div class="row"> <div class="row">
<!-- Choose System --> <!-- Choose System -->
<div class="col-4"> <div class="col-4">
<label for="system_id" class="form-label">Move <strong class="highlight">{{ $o->ftn }}</strong> to system:</label> @php
<div class="input-group has-validation"> $helper = sprintf('Add a <a href="%s">NEW System</a>',url('system/addedit'));
<span class="input-group-text"><i class="bi bi-display-fill"></i></span> $label = sprintf('Move <strong class="highlight">%s</strong> to system',$o->ftn);
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system_id" name="system_id" required @cannot('admin',$o)disabled @endcannot> @endphp
<option value="">&nbsp;</option> <x-form.select name="system_id" icon="bi-envelope-at-fill" :label="$label" placeholder="Select System" feedback="System is required" :helper="$helper" :value="$o->system_id" :options="System::select(['id','name'])->active()->where('id','<>',$o->system_id)->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
@foreach (\App\Models\System::active()->where('id','<>',$o->system_id)->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('system_id')==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@else
Please select the System that should have the address.
@enderror
</span>
<span class="input-helper">
Add a <a href="{{ url('system/addedit') }}">NEW System</a>
</span>
</div>
</div> </div>
<div class="col-3"> <div class="col-3">
@ -109,16 +97,9 @@ Move Address
</form> </form>
@endsection @endsection
@section('page-css')
@css('select2')
@append
@section('page-scripts') @section('page-scripts')
@js('select2')
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#system_id').select2();
@if ($o->is_hosted) @if ($o->is_hosted)
$('#remove_yes').on('change',function() { $('#remove_yes').on('change',function() {
if (! $('#session-remove').hasClass('d-none')) if (! $('#session-remove').hasClass('d-none'))

View File

@ -1,4 +1,6 @@
<form class="needs-validation" method="post" action="{{ url('system/address/add',$o->id) }}" novalidate> @use(App\Models\Zone)
<form class="needs-validation" method="post" action="{{ url('system/address/add',$o->id) }}" autocomplete="off" novalidate>
@csrf @csrf
<input type="hidden" id="action" name="action" value=""> <input type="hidden" id="action" name="action" value="">
@ -8,70 +10,22 @@
<div class="row"> <div class="row">
<!-- Select Zone --> <!-- Select Zone -->
<div class="col-3"> <div class="col-3">
<label for="zone_id" class="form-label">Zone</label> <x-form.select name="zone_id" icon="bi-hash" label="Zone" :options="Zone::select(['id','zone_id','domain_id'])->active()->domainZoneOrder()->with(['domain'])->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>sprintf('%d [%s]',$item->zone_id,$item->domain->name)])" required/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('zone_id') is-invalid @enderror" id="zone_id" name="zone_id" required>
<option></option>
@foreach(\App\Models\Zone::active()->domainZoneOrder()->with(['domain'])->get() as $zo)
<option value="{{ $zo->id }}">{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('zone_id')
{{ $message }}
@else
Please select the Zone for the node's address.
@enderror
</span>
</div>
</div> </div>
<!-- Select Region --> <!-- Select Region -->
<div class="col-3 d-none" id="region-select"> <div class="col-3 d-none" id="region-select">
<label for="region_id" class="form-label">Region</label> <x-form.select name="region_id" icon="bi-geo" label="Region" required/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-geo"></i></span>
<select class="form-select @error('region_id') is-invalid @enderror" id="region_id" name="region_id" required>
</select>
<span class="invalid-feedback" role="alert">
@error('region_id')
{{ $message }}
@else
Please make a choice.
@enderror
</span>
</div>
</div> </div>
<!-- Select Host --> <!-- Select Host -->
<div class="col-3 d-none" id="host-select"> <div class="col-3 d-none" id="host-select">
<label for="host_id" class="form-label">Host</label> <x-form.select name="host_id" icon="bi-diagram-3-fill" label="Host"/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-diagram-3-fill"></i></span>
<select class="form-select @error('host_id') is-invalid @enderror" id="host_id" name="host_id">
</select>
<span class="invalid-feedback" role="alert">
@error('host_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
<!-- Select Hub --> <!-- Select Hub -->
<div class="col-3 d-none" id="hub-select"> <div class="col-3 d-none" id="hub-select">
<label for="hub_id" class="form-label">Hub</label> <x-form.select name="hub_id" icon="bi-diagram-2-fill" label="Hub"/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-diagram-2-fill"></i></span>
<select class="form-select @error('hub_id') is-invalid @enderror" id="hub_id" name="hub_id">
</select>
<span class="invalid-feedback" role="alert">
@error('hub_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
</div> </div>
@ -81,9 +35,9 @@
<label for="node_id" class="form-label">Node/Point Address</label> <label for="node_id" class="form-label">Node/Point Address</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span> <span class="input-group-text"><i class="bi bi-hash"></i></span>
<input type="text" style="width: 35%;" class="form-control text-end @error('node_id') is-invalid @enderror" id="node_id" placeholder="Node" name="node_id" value="{{ old('node_id',$o->node_id) }}" @cannot('admin',$o)disabled @endcannot> <input type="text" style="width: 35%;" class="form-control text-end @error('node_id') is-invalid @enderror" id="node_id" placeholder="Node" name="node_id" value="{{ old('node_id',$o->node_id) }}" @cannot('admin',$o)disabled @endcannot data-1p-ignore>
<span class="input-group-text p-0">.</span> <span class="input-group-text p-0">.</span>
<input type="text" class="form-control @error('point_id') is-invalid @enderror" id="point_id" placeholder="0" name="point_id" value="{{ old('point_id',$o->point_id) ?: 0 }}" @cannot('admin',$o)disabled @endcannot style="padding-left: 0;"> <input type="text" class="form-control pl-0 @error('point_id') is-invalid @enderror" id="point_id" placeholder="0" name="point_id" value="{{ old('point_id',$o->point_id) ?: 0 }}" @cannot('admin',$o)disabled @endcannot>
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('node_id') @error('node_id')
{{ $message }} {{ $message }}
@ -100,7 +54,7 @@
<label for="region_id_new" class="form-label">Region Address</label> <label for="region_id_new" class="form-label">Region Address</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span> <span class="input-group-text"><i class="bi bi-hash"></i></span>
<input type="text" style="width: 35%;" class="form-control @error('region_id_new') is-invalid @enderror" id="region_id_new" placeholder="Region #" name="region_id_new" value="{{ old('region_id_new') }}" @cannot('admin',$o)disabled @endcannot> <input type="text" style="width: 35%;" class="form-control @error('region_id_new') is-invalid @enderror" id="region_id_new" placeholder="Region #" name="region_id_new" value="{{ old('region_id_new') }}" @cannot('admin',$o)disabled @endcannot data-1p-ignore>
<span class="input-group-text">/0.0</span> <span class="input-group-text">/0.0</span>
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('region_id_new') @error('region_id_new')
@ -117,7 +71,7 @@
<label for="host_id_new" class="form-label">Host Address</label> <label for="host_id_new" class="form-label">Host Address</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span> <span class="input-group-text"><i class="bi bi-hash"></i></span>
<input type="text" class="form-control text-end @error('host_id_new') is-invalid @enderror" id="host_id_new" placeholder="Host #" name="host_id_new" value="{{ old('host_id_new') }}" @cannot('admin',$o)disabled @endcannot> <input type="text" class="form-control text-end @error('host_id_new') is-invalid @enderror" id="host_id_new" placeholder="Host #" name="host_id_new" value="{{ old('host_id_new') }}" @cannot('admin',$o)disabled @endcannot data-1p-ignore>
<span class="input-group-text">/0.0</span> <span class="input-group-text">/0.0</span>
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('host_id_new') @error('host_id_new')
@ -246,6 +200,9 @@
if (! $('#sec-level').hasClass('d-none')) if (! $('#sec-level').hasClass('d-none'))
$('#sec-level').addClass('d-none') $('#sec-level').addClass('d-none')
if (! this.value)
return false;
var icon = $(this).parent().find('i'); var icon = $(this).parent().find('i');
icon.addClass('spinner-grow spinner-grow-sm'); icon.addClass('spinner-grow spinner-grow-sm');

View File

@ -1,4 +1,4 @@
<form class="needs-validation" method="post" action="{{ url('system/echoarea',$o->id) }}" novalidate> <form class="needs-validation" method="post" action="{{ url('system/echoarea',$o->id) }}" autocomplete="off" novalidate>
@csrf @csrf
<div class="row pt-0"> <div class="row pt-0">
@ -7,33 +7,13 @@
<div class="row"> <div class="row">
<!-- Select Domain --> <!-- Select Domain -->
<div class="col-3"> <div class="col-3">
<label for="echoarea_domain_id" class="form-label">Network</label> <x-form.select id="echoarea_domain_id" name="domain_id" icon="bi-hash" label="Network" :options="$o->sessions->map(fn($item)=>['id'=>$item->domain_id,'value'=>sprintf('%s (%s)',$item->zone_id,$item->domain->name)])"/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="echoarea_domain_id" name="domain_id" required>
<option></option>
@foreach($o->sessions as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
<!-- Select Address --> <!-- Select Address -->
<div class="col-3"> <div class="col-3">
<div class="d-none" id="echoarea_address-select"> <div class="d-none" id="echoarea_address-select">
<label for="echoarea_address_id" class="form-label">Address</label> <x-form.select id="echoarea_address_id" name="address_id" icon="bi-hash" label="Address"/>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select" id="echoarea_address_id" name="address_id" required>
<option></option>
</select>
</div>
</div> </div>
</div> </div>
@ -86,10 +66,15 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#echoarea_domain_id').on('change',function() { $('#echoarea_domain_id').on('change',function() {
if (! $('#echoarea-select').hasClass('d-none'))
$('#echoarea-select').addClass('d-none');
if (! $(this).val()) { if (! $(this).val()) {
$('#echoarea-summary').removeClass('d-none'); $('#echoarea-summary').removeClass('d-none');
$('#echoarea_address-select').addClass('d-none'); $('#echoarea_address-select').addClass('d-none');
return; return;
} else { } else {
$('#echoarea_address-select').removeClass('d-none'); $('#echoarea_address-select').removeClass('d-none');
} }

View File

@ -1,4 +1,4 @@
<form class="needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" novalidate> <form class="needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" autocomplete="off" novalidate>
@csrf @csrf
<div class="row pt-0"> <div class="row pt-0">
@ -7,33 +7,13 @@
<div class="row"> <div class="row">
<!-- Select Domain --> <!-- Select Domain -->
<div class="col-3"> <div class="col-3">
<label for="domain_id" class="form-label">Network</label> <x-form.select id="filearea_domain_id" name="domain_id" icon="bi-hash" label="Network" :options="$o->sessions->map(fn($item)=>['id'=>$item->domain_id,'value'=>sprintf('%s (%s)',$item->zone_id,$item->domain->name)])"/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="filearea_domain_id" name="domain_id" required>
<option></option>
@foreach($o->sessions as $zo)
<option value="{{ $zo->domain_id }}" @if(old('domain_id') == $zo->domain_id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
<!-- Select Address --> <!-- Select Address -->
<div class="col-3"> <div class="col-3">
<div class="d-none" id="filearea_address-select"> <div class="d-none" id="filearea_address-select">
<label for="filearea_address_id" class="form-label">Address</label> <x-form.select id="filearea_address_id" name="address_id" icon="bi-hash" label="Address"/>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select" id="filearea_address_id" name="address_id" required>
<option></option>
</select>
</div>
</div> </div>
</div> </div>
@ -73,10 +53,16 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#filearea_domain_id').on('change',function() { $('#filearea_domain_id').on('change',function() {
console.log('closing filearea-select');
if (! $('#filearea-select').hasClass('d-none'))
$('#filearea-select').addClass('d-none');
if (! $(this).val()) { if (! $(this).val()) {
$('#filearea-summary').removeClass('d-none'); $('#filearea-summary').removeClass('d-none');
$('#filearea_address-select').addClass('d-none'); $('#filearea_address-select').addClass('d-none');
return; return;
} else { } else {
$('#filearea_address-select').removeClass('d-none'); $('#filearea_address-select').removeClass('d-none');
} }

View File

@ -1,15 +1,14 @@
<!-- $o = System::class --> <!-- $o = System::class -->
@php @use(App\Models\Zone)
use App\Models\Zone;
@endphp
@if(($x=Zone::active() @if(($zones=Zone::select(['id','domain_id','zone_id'])
->active()
->whereIn('id',$o->addresses->pluck('zone.id')) ->whereIn('id',$o->addresses->pluck('zone.id'))
->whereNotIn('id',$o->sessions->pluck('id')) ->whereNotIn('id',$o->sessions->pluck('id'))
->with(['domain']) ->with(['domain'])
->get())->count()) ->get())->count())
<form class="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) }}" autocomplete="off" novalidate>
@csrf @csrf
<div class="row pt-0"> <div class="row pt-0">
@ -20,29 +19,13 @@ use App\Models\Zone;
<div class="row"> <div class="row">
<!-- Select Zone --> <!-- Select Zone -->
<div class="col-3"> <div class="col-3">
<label for="szone_id" class="form-label">Zone</label> <x-form.select id="szone_id" name="zone_id" icon="bi-hash" label="Zone" feedback="Our address required" value="x" :options="$zones->map(fn($item)=>['id'=>$item->id,'value'=>sprintf('%s (%s)',$item->zone_id,$item->domain->name)])" required/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<select class="form-select @error('zone_id') is-invalid @enderror" id="szone_id" name="zone_id" required>
<option></option>
@foreach($x as $zo)
<option value="{{ $zo->id }}" @if(old('zone_id') == $zo->id)selected @endif>{{ $zo->zone_id }} <small>({{ $zo->domain->name }})</small></option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('zone_id')
{{ $message }}
@else
Please select the Zone for the node's address.
@enderror
</span>
</div>
</div> </div>
<div class="col-9"> <div class="col-9">
<div class="row pt-0"> <div class="row pt-0">
<!-- Session -->
<div class="col-6"> <div class="col-6">
<!-- Session -->
<label for="sespass" class="form-label">Session Password</label> <label for="sespass" class="form-label">Session Password</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-lock"></i></span> <span class="input-group-text"><i class="bi bi-lock"></i></span>
@ -57,8 +40,8 @@ use App\Models\Zone;
</div> </div>
</div> </div>
<!-- Packet -->
<div class="col-5"> <div class="col-5">
<!-- Packet -->
<label for="pktpass" class="form-label">Packet Password</label> <label for="pktpass" class="form-label">Packet Password</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-box"></i></span> <span class="input-group-text"><i class="bi bi-box"></i></span>
@ -75,8 +58,8 @@ use App\Models\Zone;
</div> </div>
<div class="row"> <div class="row">
<!-- Areafix -->
<div class="col-6"> <div class="col-6">
<!-- Session -->
<label for="fixpass" class="form-label">Areafix Password</label> <label for="fixpass" class="form-label">Areafix Password</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-card-text"></i></span> <span class="input-group-text"><i class="bi bi-card-text"></i></span>
@ -91,8 +74,8 @@ use App\Models\Zone;
</div> </div>
</div> </div>
<!-- TIC -->
<div class="col-5"> <div class="col-5">
<!-- Packet -->
<label for="ticpass" class="form-label">TIC Password</label> <label for="ticpass" class="form-label">TIC Password</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-archive"></i></span> <span class="input-group-text"><i class="bi bi-archive"></i></span>

View File

@ -1,5 +1,5 @@
<!-- $o=System::class --> <!-- $o=System::class -->
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<input type="hidden" name="system_id" value="{{ $o->id }}"> <input type="hidden" name="system_id" value="{{ $o->id }}">

View File

@ -1,13 +1,15 @@
<!-- $o=System::class -->
@use(Carbon\Carbon) @use(Carbon\Carbon)
@use(Carbon\CarbonInterface) @use(Carbon\CarbonInterface)
@use(Illuminate\Support\Facades\Gate)
@use(App\Classes\FTN\Packet) @use(App\Classes\FTN\Packet)
@use(App\Models\Mailer) @use(App\Models\Mailer)
@use(App\Models\User) @use(App\Models\User)
<!-- $o=System::class -->
<div class="row"> <div class="row">
<div class="col-xl-9 col-12"> <div class="col-xl-9 col-12">
@can('admin',$o) <div class="row pt-0">
<div class="row pt-0"> @can('admin')
<div class="col-12"> <div class="col-12">
<h4 class="mb-0 pb-2">System Users</h4> <h4 class="mb-0 pb-2">System Users</h4>
@ -19,7 +21,7 @@
<span class="input-group-text"><i class="bi bi-people-fill"></i></span> <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[]"> <select style="width: 80%;" class="form-select @error('users') is-invalid @enderror" id="users" name="users[]">
<option value="">&nbsp;</option> <option value="">&nbsp;</option>
@foreach (User::orderBy('name')->active()->get() as $uo) @foreach (User::select(['id','name','email'])->orderBy('name')->active()->get() as $uo)
<option value="{{ $uo->id }}" @selected(in_array($uo->id,old('users',$o->users->pluck('id')->toArray())))>{{ $uo->name }} <small>({{ $uo->email }})</small></option> <option value="{{ $uo->id }}" @selected(in_array($uo->id,old('users',$o->users->pluck('id')->toArray())))>{{ $uo->name }} <small>({{ $uo->email }})</small></option>
@endforeach @endforeach
</select> </select>
@ -33,10 +35,10 @@
</div> </div>
</div> </div>
</div> </div>
</div> @endcan
@endcan </div>
<div class="row pt-4"> <div class="row @can('admin')pt-4 @else pt-0 @endcannot">
<div class="col-12"> <div class="col-12">
<h4 class="mb-0 pb-2">System Details</h4> <h4 class="mb-0 pb-2">System Details</h4>
@ -46,9 +48,7 @@
<label for="name" class="form-label">BBS Name</label> <label for="name" class="form-label">BBS Name</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-pc"></i></span> <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($action,$o)readonly @endcannot autofocus> <input type="text" class="form-control @error('name') is-invalid @enderror" id="name" placeholder="Name" name="name" value="{{ old('name',$o->name) }}" required @cannot($action,$o)readonly @endcannot autofocus autocomplete="off" data-1p-ignore>
<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"> <span class="invalid-feedback" role="alert">
@error('name') @error('name')
{{ $message }} {{ $message }}
@ -116,7 +116,7 @@
<label for="address" class="form-label">Mailer Internet Hostname</label> <label for="address" class="form-label">Mailer Internet Hostname</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-globe"></i></span> <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> <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 data-1p-ignore>
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('address') @error('address')
{{ $message }} {{ $message }}
@ -174,20 +174,7 @@
<!-- Mail Packet --> <!-- Mail Packet -->
<div class="col-4"> <div class="col-4">
<label for="pkt_type" class="form-label">Mail Packet</label> <x-form.select name="pkt_type" icon="bi-ui-radios" label="Mail Packet" feedback="Set a packet type" :value="$o->pkt_type ?: config('fido.packet_default')" :options="collect(Packet::PACKET_TYPES)->map(fn($item,$key)=>['id'=>$key,'value'=>$key])" required :disabled="Gate::denies('update_nn',$o)"/>
<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)disabled @endcannot>
@foreach (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>
<!-- Packet Msgs --> <!-- Packet Msgs -->
@ -214,17 +201,9 @@
<div class="row pt-0"> <div class="row pt-0">
<div class="col-4"> <div class="col-4">
<label for="method" class="form-label">Connection Method</label> <x-form.select name="method" icon="bi-wifi" label="Connection Method" :value="$o->method" :options="collect([['id'=>23,'value'=>'Telnet'],['id'=>22,'value'=>'SSH'],['id'=>519,'value'=>'Rlogin']])" :disabled="Gate::denies('update_nn',$o)"/>
<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)disabled @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>
<div class="col-3"> <div class="col-3">
<label for="method" class="form-label">Port</label> <label for="method" class="form-label">Port</label>
<div class="input-group"> <div class="input-group">
@ -303,28 +282,30 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="row p-0"> <div class="row p-0">
@can('update_nn',$o) @if($o->exists)
<div class="col-6"> @can('update_nn',$o)
<label for="autohold" class="form-label">Auto Hold</label> <div class="col-6">
<div class="input-group"> <label for="autohold" class="form-label">Auto Hold</label>
<button id="autohold" @class(['btn','btn-warning'=>$o->autohold,'btn-outline-success'=>(! $o->autohold)])><i @class(['bi-toggle-on'=>$o->autohold,'bi-toggle-off'=>(! $o->autohold)])></i></button> <div class="input-group">
<button id="autohold" @class(['btn','btn-warning'=>$o->autohold,'btn-outline-success'=>(! $o->autohold)])><i @class(['bi-toggle-on'=>$o->autohold,'bi-toggle-off'=>(! $o->autohold)])></i></button>
</div>
</div> </div>
</div>
<!-- @todo This is only relevant for uplinks, so hide it if this system isnt an uplink --> <!-- @todo This is only relevant for uplinks, so hide it if this system isnt an uplink -->
<div class="col-6 @if((old('pollmode') === "0") || is_null($o->pollmode))d-none @endif" id="heartbeat_option"> <div class="col-6 @if((old('pollmode') === "0") || is_null($o->pollmode))d-none @endif" id="heartbeat_option">
<label for="heartbeat" class="form-label">Heartbeat <i class="bi bi-info-circle" title="Attempt contact after last seen"></i></label> <label for="heartbeat" class="form-label">Heartbeat <i class="bi bi-info-circle" title="Attempt contact after last seen"></i></label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hourglass-bottom"></i></span> <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="Hrs" name="heartbeat" value="{{ old('heartbeat',$o->heartbeat) }}"> <input type="text" class="form-control text-end @error('heartbeat') is-invalid @enderror" id="heartbeat" placeholder="Hrs" name="heartbeat" value="{{ old('heartbeat',$o->heartbeat) }}">
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@error('heartbeat') @error('heartbeat')
{{ $message }} {{ $message }}
@enderror @enderror
</span> </span>
</div>
</div> </div>
</div> @endcan
@endcan @endif
</div> </div>
@if(! is_null($o->pollmode)) @if(! is_null($o->pollmode))
@ -418,7 +399,7 @@
</div> </div>
</div> </div>
@can('admin',$o) @can('admin')
<div class="row"> <div class="row">
<!-- Notes --> <!-- Notes -->
<div class="col-12"> <div class="col-12">
@ -444,15 +425,15 @@
</div> </div>
</div> </div>
@section('page-css')
@css('select2')
@append
@section('page-scripts') @section('page-scripts')
@js('select2')
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#users').select2({ $('#users').select2({
theme: 'bootstrap-5',
dropdownAutoWidth: true,
width: 'style',
allowClear: true,
placeholder: '',
@cannot('admin')disabled: true @endcannot @cannot('admin')disabled: true @endcannot
/*multiple: true*/ /*multiple: true*/
}); });
@ -466,57 +447,59 @@
$('#poll_hold').on('click',function() { $('#poll_hold').on('click',function() {
$('#heartbeat_option').addClass('d-none'); $('#heartbeat_option').addClass('d-none');
}) })
$("#autohold").on('click',function(item) { @if($o->exists)
var that = $(this) $("#autohold").on('click',function(item) {
var icon = that.find('i'); var that = $(this)
var icon = that.find('i');
if (icon.hasClass('bi-toggle-on')) { if (icon.hasClass('bi-toggle-on')) {
$.ajax({ $.ajax({
url: '/system/api/autohold/off', url: '/system/api/autohold/off',
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
data : {id: {{ $o->id }}}, data : {id: {{ $o->id }}},
beforeSend: function() { beforeSend: function() {
icon.addClass('spinner-grow spinner-grow-sm') icon.addClass('spinner-grow spinner-grow-sm')
}, },
complete: function() { complete: function() {
icon.removeClass('spinner-grow spinner-grow-sm') icon.removeClass('spinner-grow spinner-grow-sm')
}, },
success: function(data) { success: function(data) {
icon.removeClass('bi-toggle-on') icon.removeClass('bi-toggle-on')
.addClass('bi-toggle-off') .addClass('bi-toggle-off')
that.removeClass('btn-warning') that.removeClass('btn-warning')
.addClass('btn-outline-success') .addClass('btn-outline-success')
}, },
cache: false cache: false
}); });
} else { } else {
$.ajax({ $.ajax({
url: '/system/api/autohold/on', url: '/system/api/autohold/on',
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
data : {id: {{ $o->id }}}, data : {id: {{ $o->id }}},
beforeSend: function() { beforeSend: function() {
icon.addClass('spinner-grow spinner-grow-sm') icon.addClass('spinner-grow spinner-grow-sm')
}, },
complete: function() { complete: function() {
icon.removeClass('spinner-grow spinner-grow-sm') icon.removeClass('spinner-grow spinner-grow-sm')
}, },
success: function(data) { success: function(data) {
icon.removeClass('bi-toggle-off') icon.removeClass('bi-toggle-off')
.addClass('bi-toggle-on'); .addClass('bi-toggle-on');
that.removeClass('btn-outline-success') that.removeClass('btn-outline-success')
.addClass('btn-warning') .addClass('btn-warning')
}, },
cache: false cache: false
}); });
} }
return false; return false;
}) })
@endif
}) })
</script> </script>
@append @append

View File

@ -6,7 +6,7 @@
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -48,21 +48,7 @@
<!-- Forward Netmail --> <!-- Forward Netmail -->
@can('admin',$o) @can('admin',$o)
<div class="col-4"> <div class="col-4">
<label for="system_id" class="form-label">Forward Netmails</label> <x-form.select name="system_id" icon="bi-envelope-at-fill" label="Forward Netmails" placeholder="Select System" :value="$o->system_id" :options="$o->systems->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])"/>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-envelope-at-fill"></i></span>
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system_id" name="system_id">
<option value="">&nbsp;</option>
@foreach ($o->systems as $oo)
<option value="{{ $oo->id }}" @if(old('system_id',$o->system_id)==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@enderror
</span>
</div>
</div> </div>
@endcan @endcan
</div> </div>
@ -195,8 +181,6 @@
@endsection @endsection
@section('page-css') @section('page-css')
@css('select2')
<style> <style>
#content h3 { #content h3 {
margin-bottom: 5px; margin-bottom: 5px;
@ -208,8 +192,6 @@
@append @append
@section('page-scripts') @section('page-scripts')
@js('select2')
<!-- Passkeys --> <!-- Passkeys -->
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script> <script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
@ -224,7 +206,6 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#system_id').select2();
$('#passkey').on('click',function(item) { $('#passkey').on('click',function(item) {
if (passkey_debug) if (passkey_debug)
console.log('Passkey: Create Click'); console.log('Passkey: Create Click');

View File

@ -1,14 +1,14 @@
@use(App\Models\Address)
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
Link Link
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<input type="hidden" id="address_id" name="address_id">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="greyframe titledbox shadow0xb0"> <div class="greyframe titledbox shadow0xb0">
@ -18,29 +18,16 @@
<div class="row"> <div class="row">
<!-- Name --> <!-- Name -->
<div class="col-5"> <div class="col-5">
<label for="system" class="form-label">BBS Name</label> @php
<div class="input-group has-validation"> $options = Address::select(['addresses.id','addresses.host_id','addresses.node_id','addresses.point_id','addresses.zone_id','systems.name'])
<span class="input-group-text"><i class="bi bi-laptop-fill"></i></span> ->active()
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system" name="address_id" required> ->join('systems',['systems.id'=>'addresses.system_id'])
<option value="">&nbsp;</option> ->whereRaw('systems.id NOT IN (SELECT system_id FROM "system_user")')
@foreach (\App\Models\Address::select(['addresses.id','addresses.host_id','addresses.node_id','addresses.point_id','addresses.zone_id','systems.name']) ->with(['system','zone'])
->active() ->orderBy('systems.name')
->join('systems',['systems.id'=>'addresses.system_id']) ->cursor()
->whereRaw('systems.id NOT IN (SELECT system_id FROM system_user)') @endphp
->with(['zone']) <x-form.select name="address_id" icon="bi-laptop-fill" label="BBS Address" placeholder="Find your AKA" feedback="AKA is required" helper="Enter your BBS name" value="" :options="$options->map(fn($item)=>['id'=>$item->id,'value'=>sprintf('%s (%s)',$item->name,$item->ftn3d)])" required/>
->orderBy('systems.name')
->get() as $oo)
<option value="{{ $oo->id }}" @if(old('id')===$oo->id)selected @endif>{{ $oo->name }} ({{ $oo->ftn3d }})</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@else
BBS Name is required.
@enderror
</span>
</div>
</div> </div>
</div> </div>
@ -72,18 +59,4 @@
</div> </div>
</div> </div>
</form> </form>
@endsection
@section('page-css')
@css('select2')
@append
@section('page-scripts')
@js('select2')
<script type="text/javascript">
$(document).ready(function() {
$('#system').select2({
placeholder: 'Find your Address',
});
});
</script>
@endsection @endsection

View File

@ -1,16 +1,15 @@
@use(App\Models\System)
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
Register System Register System
@endsection @endsection
@php
use App\Models\System;
@endphp
@section('content') @section('content')
<form class="needs-validation" method="post" autocomplete="off" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<input type="hidden" name="action" value="register">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
@ -21,33 +20,19 @@ use App\Models\System;
<div class="row"> <div class="row">
<!-- Name --> <!-- Name -->
<div class="col-4"> <div class="col-4">
<label for="system" class="form-label">BBS Name</label> @php($options = System::select(['systems.id','systems.name'])
<div class="input-group has-validation"> ->active()
<span class="input-group-text"><i class="bi bi-laptop-fill"></i></span> ->where('id','<>',$setup->system_id)
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system" name="id" required> ->whereRaw('id NOT IN (SELECT system_id FROM "system_user")')
<option value="">&nbsp;</option> ->cursor())
@foreach (System::select(['systems.id','systems.name'])
->active() <x-form.select name="system_id" icon="bi-laptop-fill" label="BBS Name" placeholder="See if your BBS exists, otherwise add it" feedback="BBS Name is required" helper="Enter your BBS name and press NEXT" :addvalues="true" :options="$options->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
->where('id','<>',$setup->system_id)
->whereRaw('id NOT IN (SELECT system_id FROM "system_user")')
->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('id')===$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@else
BBS Name is required.
@enderror
</span>
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 pb-2"> <div class="col-12 pb-2">
<button type="button" name="submit" class="btn btn-success">Next</button><span id="next" class="m-2"><i class="spinner-border spinner-border-sm text-light d-none"></i></span> <button type="submit" class="btn btn-success">Next</button><span id="next" class="m-2"><i class="spinner-border spinner-border-sm text-light d-none"></i></span>
</div> </div>
</div> </div>
</div> </div>
@ -55,118 +40,4 @@ use App\Models\System;
</div> </div>
</div> </div>
</form> </form>
@endsection
<div class="modal fade" id="no-auth" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-danger">
<h5 class="modal-title">ERROR: No authorisation</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>It appears that you are not allowed to create this entry.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@endsection
@section('page-css')
@css('select2')
@append
@section('page-scripts')
@js('select2')
<script type='text/javascript'>
$(document).ready(function() {
$('#system').select2({
placeholder: 'See if your BBS exists',
tags: true,
});
});
</script>
<script type='text/javascript'>
var system_id;
var noauth = new bootstrap.Modal(document.getElementById('no-auth'), {});
function validation(item,message) {
var attr = $('input[id='+item+']');
attr.addClass('is-invalid')
attr.parent().find('.invalid-feedback').empty().append(message);
}
/**
* We have selected a BBS from the link/register form, and it's either a new entry or an existing one
* @param icon
*/
function getform(icon) {
$.ajax({
url : '{{ url('user/system/register') }}',
type : 'POST',
data : { system_id: system_id,name: $('#system').val(),action: 'register',old: {!! json_encode(old()) !!} },
dataType : 'json',
async : true,
cache : false,
beforeSend : function() {
if (icon)
icon.toggleClass('d-none');
},
complete : function(data) {
switch (data.status) {
case 200:
// if json is null, means no match, won't do again.
if(data.responseText===null || (data.responseText.length===0)) return;
$('#create').empty().append(data.responseText);
@if($errors->count())
@foreach($errors->keys() as $key)
validation('{{ $key }}','{{ $errors->first($key) }}');
@endforeach
@endif
break;
case 403:
if (icon)
icon.toggleClass('d-none');
noauth.show();
break;
case 419:
location.reload();
break;
case 422:
validation('name',data.responseJSON.errors.name[0]);
if (icon)
icon.toggleClass('d-none');
break;
default:
return false;
}
}
})
}
if ({{ old('submit') === 'create' ? 'true' : 'false' }}) {
getform();
}
$(document).ready(function() {
$('button[name=submit]').on('click',function() {
icon = $(this).parent().find('i');
if (! $('#system').val())
return;
getform(icon);
})
});
</script>
@append

View File

@ -0,0 +1,57 @@
<!-- $so=System::class -->
@use(App\Models\System)
@extends('layouts.app')
@section('htmlheader_title')
Register System
@endsection
@section('content')
@if(! $so->address)
<h3 class="pt-2">Enable to complete registration</h3>
<p>The system you selected <strong class="highlight">{{ $so->name }}</strong> doesnt have mailer details, please contact that system administration to update those details first</p>
@else
<h3 class="pt-2">System Details:</h3>
<table class="monotable">
<tr>
<th>System</th>
<th>{{ $so->name }}</th>
</tr>
<tr>
<th>Sysop</th>
<th>{{ $so->sysop }}</th>
</tr>
<tr>
<th>Location</th>
<th>{{ $so->location }}</th>
</tr>
<tr>
<th>Networks</th>
<th>{{ $so->akas->pluck('ftn')->join(', ') }}</th>
</tr>
<tr>
<th>Address</th>
<th>{{ $so->access_mailer }}</th>
</tr>
</table>
<p>If the details are above are not correct, then please contact the (ZC) to have them corrected first.</p>
<p>Otherwise, if all is good, we'll send a netmail to <strong class="highlight">{{ $so->sysop }}</strong> at <strong class="highlight">{{ $so->access_mailer }}</strong></p> with further details.
<form class="needs-validation" method="post" autocomplete="off" action="{{ url('user/system/link') }}" novalidate>
@csrf
<input type="hidden" name="system_id" value="{{ $so->id }}">
<input type="hidden" name="name" value="{{ $so->name }}">
<div class="row pb-2">
<div class="col-12">
<input type="submit" name="action" class="btn btn-success" value="Link">
</div>
</div>
</form>
@endif
@endsection

View File

@ -1,41 +0,0 @@
<!-- $o = System::class -->
<h3>System Details:</h3>
<table class="monotable">
<tr>
<th>System</th>
<th>{{ $o->name }}</th>
</tr>
<tr>
<th>Sysop</th>
<th>{{ $o->sysop }}</th>
</tr>
<tr>
<th>Location</th>
<th>{{ $o->location }}</th>
</tr>
<tr>
<th>Networks</th>
<th>{{ $o->akas->pluck('ftn')->join(', ') }}</th>
</tr>
<tr>
<th>Address</th>
<th>{{ $o->access_mailer }}</th>
</tr>
</table>
<p>If the details are above are not correct, then please contact the (ZC) to have them corrected first.</p>
<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="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 pb-2">
<div class="col-12">
<input type="submit" name="action" class="btn btn-success" value="Link">
</div>
</div>
</form>

View File

@ -1,3 +1,7 @@
<!-- $o=Zone::class-->
@use(App\Models\Domain)
@use(App\Models\System)
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
@ -5,7 +9,7 @@
@endsection @endsection
@section('content') @section('content')
<form class="needs-validation" method="post" novalidate> <form class="needs-validation" method="post" autocomplete="off" novalidate>
@csrf @csrf
<div class="row"> <div class="row">
@ -30,24 +34,12 @@
</div> </div>
<div class="col-3"> <div class="col-3">
<label for="domain" class="form-label">Domain</label> @php
<div class="input-group has-validation"> $helper = (! $o->domain_id)
<span class="input-group-text"><i class="bi bi-tag-fill"></i></span> ? sprintf('Add a <a href="%s">NEW Domain</a>',url('domain/addedit'))
<select class="form-select @error('domain_id') is-invalid @enderror" id="domain" name="domain_id" required @cannot('admin',$o)disabled @endcannot> : sprintf('<a href="%s">Edit</a> Domain',url('domain/addedit',[$o->domain_id]));
<option value="">&nbsp;</option> @endphp
@foreach (\App\Models\Domain::active()->orderBy('name')->cursor() as $oo) <x-form.select name="domain_id" icon="bi-tag-fill" label="Domain" :helper="$helper" feedback="A domain is required" :value="$o->domain_id" :options="Domain::select(['id','name'])->active()->orderBy('name')->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
<option value="{{ $oo->id }}" @if(old('domain_id',$o->domain_id)==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('domain_id')
{{ $message }}
@else
A domain is required.
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('domain/addedit') }}">NEW Domain</a></span>
</div>
</div> </div>
<div class="offset-1 col-2"> <div class="offset-1 col-2">
@ -84,24 +76,12 @@
<div class="row"> <div class="row">
<div class="col-4"> <div class="col-4">
<label for="system" class="form-label">System</label> @php
<div class="input-group has-validation"> $helper = (! $o->system_id)
<span class="input-group-text"><i class="bi bi-laptop-fill"></i></span> ? sprintf('Add a <a href="%s">NEW System</a>',url('system/addedit'))
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system" name="system_id" required @cannot('admin',$o)disabled @endcannot> : sprintf('<a href="%s">Edit</a> System',url('system/addedit',[$o->system_id]));
<option value="">&nbsp;</option> @endphp
@foreach (\App\Models\System::active()->cursor() as $oo) <x-form.select name="system_id" icon="bi-laptop-fill" label="System" feedback="A system is required" :helper="sprintf('%s. This system is the primary mailer/tosser responsible for the zone.',$helper)" :value="$o->system_id" :options="System::select(['id','name'])->active()->orderBy('name')->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
<option value="{{ $oo->id }}" @if(old('system_id',$o->system_id)==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@else
A system is required.
@enderror
</span>
<span class="input-helper">Add a <a href="{{ url('system/addedit') }}">NEW System</a>. This system is the primary mailer/tosser responsible for managing the zone.</span>
</div>
</div> </div>
</div> </div>
@ -175,17 +155,4 @@
</div> </div>
</div> </div>
</form> </form>
@endsection @endsection
@section('page-css')
@css('select2')
@append
@section('page-scripts')
@js('select2')
<script type="text/javascript">
$(document).ready(function() {
$('#system').select2();
});
</script>
@append

View File

@ -135,7 +135,9 @@ Route::middleware(['auth','verified','activeuser'])->group(function () {
Route::view('user/system/register','user.system.register'); Route::view('user/system/register','user.system.register');
Route::post('user/system/register',[SystemController::class,'register']); Route::post('user/system/register',[SystemController::class,'register']);
Route::match(['post'],'user/system/link',[SystemController::class,'system_link']); Route::view('user/system/register_confirm/{so}','user.system.register_confirm')
->where('so','[0-9]+');
Route::post('user/system/link',[SystemController::class,'system_link']);
/* ZONE PATHS */ /* ZONE PATHS */
Route::view('zone','zone.home'); Route::view('zone','zone.home');