mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
firewall/outbound nat, align "NAT Address" output to edit page
This commit is contained in:
parent
ecd2aff386
commit
0f18d2e1f9
@ -101,6 +101,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
$mode = $config['nat']['outbound']['mode'];
|
||||
|
||||
$interface_names= array();
|
||||
// add this hosts ips
|
||||
foreach ($config['interfaces'] as $intf => $intfdata) {
|
||||
if (isset($intfdata['ipaddr']) && $intfdata['ipaddr'] != 'dhcp') {
|
||||
$interface_names[$intfdata['ipaddr']] = (!empty($intfdata['descr']) ? $intfdata['descr'] : $intf ) . " " . gettext("address");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
include("head.inc");
|
||||
|
||||
?>
|
||||
@ -383,14 +392,15 @@ include("head.inc");
|
||||
<td class="hidden-xs hidden-sm">
|
||||
<?php
|
||||
|
||||
if (isset($natent['nonat']))
|
||||
$nat_address = '<I>NO NAT</I>';
|
||||
elseif (!$natent['target'])
|
||||
$nat_address = htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])) . " address";
|
||||
elseif ($natent['target'] == "other-subnet")
|
||||
$nat_address = $natent['targetip'] . '/' . $natent['targetip_subnet'];
|
||||
else
|
||||
$nat_address = htmlspecialchars($natent['target']);
|
||||
if (isset($natent['nonat'])) {
|
||||
$nat_address = '<I>NO NAT</I>';
|
||||
} elseif (empty($natent['target'])) {
|
||||
$nat_address = gettext("Interface address");
|
||||
} elseif ($natent['target'] == "other-subnet") {
|
||||
$nat_address = $natent['targetip'] . '/' . $natent['targetip_subnet'];
|
||||
} else {
|
||||
$nat_address = htmlspecialchars($natent['target']);
|
||||
}
|
||||
?>
|
||||
<?php if (isset($natent['target']) && is_alias($natent['target'])): ?>
|
||||
<span title="<?=htmlspecialchars(get_alias_description($natent['target']));?>" data-toggle="tooltip">
|
||||
@ -400,6 +410,8 @@ include("head.inc");
|
||||
title="<?=gettext("edit alias");?>" data-toggle="tooltip">
|
||||
<i class="fa fa-list"></i>
|
||||
</a>
|
||||
<?php elseif (!empty($interface_names[$nat_address])): ?>
|
||||
<?=$interface_names[$nat_address];?>
|
||||
<?php else: ?>
|
||||
<?=$nat_address;?>
|
||||
<?php endif; ?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user