User register system, minor cosmetic changes, start of user authorisation
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p>You are not linked to any BBS systems.</p>
|
||||
<p>You are not linked to any BBS systems. Start <a href="{{ url('user/system/register') }}">here</a> to link to your first.</p>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
<!-- CSS only -->
|
||||
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
|
||||
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
|
||||
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.0/font/bootstrap-icons.css">
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="{{ asset('oldschool/css/main.css') }}" media="screen">
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
@if($o->exists) Update @else Add @endif System
|
||||
@can('admin',$o) @if($o->exists) Update @else Add @endif @endcan System
|
||||
@endsection
|
||||
|
||||
@php
|
||||
|
@@ -8,196 +8,9 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="greyframe titledbox shadow0xb0">
|
||||
<h2 class="cap">@if($o->exists) Update @else Add @endif System</h2>
|
||||
<h2 class="cap">@can('update',$o) @if($o->exists) Update @else Add @endif @endif System</h2>
|
||||
|
||||
<div class="row">
|
||||
<!-- Name -->
|
||||
<div class="col-4">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-tag-fill"></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('admin',$o)disabled @endcannot autofocus>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('name')
|
||||
{{ $message }}
|
||||
@else
|
||||
A name is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active -->
|
||||
<div class="col-2">
|
||||
<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 @cannot('admin',$o)disabled @endcannot @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 @cannot('admin',$o)disabled @endcannot @if(! old('active',$o->active))checked @endif>
|
||||
<label class="btn btn-outline-danger" for="active_no">No</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ZeroTier ID -->
|
||||
<div class="offset-3 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('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('zt_id')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</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-globe"></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)disabled @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-8">
|
||||
<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('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('location')
|
||||
{{ $message }}
|
||||
@else
|
||||
System location is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Mailer Details -->
|
||||
<div class="col-12">
|
||||
<h4>Mailer Details</h4>
|
||||
|
||||
<div class="pt-0 row">
|
||||
<div class="col-4">
|
||||
<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="mailer_type" name="mailer_type" @cannot('admin',$o)disabled @endcannot>
|
||||
<option></option>
|
||||
<option value="{{ Setup::O_BINKP }}" @if(old('mailer_type',$o->mailer_type) == Setup::O_BINKP)selected @endif}}>BINKP</option>
|
||||
<option value="{{ Setup::O_EMSI }}" @if(old('mailer_type',$o->mailer_type) == Setup::O_EMSI)selected @endif}}>EMSI</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<label for="address" class="form-label">Address</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('mailer_address') is-invalid @enderror" id="mailer_address" placeholder="FQDN" name="mailer_address" value="{{ old('mailer_address',$o->mailer_address) }}" @cannot('admin',$o)disabled @endcannot>
|
||||
<input type="text" class="form-control @error('mailer_port') is-invalid @enderror" id="mailer_port" placeholder="Port" name="mailer_port" value="{{ old('mailer_port',$o->mailer_port) }}" @cannot('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('mailer_address')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('mailer_port')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-0 row">
|
||||
<div class="col-4">
|
||||
<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('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('phone')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- BBS Details -->
|
||||
<div class="col-12">
|
||||
<h4>BBS Details</h4>
|
||||
|
||||
<div class="pt-0 row">
|
||||
<div class="col-4">
|
||||
<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('admin',$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 class="col-8">
|
||||
<label for="address" class="form-label">Address</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('admin',$o)disabled @endcannot>
|
||||
<input type="text" class="form-control @error('port') is-invalid @enderror" id="port" placeholder="Port" name="port" value="{{ old('port',$o->port) }}" @cannot('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('address')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('port')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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..." @cannot('admin',$o)disabled @endcannot>{{ old('notes',$o->notes) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<a href="{{ url('ftn/system') }}" class="btn btn-danger">Cancel</a>
|
||||
@can('admin',$o)
|
||||
<button type="submit" name="submit" class="btn btn-success float-end">@if ($o->exists)Save @else Add @endif</button>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@include('system.widget.form-system')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -28,13 +28,13 @@
|
||||
</div>
|
||||
|
||||
<span class="col-6 mt-auto mx-auto text-center align-bottom">
|
||||
@if($errors->count())
|
||||
@if($errors->count())
|
||||
<span class="btn btn-sm btn-danger" role="alert">
|
||||
There were errors with the submission.
|
||||
@dump($errors)
|
||||
</span>
|
||||
There were errors with the submission.
|
||||
@dump($errors)
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@can('admin',$o)
|
||||
<div class="col-2">
|
||||
|
206
resources/views/system/widget/form-system.blade.php
Normal file
206
resources/views/system/widget/form-system.blade.php
Normal file
@@ -0,0 +1,206 @@
|
||||
@php
|
||||
use App\Models\Setup;
|
||||
@endphp
|
||||
|
||||
<div class="row">
|
||||
<!-- Name -->
|
||||
<div class="col-4">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-tag-fill"></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)disabled @endcannot autofocus>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('name')
|
||||
{{ $message }}
|
||||
@else
|
||||
A name is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active -->
|
||||
<div class="col-2">
|
||||
@if($o->exists)
|
||||
@can('admin',$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
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- ZeroTier ID -->
|
||||
<div class="offset-3 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('update',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('zt_id')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</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-globe"></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)disabled @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-8">
|
||||
<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('update',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('location')
|
||||
{{ $message }}
|
||||
@else
|
||||
System location is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Mailer Details -->
|
||||
<div class="col-12">
|
||||
<h4>Mailer Details</h4>
|
||||
|
||||
<div class="pt-0 row">
|
||||
<div class="col-4">
|
||||
<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="mailer_type" name="mailer_type" @cannot('update',$o)disabled @endcannot>
|
||||
<option></option>
|
||||
<option value="{{ Setup::O_BINKP }}" @if(old('mailer_type',$o->mailer_type) == Setup::O_BINKP)selected @endif>BINKP</option>
|
||||
<option value="{{ Setup::O_EMSI }}" @if(old('mailer_type',$o->mailer_type) == Setup::O_EMSI)selected @endif>EMSI</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<label for="address" class="form-label">Address</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('mailer_address') is-invalid @enderror" id="mailer_address" placeholder="FQDN" name="mailer_address" value="{{ old('mailer_address',$o->mailer_address) }}" @cannot('update',$o)disabled @endcannot>
|
||||
<input type="text" class="form-control @error('mailer_port') is-invalid @enderror" id="mailer_port" placeholder="Port" name="mailer_port" value="{{ old('mailer_port',$o->mailer_port) }}" @cannot('update',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('mailer_address')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('mailer_port')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-0 row">
|
||||
<div class="col-4">
|
||||
<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('update',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('phone')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- BBS Details -->
|
||||
<div class="col-12">
|
||||
<h4>BBS Details</h4>
|
||||
|
||||
<div class="pt-0 row">
|
||||
<div class="col-4">
|
||||
<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('update',$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 class="col-8">
|
||||
<label for="address" class="form-label">Address</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('update',$o)disabled @endcannot>
|
||||
<input type="text" class="form-control @error('port') is-invalid @enderror" id="port" placeholder="Port" name="port" value="{{ old('port',$o->port) }}" @cannot('update',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('address')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('port')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</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('update',$o)
|
||||
<a href="{{ url('ftn/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="register">Register</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
185
resources/views/user/system/register.blade.php
Normal file
185
resources/views/user/system/register.blade.php
Normal file
@@ -0,0 +1,185 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Register System
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form class="row g-0 needs-validation" method="post" autocomplete="off" novalidate>
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="greyframe titledbox shadow0xb0">
|
||||
<h2 class="cap">Register System</h2>
|
||||
|
||||
<div id="register">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<label for="system" 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" style="z-index: 0" class="form-control col-11 @error('zone_id') is-invalid @enderror" id="system" placeholder="BBS Name" name="system" value="{{ old('system') }}" required 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('zone_id')
|
||||
{{ $message }}
|
||||
@else
|
||||
BBS Name is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
<style>
|
||||
input#system + span {
|
||||
left: -1.5em;
|
||||
top: 0.5em;
|
||||
position:relative
|
||||
}
|
||||
div#system_search_results ul {
|
||||
color:#eeeeee;
|
||||
background-color:#292929;
|
||||
font-size: .85rem;
|
||||
padding: 0 5px 0 5px;
|
||||
z-index: 99;
|
||||
top: -0.5em;
|
||||
left: 31em !important;
|
||||
}
|
||||
div#system_search_results ul li.dropdown-header {
|
||||
display: block;
|
||||
color: #fff !important;
|
||||
}
|
||||
div#system_search_results ul li,
|
||||
div#system_search_results ul li a {
|
||||
display: block;
|
||||
color: #aaa !important;
|
||||
margin: 0 !important;
|
||||
border: 0 !important;
|
||||
width: inherit;
|
||||
text-indent: 0 !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
div#system_search_results ul li:hover {
|
||||
padding-left: 0;
|
||||
text-indent: 0;
|
||||
}
|
||||
div#system_search_results ul li:before {
|
||||
content:""!important
|
||||
}
|
||||
</style>
|
||||
@append
|
||||
@section('page-scripts')
|
||||
<script>
|
||||
var system_id;
|
||||
|
||||
$(document).ready(function() {
|
||||
$('input[id=system]').typeahead({
|
||||
autoSelect: false,
|
||||
scrollHeight: 10,
|
||||
theme: 'bootstrap5',
|
||||
delay: 500,
|
||||
minLength: 2,
|
||||
items: {{ $search_limit ?? 5 }},
|
||||
fitToElement: false,
|
||||
selectOnBlur: false,
|
||||
appendTo: "#system_search_results",
|
||||
source: function (query,process) {
|
||||
systemsearch('{{ url('api/systems/orphan') }}',query,process);
|
||||
},
|
||||
|
||||
matcher: function () { return true; },
|
||||
|
||||
// Disable sorting and just return the items (items should by the ajax method)
|
||||
sorter: function(items) {
|
||||
return items;
|
||||
},
|
||||
|
||||
updater: function (item) {
|
||||
system_id = item.id;
|
||||
return item.name;
|
||||
},
|
||||
})
|
||||
.on('keyup keypress', function(event) {
|
||||
var key = event.keyCode || event.which;
|
||||
if (key === 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('button[name=submit]').on('click',function() {
|
||||
icon = $(this).parent().find('i');
|
||||
|
||||
if (! $('#system').val())
|
||||
return;
|
||||
|
||||
$.ajax({
|
||||
url : '{{ url('user/system/register') }}',
|
||||
type : 'POST',
|
||||
data : { system_id: system_id,system_name: $('#system').val() },
|
||||
dataType : 'html',
|
||||
async : true,
|
||||
cache : false,
|
||||
beforeSend : function() {
|
||||
icon.removeClass('d-none');
|
||||
},
|
||||
success : function(data) {
|
||||
// if json is null, means no match, won't do again.
|
||||
if(data==null || (data.length===0)) return;
|
||||
|
||||
$('#register').empty().append(data);
|
||||
},
|
||||
complete : function() {
|
||||
//icon.addClass('d-none');
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
var c=0;
|
||||
var systemsearch = _.debounce(function(url,query,process,icon){
|
||||
icon = $('#search-icon').find('i');
|
||||
|
||||
$.ajax({
|
||||
url : url,
|
||||
type : 'GET',
|
||||
data : 'term=' + query,
|
||||
dataType : 'JSON',
|
||||
async : true,
|
||||
cache : false,
|
||||
beforeSend : function() {
|
||||
if (c++ == 0) {
|
||||
icon.removeClass('d-none');
|
||||
}
|
||||
},
|
||||
success : function(data) {
|
||||
// if json is null, means no match, won't do again.
|
||||
if(data==null || (data.length===0)) return;
|
||||
|
||||
process(data);
|
||||
},
|
||||
complete : function() {
|
||||
if (--c == 0) {
|
||||
icon.addClass('d-none');
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 500);
|
||||
</script>
|
||||
@append
|
@@ -146,10 +146,10 @@
|
||||
<input type="text" class="form-control @error('zt_ipv6_mask') is-invalid @enderror" id="zt_ipv6_mask" placeholder="112" name="zt_ipv6_mask" value="{{ old('zt_ipv6_mask',$o->zt_ipv6_mask) }}" @cannot('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('zt_ipv6')
|
||||
{{ $message }}
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('zt_ipv6_mask')
|
||||
{{ $message }}
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user