Add Nat IP Field to Interfaces

This commit is contained in:
johnnyq 2025-02-13 16:34:27 -05:00
parent 2e9e49a203
commit 5ed5473b36
5 changed files with 9 additions and 0 deletions

View File

@ -103,6 +103,7 @@ if (isset($_GET['asset_id'])) {
ai.interface_type,
ai.interface_mac,
ai.interface_ip,
ai.interface_nat_ip,
ai.interface_ipv6,
ai.interface_primary,
ai.interface_notes,
@ -409,6 +410,7 @@ if (isset($_GET['asset_id'])) {
$interface_type = nullable_htmlentities($row['interface_type']);
$interface_mac = nullable_htmlentities($row['interface_mac']);
$interface_ip = nullable_htmlentities($row['interface_ip']);
$interface_nat_ip = nullable_htmlentities($row['interface_nat_ip']);
$interface_ipv6 = nullable_htmlentities($row['interface_ipv6']);
$interface_primary = intval($row['interface_primary']);
$network_id = intval($row['network_id']);

View File

@ -103,6 +103,8 @@
name="nat_ip"
placeholder="Nat IP"
maxlength="200"
data-inputmask="'alias': 'ip'"
data-mask
>
</div>
</div>

View File

@ -163,6 +163,8 @@ if ($link_row = mysqli_fetch_assoc($sql_link)) {
placeholder="Nat IP"
maxlength="200"
value="<?php echo $interface_nat_ip; ?>"
data-inputmask="'alias': 'ip'"
data-mask
>
</div>
</div>

View File

@ -736,6 +736,7 @@ if (isset($_POST['add_asset_interface'])) {
interface_type = '$type',
interface_mac = '$mac',
interface_ip = '$ip',
interface_nat_ip = '$nat_ip',
interface_ipv6 = '$ipv6',
interface_notes = '$notes',
interface_network_id = $network,
@ -848,6 +849,7 @@ if (isset($_POST['edit_asset_interface'])) {
interface_type = '$type',
interface_mac = '$mac',
interface_ip = '$ip',
interface_nat_ip = '$nat_ip',
interface_ipv6 = '$ipv6',
interface_notes = '$notes',
interface_network_id = $network

View File

@ -10,6 +10,7 @@ $ip = sanitizeInput($_POST['ip']);
if ($_POST['dhcp'] == 1){
$ip = 'DHCP';
}
$nat_ip = sanitizeInput($_POST['nat_ip']);
$ipv6 = sanitizeInput($_POST['ipv6']);
$network = intval($_POST['network']);
$notes = sanitizeInput($_POST['notes']);