Implemented echoarea/filearea security
This commit is contained in:
@@ -91,6 +91,31 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label for="sec_read" class="form-label">Read <i class="bi bi-info-circle" title="Min security level required for read access"></i></label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-eyeglasses"></i></span>
|
||||
<input type="text" class="form-control text-end @error('sec_read') is-invalid @enderror" id="sec_read" placeholder="#" name="sec_read" value="{{ old('sec_read',$o->sec_read) }}" required @cannot('admin',$o)disabled @endcannot autofocus>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('sec_read')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label for="sec_write" class="form-label">Write <i class="bi bi-info-circle" title="Min security level required for write access"></i></label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-pencil"></i></span>
|
||||
<input type="text" class="form-control text-end @error('sec_write') is-invalid @enderror" id="sec_write" placeholder="#" name="sec_write" value="{{ old('sec_write',$o->sec_write) }}" required @cannot('admin',$o)disabled @endcannot autofocus>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('sec_write')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
@@ -31,6 +31,8 @@
|
||||
<th>Description</th>
|
||||
<th>Active</th>
|
||||
<th>Domain</th>
|
||||
<th>Read</th>
|
||||
<th>Write</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -42,6 +44,8 @@
|
||||
<td>{{ $oo->description }}</td>
|
||||
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
|
||||
<td>{{ $oo->domain->name }}</td>
|
||||
<td>{{ $oo->sec_read }}</td>
|
||||
<td>{{ $oo->sec_write }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@@ -51,7 +51,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<div class="offset-1 col-2" style="padding-left: 20px;">
|
||||
<label for="active" class="form-label">Active</label>
|
||||
<div class="input-group">
|
||||
<div class="btn-group" role="group">
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-7">
|
||||
<div class="col-5">
|
||||
<label for="description" class="form-label">Description</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-file-text-fill"></i></span>
|
||||
@@ -92,7 +92,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-5">
|
||||
<div class="col-3">
|
||||
<label for="nodelist" class="form-label">Nodelist File Name</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-file-earmark-break-fill"></i></span>
|
||||
@@ -104,6 +104,32 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label for="sec_read" class="form-label">Read <i class="bi bi-info-circle" title="Min security level required for read access"></i></label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-eyeglasses"></i></span>
|
||||
<input type="text" class="form-control text-end @error('sec_read') is-invalid @enderror" id="sec_read" placeholder="#" name="sec_read" value="{{ old('sec_read',$o->sec_read) }}" required @cannot('admin',$o)disabled @endcannot autofocus>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('sec_read')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label for="sec_write" class="form-label">Write <i class="bi bi-info-circle" title="Min security level required for write access"></i></label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-pencil"></i></span>
|
||||
<input type="text" class="form-control text-end @error('sec_write') is-invalid @enderror" id="sec_write" placeholder="#" name="sec_write" value="{{ old('sec_write',$o->sec_write) }}" required @cannot('admin',$o)disabled @endcannot autofocus>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('sec_write')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
@@ -31,6 +31,8 @@
|
||||
<th>Description</th>
|
||||
<th>Active</th>
|
||||
<th>Domain</th>
|
||||
<th>Read</th>
|
||||
<th>Write</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -42,6 +44,8 @@
|
||||
<td>{{ $oo->description }}</td>
|
||||
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
|
||||
<td>{{ $oo->domain->name }}</td>
|
||||
<td>{{ $oo->sec_read }}</td>
|
||||
<td>{{ $oo->sec_write }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@@ -100,6 +100,7 @@
|
||||
<tr>
|
||||
<th>Address</th>
|
||||
<th>Active</th>
|
||||
<th>Security</th>
|
||||
<th colspan="2">Role</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -109,29 +110,26 @@
|
||||
<tr>
|
||||
<td @if($oo->trashed()) class="trashed" @elseif (! $oo->active) class="inactive" @endif>{{ $oo->ftn }}</td>
|
||||
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
|
||||
<td class="text-end">{{ $oo->security }}</td>
|
||||
<td>{{ $oo->role_name }}</td>
|
||||
<td class="nowrap actions">
|
||||
@can('admin',$oo)
|
||||
{{--
|
||||
@if (! $oo->role & (Address::NODE_ZC|Address::NODE_RC|Address::NODE_NC))
|
||||
<a href="{{ url('ftn/system/modaddress',[$oo->id]) }}" title="Modify Address" class="modify"><i class="bi bi-pen-fill"></i></a>
|
||||
@endif
|
||||
--}}
|
||||
@if($oo->trashed())
|
||||
<a href="{{ url('ftn/system/recaddress',[$oo->id]) }}" title="Restore Address"><i class="bi bi-bandaid-fill"></i></a>
|
||||
<a href="{{ url('ftn/system/puraddress',[$oo->id]) }}" title="Purge Address" class="purge"><i class="bi bi-scissors"></i></a>
|
||||
@elseif(! $oo->active)
|
||||
@if(! $oo->active_domain)
|
||||
<!-- No options -->
|
||||
<a href="javascript:;" title="Net Disabled"><i class="bi bi-slash-square"></i></a>
|
||||
@elseif($oo->trashed())
|
||||
<a href="{{ url('ftn/system/recaddress',[$oo->id]) }}" title="Restore Address"><i class="bi bi-bandaid"></i></a>
|
||||
<a href="{{ url('ftn/system/puraddress',[$oo->id]) }}" title="Purge Address" class="purge"><i class="bi bi-scissors"></i></a>
|
||||
@else
|
||||
<a href="{{ url('ftn/system/susaddress',[$oo->id]) }}" title="@if($oo->active)Pause @else Activate @endif Address"><i class="bi @if($oo->active)bi-pause-circle-fill @else bi-play-circle-fill @endif"></i></a>
|
||||
<a href="{{ url('ftn/system/movaddress',[$o->id,$oo->id]) }}" title="Move Address to another System"><i class="bi bi-arrow-right-square-fill"></i></a>
|
||||
<a href="{{ url('ftn/system/deladdress',[$oo->id]) }}" title="Delete Address"><i class="bi bi-trash-fill"></i></a>
|
||||
<a href="{{ url('ftn/system/modaddress',[$oo->id]) }}" data-id="{{ $oo->id }}" title="Modify Address" class="modaddress" aria-readonly="true"><i class="bi bi-pencil-square"></i></a>
|
||||
<a href="{{ url('ftn/system/susaddress',[$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('ftn/system/movaddress',[$o->id,$oo->id]) }}" title="Move Address to another System"><i class="bi bi-arrow-right-square"></i></a>
|
||||
<a href="{{ url('ftn/system/deladdress',[$oo->id]) }}" title="Delete Address"><i class="bi bi-trash"></i></a>
|
||||
@if ((\App\Models\Address::NODE_HC|\App\Models\Address::NODE_ACTIVE) & $oo->role)
|
||||
<a href="{{ url('ftn/system/proaddress',[$oo->id]) }}" title="Promote Address"><i class="bi bi-arrow-up-square-fill"></i></a>
|
||||
<a href="{{ url('ftn/system/proaddress',[$oo->id]) }}" title="Promote Address"><i class="bi bi-arrow-up-square"></i></a>
|
||||
@endif
|
||||
@if ((\App\Models\Address::NODE_NC|\App\Models\Address::NODE_HC) & $oo->role)
|
||||
<a href="{{ url('ftn/system/demaddress',[$oo->id]) }}" title="Demote Address"><i class="bi bi-arrow-down-square-fill"></i></a>
|
||||
<a href="{{ url('ftn/system/demaddress',[$oo->id]) }}" title="Demote Address"><i class="bi bi-arrow-down-square"></i></a>
|
||||
@endif
|
||||
@endif
|
||||
@endcan
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<div class="row pt-0">
|
||||
<div class="col-12">
|
||||
<div class="greyframe titledbox shadow0xb0">
|
||||
<h2 class="cap">Assign New address</h2>
|
||||
<h2 class="cap">Assign New/Update Existing Address</h2>
|
||||
|
||||
<div class="row">
|
||||
<!-- Select Zone -->
|
||||
@@ -83,7 +83,7 @@
|
||||
<label for="node_id" class="form-label">Node/Point Address</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-hash"></i></span>
|
||||
<input type="text" style="width: 35%;" class="form-control @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>
|
||||
<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;">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -119,7 +119,7 @@
|
||||
<label for="host_id_new" class="form-label">Host Address</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-hash"></i></span>
|
||||
<input type="text" class="form-control @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>
|
||||
<span class="input-group-text p-0">/</span>
|
||||
<input type="text" class="form-control @error('node_id_new') is-invalid @enderror" id="node_id_new" placeholder="Node #" name="node_id_new" value="{{ old('node_id_new') }}" @cannot('admin',$o)disabled @endcannot>
|
||||
<span class="input-group-text">.0</span>
|
||||
@@ -151,6 +151,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Security -->
|
||||
<div class="col-2 d-none" id="sec-level">
|
||||
<label for="security" class="form-label">Security Level</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-file-lock"></i></span>
|
||||
<input type="text" class="form-control text-end @error('security') is-invalid @enderror" id="security" placeholder="#" name="security" value="{{ old('security') }}" @cannot('admin',$o)disabled @endcannot>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('security')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@@ -168,7 +182,7 @@
|
||||
|
||||
@can('admin',$o)
|
||||
<div class="col-2">
|
||||
<button type="submit" name="submit" class="btn btn-success float-end">Add</button>
|
||||
<button type="submit" id="submit" name="submit" class="btn btn-success float-end">Add/Update</button>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
@@ -180,6 +194,9 @@
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var modify;
|
||||
var id;
|
||||
|
||||
/*
|
||||
// Disable enter for form submission.
|
||||
$('input').on('keydown', function(event) {
|
||||
@@ -190,6 +207,21 @@
|
||||
});
|
||||
*/
|
||||
|
||||
$('.modaddress').on('click',function(event) {
|
||||
id = $(this).attr('data-id');
|
||||
event.stopPropagation();
|
||||
|
||||
modify = $.get('{{ url('address/get') }}'+'/'+id,function(data) {
|
||||
console.log(data.security);
|
||||
$('#zone_id').val(data.zone_id).change();
|
||||
$('#node_id').val(data.node_id).change();
|
||||
$('#point_id').val(data.point_id).change();
|
||||
$('#security').val(data.security).change();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#zone_id').on('change',function() {
|
||||
$(this).parent().find('i').addClass('spinner-grow spinner-grow-sm');
|
||||
$('#region_id').prop('disabled',true);
|
||||
@@ -224,6 +256,9 @@
|
||||
|
||||
$('#region_id').prop('disabled',false);
|
||||
$('#region_id').show();
|
||||
|
||||
if (modify.responseJSON.region_id)
|
||||
$('#region_id').val(modify.responseJSON.region_id).change();
|
||||
});
|
||||
|
||||
$('#region-select').removeClass('d-none');
|
||||
@@ -312,6 +347,9 @@
|
||||
|
||||
$('#host_id').prop('disabled',false);
|
||||
$('#host_id').show();
|
||||
|
||||
if (modify.responseJSON.host_id)
|
||||
$('#host_id').val(modify.responseJSON.host_id).change();
|
||||
});
|
||||
|
||||
$('#host-select').removeClass('d-none');
|
||||
@@ -378,11 +416,22 @@
|
||||
|
||||
$('#hub_id').prop('disabled',false);
|
||||
$('#hub_id').show();
|
||||
|
||||
if (modify.responseJSON.hub_id)
|
||||
$('#host_id').val(modify.responseJSON.hub_id).change();
|
||||
});
|
||||
|
||||
$('#hub-select').removeClass('d-none');
|
||||
$('#sec-level').removeClass('d-none');
|
||||
$(this).parent().find('i').removeClass('spinner-grow spinner-grow-sm');
|
||||
$('#action').val('node');
|
||||
|
||||
if (modify.responseJSON) {
|
||||
$('#submit').val(id);
|
||||
$('#action').val('update');
|
||||
|
||||
} else {
|
||||
$('#action').val('node');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user