Added Access VLANs to Pop

This commit is contained in:
Frank Schubert
2021-06-29 21:18:51 +02:00
parent b99cd75df8
commit 0d002eb5b4
5 changed files with 49 additions and 3 deletions

View File

@@ -87,7 +87,8 @@
</div>
<div id="net-detail-<?=$network->id?>-pops" class="tab-pane">
<h4>POPs in <strong><?=$network->name?></strong></h4>
<div class="card">
<div class="card-body">
<?php if(is_array($network->pops) && count($network->pops)): ?>
<table class="table" >
<tr>
@@ -100,7 +101,7 @@
<tr>
<td><?=$pop->name?></td>
<td><?=$pop->gps_lat?>, <?=$pop->gps_long?></td>
<td><?=$pop->location?></td>
<td><?=nl2br($pop->location)?></td>
<td class="controls" style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Pop", "edit", ["id" => $pop->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Pop", "delete", ["id" => $pop->id])?>" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
@@ -111,6 +112,8 @@
<?php else: ?>
<p><i>Keine POPs vorhanden</i></p>
<?php endif; ?>
</div>
</div>
<a class="btn btn-primary" href="<?=self::getUrl("Pop", "add", ['network_id' => $network->id])?>"><i class="fas fa-plus"></i> Neuen POP anlegen</a>
</div>

View File

@@ -77,6 +77,34 @@
</div>
</div>
<div class="card">
<div class="card-body">
<h2 class="header-title mb-2">Access VLANs</h2>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="vlan_public">Public</label>
<div class="col-lg-10">
<input type="number" class="form-control" name="vlan_public" id="vlan_public" value="<?=$pop->vlan_public?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="vlan_nat">NAT</label>
<div class="col-lg-10">
<input type="number" class="form-control" name="vlan_nat" id="vlan_nat" value="<?=$pop->vlan_nat?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="vlan_ipv6">IPv6</label>
<div class="col-lg-10">
<input type="number" class="form-control" name="vlan_ipv6" id="vlan_ipv6" value="<?=$pop->vlan_ipv6?>">
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="form-group row">
@@ -114,6 +142,16 @@
placeholder: ""
});
$("#addresstypes").select2();
// disable mousewheel on a input number field when in focus
$('form').on('focus', 'input[type=number]', function (e) {
$(this).on('wheel.disableScroll', function (e) {
e.preventDefault()
})
})
$('form').on('blur', 'input[type=number]', function (e) {
$(this).off('wheel.disableScroll')
})
</script>
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>

View File

@@ -23,7 +23,6 @@
</li>
<li><a href="<?=self::getUrl("User")?>">Benutzer</a></li>
<li><a href="<?=self::getUrl("Network")?>">Neztgebiete</a></li>
<li><a href="<?=self::getUrl("Pop")?>">POPs</a></li>
</ul>
</li>

View File

@@ -75,6 +75,9 @@ class PopController extends mfBaseController {
$data['gps_lat'] = $r->gps_lat;
$data['gps_long'] = $r->gps_long;
$data['location'] = $r->location;
$data['vlan_public'] = $r->vlan_public;
$data['vlan_nat'] = $r->vlan_nat;
$data['vlan_ipv6'] = $r->vlan_ipv6;
$data['note'] = $r->note;
$data['edit_by'] = 1;

View File

@@ -6,6 +6,9 @@ class PopModel {
public $gps_lat = null;
public $gps_long = null;
public $location = null;
public $vlan_public = null;
public $vlan_nat = null;
public $vlan_ipv6 = null;
public $note = null;