Enabled default routing
This commit is contained in:
@@ -38,12 +38,13 @@ use App\Http\Controllers\DomainController as DC;
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th colspan="2"> </th>
|
||||
<th colspan="4" class="text-center">Passwords</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Zone</th>
|
||||
<th style="min-width: 1%;">Default</th>
|
||||
<th>Session</th>
|
||||
<th>Packet</th>
|
||||
<th>TIC</th>
|
||||
@@ -56,6 +57,13 @@ use App\Http\Controllers\DomainController as DC;
|
||||
@foreach ($o->sessions->sortBy('zone_id') as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->zone_id }}<span>@</span>{{ $oo->domain->name }}</td>
|
||||
<td style="text-align: center;">
|
||||
@if(($x=$oo->systems->where('pivot.default',TRUE))->count() && ($x->first()->id !== $o->id))
|
||||
<i class="bi bi-dash-square"></i>
|
||||
@else
|
||||
<span id="default" itemid="{{$oo->id}}"><i class="bi bi-{{ $x->count() ? 'check-square' : 'square' }}"></i></span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $oo->pivot->sespass }}</td>
|
||||
<td>{{ $oo->pivot->pktpass }}</td>
|
||||
<td>{{ $oo->pivot->ticpass }}</td>
|
||||
@@ -271,4 +279,40 @@ use App\Http\Controllers\DomainController as DC;
|
||||
</div>
|
||||
|
||||
@include('widgets.modal_delete')
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#default').click(function() {
|
||||
var item = this;
|
||||
icon = $(item).find('i');
|
||||
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
data: {sid: {{$o->id}},_token: '{{csrf_token()}}',set:(icon.hasClass('bi-square') ? 1 : 0)},
|
||||
beforeSend: function() {
|
||||
$(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() {
|
||||
$(item).find('i').removeClass('spinner-grow spinner-grow-sm');
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
url: '{{ url('api/default') }}/'+item.attributes.itemid.nodeValue,
|
||||
cache: false
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
Reference in New Issue
Block a user