2024-12-06 00:16:38 +00:00
|
|
|
<form class="needs-validation" method="post" action="{{ url('system/filearea',$o->id) }}" autocomplete="off" novalidate>
|
2024-11-03 22:05:27 +00:00
|
|
|
@csrf
|
2022-11-01 11:24:36 +00:00
|
|
|
|
2024-11-03 22:05:27 +00:00
|
|
|
<div class="row pt-0">
|
|
|
|
<div class="col-12">
|
|
|
|
<div class="greyframe titledbox shadow0xb0">
|
|
|
|
<div class="row">
|
|
|
|
<!-- Select Domain -->
|
|
|
|
<div class="col-3">
|
2024-12-06 03:44:19 +00:00
|
|
|
<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)])"/>
|
2024-11-03 22:05:27 +00:00
|
|
|
</div>
|
2022-11-01 11:24:36 +00:00
|
|
|
|
2024-11-03 22:05:27 +00:00
|
|
|
<!-- Select Address -->
|
|
|
|
<div class="col-3">
|
|
|
|
<div class="d-none" id="filearea_address-select">
|
2024-12-06 03:44:19 +00:00
|
|
|
<x-form.select id="filearea_address_id" name="address_id" icon="bi-hash" label="Address"/>
|
2022-11-01 11:24:36 +00:00
|
|
|
</div>
|
2024-11-03 22:05:27 +00:00
|
|
|
</div>
|
2022-11-01 11:24:36 +00:00
|
|
|
|
2024-11-03 22:05:27 +00:00
|
|
|
<!-- Summary of Addresses -->
|
|
|
|
<div class="offset-3 col-3" id="filearea-summary">
|
|
|
|
<table class="table monotable">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Network</th>
|
|
|
|
<th class="text-end">Areas</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2022-11-01 11:24:36 +00:00
|
|
|
|
2024-11-03 22:05:27 +00:00
|
|
|
<tbody>
|
|
|
|
@foreach ($o->fileareas()->with(['domain'])->get()->groupBy('domain_id') as $oo)
|
2022-11-01 11:24:36 +00:00
|
|
|
<tr>
|
2024-11-03 22:05:27 +00:00
|
|
|
<td>{{ $oo->first()->domain->name }}</td>
|
|
|
|
<td class="text-end">{{ $oo->count() }}</td>
|
2022-11-01 11:24:36 +00:00
|
|
|
</tr>
|
2024-11-03 22:05:27 +00:00
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2022-11-01 11:24:36 +00:00
|
|
|
</div>
|
2024-11-03 22:05:27 +00:00
|
|
|
</div>
|
2022-11-01 11:24:36 +00:00
|
|
|
|
2024-11-03 22:05:27 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12 d-none" id="filearea-select"></div>
|
2022-11-01 11:24:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-11-03 22:05:27 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2022-11-01 11:24:36 +00:00
|
|
|
|
|
|
|
@section('page-scripts')
|
|
|
|
<script type="text/javascript" src="{{ asset('plugin/checkboxes/jquery.checkboxes-1.2.2.min.js') }}"></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#filearea_domain_id').on('change',function() {
|
2024-12-06 03:44:19 +00:00
|
|
|
console.log('closing filearea-select');
|
|
|
|
if (! $('#filearea-select').hasClass('d-none'))
|
|
|
|
$('#filearea-select').addClass('d-none');
|
|
|
|
|
2022-11-01 11:24:36 +00:00
|
|
|
if (! $(this).val()) {
|
|
|
|
$('#filearea-summary').removeClass('d-none');
|
|
|
|
$('#filearea_address-select').addClass('d-none');
|
2024-12-06 03:44:19 +00:00
|
|
|
|
2022-11-01 11:24:36 +00:00
|
|
|
return;
|
2024-12-06 03:44:19 +00:00
|
|
|
|
2022-11-01 11:24:36 +00:00
|
|
|
} else {
|
|
|
|
$('#filearea_address-select').removeClass('d-none');
|
|
|
|
}
|
|
|
|
|
|
|
|
var item = this;
|
|
|
|
icon = $(item).parent().find('i');
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
data: {domain_id: $(item).val()},
|
|
|
|
beforeSend: function() {
|
|
|
|
icon.addClass('spinner-grow spinner-grow-sm');
|
|
|
|
},
|
|
|
|
success: function(data) {
|
|
|
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
|
|
|
$('#filearea_address_id')
|
|
|
|
.empty()
|
|
|
|
.append($('<option>'))
|
|
|
|
.append(data.map(function(item) {
|
|
|
|
return $('<option>').val(item.id).text(item.value);
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
error: function(e) {
|
|
|
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
|
|
|
|
|
|
|
if (e.status != 412)
|
|
|
|
alert('That didnt work? Please try again....');
|
|
|
|
},
|
2023-10-05 11:15:53 +00:00
|
|
|
url: '{{ url('system/api/address',[$o->id]) }}',
|
2022-11-01 11:24:36 +00:00
|
|
|
cache: false
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#filearea_address_id').on('change',function() {
|
|
|
|
if (! $(this).val()) {
|
|
|
|
$('#filearea-summary').removeClass('d-none');
|
|
|
|
$('#filearea-select').addClass('d-none');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($('#filearea-select').hasClass('d-none')) {
|
|
|
|
$('#filearea-select').removeClass('d-none');
|
|
|
|
$('#filearea-summary').addClass('d-none');
|
|
|
|
}
|
|
|
|
|
|
|
|
var item = this;
|
|
|
|
icon = $(item).parent().find('i');
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
data: {address_id: $(item).val()},
|
|
|
|
beforeSend: function() {
|
|
|
|
icon.addClass('spinner-grow spinner-grow-sm');
|
|
|
|
},
|
|
|
|
success: function(data) {
|
|
|
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
|
|
|
$('#filearea-select').empty().append(data);
|
|
|
|
$('#fileareas').checkboxes('range',true);
|
|
|
|
},
|
|
|
|
error: function(e) {
|
|
|
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
|
|
|
|
|
|
|
if (e.status != 412)
|
|
|
|
alert('That didnt work? Please try again....');
|
|
|
|
},
|
2023-10-05 11:15:53 +00:00
|
|
|
url: '{{ url('system/filearea',[$o->id]) }}',
|
2022-11-01 11:24:36 +00:00
|
|
|
cache: false
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|