Compare commits
2 Commits
65b2a2d519
...
3a594acc03
Author | SHA1 | Date | |
---|---|---|---|
3a594acc03 | |||
800593d034 |
@ -57,18 +57,16 @@ class DomainController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function api_hosts(Zone $o,int $region): Collection
|
public function api_hosts(Zone $o,int $region): Collection
|
||||||
{
|
{
|
||||||
$oo = Address::where('role',Address::NODE_NC)
|
return $o->hosts
|
||||||
->where('zone_id',$o->id)
|
->filter(fn($item)=>$item->role_id === Address::NODE_NC)
|
||||||
->when($region,function($query,$region) { return $query->where('region_id',$region); })
|
->filter(fn($item)=>$region ? ($item->region_id === $region) : TRUE)
|
||||||
->when((! $region),function($query) use ($region) { return $query->where('region_id',0); })
|
->map(function($item) {
|
||||||
->where('point_id',0)
|
return [
|
||||||
->FTNorder()
|
'id'=>$item->host_id,
|
||||||
->with(['system'])
|
'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->name)
|
||||||
->get();
|
];
|
||||||
|
})
|
||||||
return $oo->map(function($item) {
|
->values();
|
||||||
return ['id'=>$item->host_id,'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->name)];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,15 +78,16 @@ class DomainController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function api_hubs(Zone $o,int $host): Collection
|
public function api_hubs(Zone $o,int $host): Collection
|
||||||
{
|
{
|
||||||
$oo = Address::where('role',Address::NODE_HC)
|
return $o->hubs
|
||||||
->where('zone_id',$o->id)
|
->filter(fn($item)=>$item->role_id === Address::NODE_HC)
|
||||||
->when($host,function($query,$host) { return $query->where('host_id',$host)->where('node_id','<>',0); })
|
->filter(fn($item)=>$host ? ($item->host_id === $host) : TRUE)
|
||||||
->with(['system'])
|
->map(function($item) {
|
||||||
->get();
|
return [
|
||||||
|
'id'=>$item->id,
|
||||||
return $oo->map(function($item) {
|
'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->name)
|
||||||
return ['id'=>$item->id,'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->name)];
|
];
|
||||||
});
|
})
|
||||||
|
->values();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,18 +98,15 @@ class DomainController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function api_regions(Zone $o): Collection
|
public function api_regions(Zone $o): Collection
|
||||||
{
|
{
|
||||||
$oo = Address::where('role',Address::NODE_RC)
|
return $o->regions
|
||||||
->where('zone_id',$o->id)
|
->filter(fn($item)=>$item->role_id === Address::NODE_RC)
|
||||||
->where('node_id',0)
|
->map(function($item) {
|
||||||
->where('point_id',0)
|
return [
|
||||||
->orderBy('region_id')
|
'id'=>$item->region_id,
|
||||||
->active()
|
'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->location)
|
||||||
->with(['system'])
|
];
|
||||||
->get();
|
})
|
||||||
|
->values();
|
||||||
return $oo->map(function($item) {
|
|
||||||
return ['id'=>$item->region_id,'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->location)];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function view(Domain $o)
|
public function view(Domain $o)
|
||||||
|
@ -36,6 +36,44 @@ class Zone extends Model
|
|||||||
return $this->belongsTo(Domain::class);
|
return $this->belongsTo(Domain::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hosts()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Address::class)
|
||||||
|
->where(function($query) {
|
||||||
|
return $query
|
||||||
|
->where(fn($q)=>$q->where('node_id',0)->where('point_id',0))
|
||||||
|
->orWhere('role',Address::NODE_HC);
|
||||||
|
})
|
||||||
|
->FTNorder()
|
||||||
|
->with(['system','zone.domain']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hubs()
|
||||||
|
{
|
||||||
|
// @todo we should be able to add to this query, to count children of an address by using a group by?
|
||||||
|
return $this->hasMany(Address::class)
|
||||||
|
->where(function($query) {
|
||||||
|
return $query
|
||||||
|
->where(fn($q)=>$q->where('point_id',0))
|
||||||
|
->orWhere('role',Address::NODE_HC);
|
||||||
|
})
|
||||||
|
->FTNorder()
|
||||||
|
->with(['system','zone.domain']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function regions()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Address::class)
|
||||||
|
->where(function($query) {
|
||||||
|
return $query
|
||||||
|
->where(fn($q)=>$q->where('node_id',0)->where('point_id',0))
|
||||||
|
->orWhere('role',Address::NODE_RC);
|
||||||
|
})
|
||||||
|
->orderBy('region_id')
|
||||||
|
->active()
|
||||||
|
->with(['system','zone.domain']);
|
||||||
|
}
|
||||||
|
|
||||||
public function system()
|
public function system()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(System::class);
|
return $this->belongsTo(System::class);
|
||||||
|
6
public/css/fixes.css
vendored
6
public/css/fixes.css
vendored
@ -138,4 +138,10 @@ h1>small.success:after {
|
|||||||
.titledbox {
|
.titledbox {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Usage of label for radio icons, but using span instead */
|
||||||
|
span.label.form-label {
|
||||||
|
font-size: 75%;
|
||||||
|
margin-bottom: 1px;
|
||||||
}
|
}
|
@ -138,7 +138,7 @@
|
|||||||
|
|
||||||
<!-- Hub Checkbox -->
|
<!-- Hub Checkbox -->
|
||||||
<div class="col-2 d-none" id="hub-checkbox">
|
<div class="col-2 d-none" id="hub-checkbox">
|
||||||
<label for="hub" class="form-label">Hub</label>
|
<span class="label form-label">Hub</span>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
<input type="radio" class="btn-check" name="hub" id="hub_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('hub',$o->hub))checked @endif>
|
<input type="radio" class="btn-check" name="hub" id="hub_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('hub',$o->hub))checked @endif>
|
||||||
@ -224,19 +224,19 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#zone_id').on('change',function() {
|
$('#zone_id').on('change',function() {
|
||||||
$(this).parent().find('i').addClass('spinner-grow spinner-grow-sm');
|
// Hide all our other input boxes
|
||||||
$('#region_id').prop('disabled',true);
|
if (! $('#region-select').hasClass('d-none'))
|
||||||
$('#region_id').children().remove();
|
$('#region-select').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#region-address').hasClass('d-none'))
|
if (! $('#region-address').hasClass('d-none'))
|
||||||
$('#region-address').addClass('d-none');
|
$('#region-address').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#host-address').hasClass('d-none'))
|
|
||||||
$('#host-address').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#host-select').hasClass('d-none'))
|
if (! $('#host-select').hasClass('d-none'))
|
||||||
$('#host-select').addClass('d-none');
|
$('#host-select').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#host-address').hasClass('d-none'))
|
||||||
|
$('#host-address').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#hub-select').hasClass('d-none'))
|
if (! $('#hub-select').hasClass('d-none'))
|
||||||
$('#hub-select').addClass('d-none')
|
$('#hub-select').addClass('d-none')
|
||||||
|
|
||||||
@ -246,7 +246,16 @@
|
|||||||
if (! $('#node-address').hasClass('d-none'))
|
if (! $('#node-address').hasClass('d-none'))
|
||||||
$('#node-address').addClass('d-none');
|
$('#node-address').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#sec-level').hasClass('d-none'))
|
||||||
|
$('#sec-level').addClass('d-none')
|
||||||
|
|
||||||
|
var icon = $(this).parent().find('i');
|
||||||
|
icon.addClass('spinner-grow spinner-grow-sm');
|
||||||
|
|
||||||
$.get('{{ url('domain/api/regions') }}'+'/'+this.value,function(data) {
|
$.get('{{ url('domain/api/regions') }}'+'/'+this.value,function(data) {
|
||||||
|
$('#region_id').prop('disabled',true);
|
||||||
|
$('#region_id').children().remove();
|
||||||
|
|
||||||
$('#region_id').append('<option value=""></option>');
|
$('#region_id').append('<option value=""></option>');
|
||||||
$('#region_id').append('<option value="0">No Region</option>');
|
$('#region_id').append('<option value="0">No Region</option>');
|
||||||
$('#region_id').append('<option value="new">New Region</option>');
|
$('#region_id').append('<option value="new">New Region</option>');
|
||||||
@ -258,16 +267,33 @@
|
|||||||
$('#region_id').prop('disabled',false);
|
$('#region_id').prop('disabled',false);
|
||||||
$('#region_id').show();
|
$('#region_id').show();
|
||||||
|
|
||||||
if (modify.responseJSON.region_id)
|
if (modify && modify.responseJSON.region_id)
|
||||||
$('#region_id').val(modify.responseJSON.region_id).change();
|
$('#region_id').val(modify.responseJSON.region_id).change();
|
||||||
});
|
|
||||||
|
|
||||||
$('#region-select').removeClass('d-none');
|
$('#region-select').removeClass('d-none');
|
||||||
$(this).parent().find('i').removeClass('spinner-grow spinner-grow-sm');
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#region_id').on('change',function() {
|
$('#region_id').on('change',function() {
|
||||||
|
// Hide all our other input boxes
|
||||||
|
if (! $('#host-select').hasClass('d-none'))
|
||||||
|
$('#host-select').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#host-address').hasClass('d-none'))
|
||||||
|
$('#host-address').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#hub-select').hasClass('d-none'))
|
||||||
|
$('#hub-select').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#hub-checkbox').hasClass('d-none'))
|
||||||
|
$('#hub-checkbox').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#node-address').hasClass('d-none'))
|
||||||
|
$('#node-address').addClass('d-none');
|
||||||
|
|
||||||
switch(this.value) {
|
switch(this.value) {
|
||||||
|
// Not selected - everything off
|
||||||
case '':
|
case '':
|
||||||
if (! $('#region-address').hasClass('d-none'))
|
if (! $('#region-address').hasClass('d-none'))
|
||||||
$('#region-address').addClass('d-none');
|
$('#region-address').addClass('d-none');
|
||||||
@ -275,68 +301,48 @@
|
|||||||
if (! $('#host-select').hasClass('d-none'))
|
if (! $('#host-select').hasClass('d-none'))
|
||||||
$('#host-select').addClass('d-none');
|
$('#host-select').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#host-address').hasClass('d-none'))
|
if (! $('#sec-level').hasClass('d-none'))
|
||||||
$('#host-address').addClass('d-none');
|
$('#sec-level').addClass('d-none')
|
||||||
|
|
||||||
if (! $('#hub-select').hasClass('d-none'))
|
|
||||||
$('#hub-select').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#hub-checkbox').hasClass('d-none'))
|
|
||||||
$('#hub-checkbox').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#node-address').hasClass('d-none'))
|
|
||||||
$('#node-address').addClass('d-none');
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// New Region - ask address/security
|
||||||
case 'new':
|
case 'new':
|
||||||
if (! $('#host-select').hasClass('d-none'))
|
|
||||||
$('#host-select').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#host-address').hasClass('d-none'))
|
|
||||||
$('#host-address').addClass('d-none');
|
|
||||||
|
|
||||||
if ($('#region-address').hasClass('d-none'))
|
if ($('#region-address').hasClass('d-none'))
|
||||||
$('#region-address').removeClass('d-none');
|
$('#region-address').removeClass('d-none');
|
||||||
|
|
||||||
if (! $('#hub-select').hasClass('d-none'))
|
if ($('#sec-level').hasClass('d-none'))
|
||||||
$('#hub-select').addClass('d-none');
|
$('#sec-level').removeClass('d-none')
|
||||||
|
|
||||||
if (! $('#hub-checkbox').hasClass('d-none'))
|
|
||||||
$('#hub-checkbox').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#node-address').hasClass('d-none'))
|
|
||||||
$('#node-address').addClass('d-none');
|
|
||||||
|
|
||||||
$('#action').val('region');
|
$('#action').val('region');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// No region - next Host Select
|
||||||
case '0':
|
case '0':
|
||||||
|
// Existing entry selected - next Host Select
|
||||||
default:
|
default:
|
||||||
// Find Hosts
|
// Find Hosts
|
||||||
if ($('#host-select').hasClass('d-none'))
|
|
||||||
$('#host-select').removeClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#region-address').hasClass('d-none'))
|
if (! $('#region-address').hasClass('d-none'))
|
||||||
$('#region-address').addClass('d-none');
|
$('#region-address').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#hub-select').hasClass('d-none'))
|
|
||||||
$('#hub-select').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#hub-checkbox').hasClass('d-none'))
|
|
||||||
$('#hub-checkbox').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#host-address').hasClass('d-none'))
|
if (! $('#host-address').hasClass('d-none'))
|
||||||
$('#host-address').addClass('d-none');
|
$('#host-address').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#node-address').hasClass('d-none'))
|
if (! $('#node-address').hasClass('d-none'))
|
||||||
$('#node-address').addClass('d-none');
|
$('#node-address').addClass('d-none');
|
||||||
|
|
||||||
$(this).parent().find('i').addClass('spinner-grow spinner-grow-sm');
|
if (! $('#sec-level').hasClass('d-none'))
|
||||||
$('#host_id').prop('disabled',true);
|
$('#sec-level').addClass('d-none')
|
||||||
$('#host_id').children().remove();
|
|
||||||
var that = this;
|
var that = this;
|
||||||
|
var icon = $(this).parent().find('i');
|
||||||
|
icon.addClass('spinner-grow spinner-grow-sm');
|
||||||
|
|
||||||
$.get('{{ url('domain/api/hosts') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
$.get('{{ url('domain/api/hosts') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
||||||
|
$('#host_id').prop('disabled',true);
|
||||||
|
$('#host_id').children().remove();
|
||||||
|
|
||||||
$('#host_id').append('<option value=""></option>');
|
$('#host_id').append('<option value=""></option>');
|
||||||
if (that.value !== '0')
|
if (that.value !== '0')
|
||||||
$('#host_id').append('<option value="0">No Host</option>');
|
$('#host_id').append('<option value="0">No Host</option>');
|
||||||
@ -349,66 +355,80 @@
|
|||||||
$('#host_id').prop('disabled',false);
|
$('#host_id').prop('disabled',false);
|
||||||
$('#host_id').show();
|
$('#host_id').show();
|
||||||
|
|
||||||
if (modify.responseJSON.host_id)
|
if (modify && modify.responseJSON.host_id)
|
||||||
$('#host_id').val(modify.responseJSON.host_id).change();
|
$('#host_id').val(modify.responseJSON.host_id).change();
|
||||||
});
|
|
||||||
|
|
||||||
$('#host-select').removeClass('d-none');
|
$('#host-select').removeClass('d-none');
|
||||||
$(this).parent().find('i').removeClass('spinner-grow spinner-grow-sm');
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#host_id').on('change',function() {
|
$('#host_id').on('change',function() {
|
||||||
|
if (! $('#hub-select').hasClass('d-none'))
|
||||||
|
$('#hub-select').addClass('d-none');
|
||||||
|
|
||||||
switch(this.value) {
|
switch(this.value) {
|
||||||
|
// Not selected - everything off
|
||||||
case '':
|
case '':
|
||||||
if (! $('#host-address').hasClass('d-none'))
|
if (! $('#host-address').hasClass('d-none'))
|
||||||
$('#host-address').addClass('d-none');
|
$('#host-address').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#hub-select').hasClass('d-none'))
|
|
||||||
$('#hub-select').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#hub-checkbox').hasClass('d-none'))
|
if (! $('#hub-checkbox').hasClass('d-none'))
|
||||||
$('#hub-checkbox').addClass('d-none');
|
$('#hub-checkbox').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#node-address').hasClass('d-none'))
|
if (! $('#node-address').hasClass('d-none'))
|
||||||
$('#node-address').addClass('d-none');
|
$('#node-address').addClass('d-none');
|
||||||
|
|
||||||
|
if (! $('#sec-level').hasClass('d-none'))
|
||||||
|
$('#sec-level').addClass('d-none')
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// New Host - ask address/security
|
||||||
case 'new':
|
case 'new':
|
||||||
if ($('#host-address').hasClass('d-none'))
|
if ($('#host-address').hasClass('d-none'))
|
||||||
$('#host-address').removeClass('d-none');
|
$('#host-address').removeClass('d-none');
|
||||||
|
|
||||||
if (! $('#hub-select').hasClass('d-none'))
|
|
||||||
$('#hub-select').addClass('d-none');
|
|
||||||
|
|
||||||
if (! $('#hub-checkbox').hasClass('d-none'))
|
if (! $('#hub-checkbox').hasClass('d-none'))
|
||||||
$('#hub-checkbox').addClass('d-none');
|
$('#hub-checkbox').addClass('d-none');
|
||||||
|
|
||||||
if (! $('#node-address').hasClass('d-none'))
|
if (! $('#node-address').hasClass('d-none'))
|
||||||
$('#node-address').addClass('d-none');
|
$('#node-address').addClass('d-none');
|
||||||
|
|
||||||
|
if ($('#sec-level').hasClass('d-none'))
|
||||||
|
$('#sec-level').removeClass('d-none')
|
||||||
|
|
||||||
$('#action').val('host');
|
$('#action').val('host');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// No host - next Hub Select
|
||||||
case '0':
|
case '0':
|
||||||
|
// Existing entry selected - next Hub Select
|
||||||
default:
|
default:
|
||||||
|
$('#node_id').prop('disabled',true);
|
||||||
|
$('#point_id').prop('disabled',true);
|
||||||
|
|
||||||
if (! $('#host-address').hasClass('d-none'))
|
if (! $('#host-address').hasClass('d-none'))
|
||||||
$('#host-address').addClass('d-none');
|
$('#host-address').addClass('d-none');
|
||||||
|
|
||||||
if ($('#hub-select').hasClass('d-none'))
|
|
||||||
$('#hub-select').removeClass('d-none');
|
|
||||||
|
|
||||||
if ($('#hub-checkbox').hasClass('d-none'))
|
if ($('#hub-checkbox').hasClass('d-none'))
|
||||||
$('#hub-checkbox').removeClass('d-none');
|
$('#hub-checkbox').removeClass('d-none');
|
||||||
|
|
||||||
if ($('#node-address').hasClass('d-none'))
|
if ($('#node-address').hasClass('d-none'))
|
||||||
$('#node-address').removeClass('d-none');
|
$('#node-address').removeClass('d-none');
|
||||||
|
|
||||||
$(this).parent().find('i').addClass('spinner-grow spinner-grow-sm');
|
if ($('#sec-level').hasClass('d-none'))
|
||||||
$('#hub_id').prop('disabled',true);
|
$('#sec-level').removeClass('d-none')
|
||||||
$('#hub_id').children().remove();
|
|
||||||
|
var icon = $(this).parent().find('i');
|
||||||
|
icon.addClass('spinner-grow spinner-grow-sm');
|
||||||
|
|
||||||
$.get('{{ url('domain/api/hubs') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
$.get('{{ url('domain/api/hubs') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
||||||
|
$('#hub_id').prop('disabled',true);
|
||||||
|
$('#hub_id').children().remove();
|
||||||
|
|
||||||
$('#hub_id').append('<option value="">No Hub</option>');
|
$('#hub_id').append('<option value="">No Hub</option>');
|
||||||
|
|
||||||
data.forEach(function(item) {
|
data.forEach(function(item) {
|
||||||
@ -418,13 +438,15 @@
|
|||||||
$('#hub_id').prop('disabled',false);
|
$('#hub_id').prop('disabled',false);
|
||||||
$('#hub_id').show();
|
$('#hub_id').show();
|
||||||
|
|
||||||
if (modify.responseJSON.hub_id)
|
if (modify && modify.responseJSON.hub_id)
|
||||||
$('#host_id').val(modify.responseJSON.hub_id).change();
|
$('#host_id').val(modify.responseJSON.hub_id).change();
|
||||||
});
|
|
||||||
|
|
||||||
$('#hub-select').removeClass('d-none');
|
$('#hub-select').removeClass('d-none');
|
||||||
$('#sec-level').removeClass('d-none');
|
$('#node_id').prop('disabled',false);
|
||||||
$(this).parent().find('i').removeClass('spinner-grow spinner-grow-sm');
|
$('#point_id').prop('disabled',false);
|
||||||
|
|
||||||
|
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||||
|
});
|
||||||
|
|
||||||
if (modify && modify.responseJSON) {
|
if (modify && modify.responseJSON) {
|
||||||
$('#submit').val(id);
|
$('#submit').val(id);
|
||||||
@ -437,12 +459,18 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#hub_id').on('change',function() {
|
$('#hub_id').on('change',function() {
|
||||||
|
if ($('#sec-level').hasClass('d-none'))
|
||||||
|
$('#sec-level').removeClass('d-none')
|
||||||
|
|
||||||
switch(this.value) {
|
switch(this.value) {
|
||||||
|
// Not selected - enter a normal node
|
||||||
case '':
|
case '':
|
||||||
if ($('#hub-checkbox').hasClass('d-none'))
|
if ($('#hub-checkbox').hasClass('d-none'))
|
||||||
$('#hub-checkbox').removeClass('d-none');
|
$('#hub-checkbox').removeClass('d-none');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Existing entry selected - next Address input
|
||||||
default:
|
default:
|
||||||
if (! $('#hub-checkbox').hasClass('d-none'))
|
if (! $('#hub-checkbox').hasClass('d-none'))
|
||||||
$('#hub-checkbox').addClass('d-none');
|
$('#hub-checkbox').addClass('d-none');
|
||||||
|
@ -228,7 +228,7 @@ use App\Models\{Mailer,User};
|
|||||||
<!-- Active -->
|
<!-- Active -->
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@can($action,$o)
|
@can($action,$o)
|
||||||
<label for="active" class="form-label">Active</label>
|
<span class="label form-label">Active</span>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="btn-group" role="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>
|
<input type="radio" class="btn-check" name="active" id="active_yes" value="1" required @if(old('active',$o->active))checked @endif>
|
||||||
@ -246,7 +246,7 @@ use App\Models\{Mailer,User};
|
|||||||
<!-- Hold -->
|
<!-- Hold -->
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@can('admin',$o)
|
@can('admin',$o)
|
||||||
<label for="hold" class="form-label">Hold Mail <i class="bi bi-info-circle" title="Dont give the node any mail regardless of poll mode"></i></label>
|
<span class="label form-label">Hold Mail <i class="bi bi-info-circle" title="Dont give the node any mail regardless of poll mode"></i></span>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
<input type="radio" class="btn-check" name="hold" id="hold_yes" value="1" required @if(old('hold',$o->hold))checked @endif>
|
<input type="radio" class="btn-check" name="hold" id="hold_yes" value="1" required @if(old('hold',$o->hold))checked @endif>
|
||||||
@ -264,7 +264,7 @@ use App\Models\{Mailer,User};
|
|||||||
<!-- Poll Mode -->
|
<!-- Poll Mode -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@can($action,$o)
|
@can($action,$o)
|
||||||
<label for="pollmode" class="form-label">Poll Mode <i class="bi bi-info-circle" title="Poll node when mail available, poll on a schedule or hold mail for collection"></i></label>
|
<span class="label form-label">Poll Mode <i class="bi bi-info-circle" title="Poll node when mail available, poll on a schedule or hold mail for collection"></i></span>
|
||||||
<div class="input-group has-validation">
|
<div class="input-group has-validation">
|
||||||
<div class="btn-group @error('pollmode') is-invalid @enderror" role="group">
|
<div class="btn-group @error('pollmode') is-invalid @enderror" role="group">
|
||||||
<input type="radio" class="btn-check" name="pollmode" id="poll_crash" value="2" @if((int)old('pollmode',($o->pollmode === TRUE) ? 2 : 0) === 2)checked @endif>
|
<input type="radio" class="btn-check" name="pollmode" id="poll_crash" value="2" @if((int)old('pollmode',($o->pollmode === TRUE) ? 2 : 0) === 2)checked @endif>
|
||||||
@ -410,7 +410,7 @@ use App\Models\{Mailer,User};
|
|||||||
<!-- Notes -->
|
<!-- Notes -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label for="notes" class="form-label">Notes</label>
|
<label for="notes" class="form-label">Notes</label>
|
||||||
<textarea class="form-control" rows=3 name="notes" placeholder="Notes...">{{ old('notes',$o->notes) }}</textarea>
|
<textarea class="form-control" rows=3 id="notes" name="notes" placeholder="Notes...">{{ old('notes',$o->notes) }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endcan
|
@endcan
|
||||||
|
Loading…
Reference in New Issue
Block a user