Complete implement of select2 component, and replaced existing use of select2. Also deprecated CustomBlade definitions of select2/simplemde
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 43s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m34s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
2024-12-06 14:44:19 +11:00
parent e3c45dfd3d
commit e9b5783945
20 changed files with 118 additions and 255 deletions

View File

@@ -1,3 +1,4 @@
<!-- $o=Echoarea::class -->
@use(App\Models\Domain)
@extends('layouts.app')
@@ -17,24 +18,12 @@
<div class="row">
<div class="col-3">
<label for="domain" class="form-label">Domain</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-tag-fill"></i></span>
<select class="form-select @error('domain_id') is-invalid @enderror" id="domain" name="domain_id" required @cannot('admin',$o)disabled @endcannot>
<option value="">&nbsp;</option>
@foreach (Domain::active()->orderBy('name')->cursor() as $oo)
<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>
@php
$helper = (! $o->domain_id)
? sprintf('Add a <a href="%s">NEW Domain</a>',url('domain/addedit'))
: NULL;
@endphp
<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/>
</div>
<div class="col-3">
@@ -170,7 +159,7 @@
<div class="col-12">
<h3>Exporting to the following adresses:</h3>
<table class="table monotable" id="system">
<table class="table monotable" id="systems">
<thead>
<tr>
<th>System</th>
@@ -185,7 +174,7 @@
@foreach ($o->addresses as $ao)
<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>{{ $ao->ftn_3d }}</td>
<td>{{ $ao->ftn4d }}</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 class="text-end">{{ number_format($x->count()) }}</td>
@@ -198,4 +187,24 @@
@endif
@endcan
</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