diff options
-rw-r--r-- | src/usr/local/www/firewall_nat.php | 29 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_1to1.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_npt.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_npt_edit.php | 5 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_out.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/firewall_shaper.php | 9 |
6 files changed, 52 insertions, 9 deletions
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index 0d0d3a6..287133b 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -164,6 +164,19 @@ if (isset($_POST['del_x'])) { header("Location: firewall_nat.php"); exit; } +} else if ($_GET['act'] == "toggle") { + if ($a_nat[$_GET['id']]) { + if (isset($a_nat[$_GET['id']]['disabled'])) { + unset($a_nat[$_GET['id']]['disabled']); + } else { + $a_nat[$_GET['id']]['disabled'] = true; + } + if (write_config(gettext("Firewall: NAT: Port forward, enable/disable NAT rule"))) { + mark_subsystem_dirty('natconf'); + } + header("Location: firewall_nat.php"); + exit; + } } $pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Port Forward")); @@ -194,6 +207,7 @@ display_top_tabs($tab_array); <thead> <tr> <th><!-- Checkbox --></th> + <th><!-- Icon --></th> <th><!-- Rule type --></th> <th><?=gettext("Interface")?></th> <th><?=gettext("Protocol")?></th> @@ -225,13 +239,26 @@ foreach ($a_nat as $natent): if (!have_natpfruleint_access($natent['interface'])) { continue; } + + if (isset($natent['disabled'])) { + $iconfn = "pass_d"; + $trclass = 'class="disabled"'; + } else { + $iconfn = "pass"; + $trclass = ''; + } ?> - <tr id="fr<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';"> + <tr id="fr<?=$nnats;?>" <?=$trclass?> onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';"> <td > <input type="checkbox" id="frc<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" name="rule[]" value="<?=$i;?>"/> </td> <td> + <a href="?act=toggle&id=<?=$i?>"> + <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i> + </a> + </td> + <td> <?php if ($natent['associated-rule-id'] == "pass"): ?> diff --git a/src/usr/local/www/firewall_nat_1to1.php b/src/usr/local/www/firewall_nat_1to1.php index 1fc1593..3042a70 100644 --- a/src/usr/local/www/firewall_nat_1to1.php +++ b/src/usr/local/www/firewall_nat_1to1.php @@ -265,8 +265,12 @@ display_top_tabs($tab_array); </div> <nav class="action-buttons"> - <a href="firewall_nat_1to1_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add new mapping')?>"> - <i class="fa fa-plus icon-embed-btn"></i> + <a href="firewall_nat_1to1_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the top of the list')?>"> + <i class="fa fa-level-up icon-embed-btn"></i> + <?=gettext('Add')?> + </a> + <a href="firewall_nat_1to1_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the end of the list')?>"> + <i class="fa fa-level-down icon-embed-btn"></i> <?=gettext('Add')?> </a> <button name="del_x" type="submit" class="btn btn-danger btn-sm" title="<?=gettext('Delete selected mappings')?>"> diff --git a/src/usr/local/www/firewall_nat_npt.php b/src/usr/local/www/firewall_nat_npt.php index 034017f..89179ce 100644 --- a/src/usr/local/www/firewall_nat_npt.php +++ b/src/usr/local/www/firewall_nat_npt.php @@ -254,8 +254,12 @@ endforeach; </div> <nav class="action-buttons"> - <a href="firewall_nat_npt_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add new mapping')?>"> - <i class="fa fa-plus icon-embed-btn"></i> + <a href="firewall_nat_npt_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the top of the list')?>"> + <i class="fa fa-level-up icon-embed-btn"></i> + <?=gettext('Add')?> + </a> + <a href="firewall_nat_npt_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the end of the list')?>"> + <i class="fa fa-level-down icon-embed-btn"></i> <?=gettext('Add')?> </a> <button name="del_x" type="submit" class="btn btn-danger btn-sm" title="<?=gettext('Delete selected mappings')?>"> diff --git a/src/usr/local/www/firewall_nat_npt_edit.php b/src/usr/local/www/firewall_nat_npt_edit.php index 4025605..249159e 100644 --- a/src/usr/local/www/firewall_nat_npt_edit.php +++ b/src/usr/local/www/firewall_nat_npt_edit.php @@ -88,6 +88,11 @@ if (isset($_POST['id']) && is_numericint($_POST['id'])) { $id = $_POST['id']; } +$after = $_GET['after']; +if (isset($_POST['after'])) { + $after = $_POST['after']; +} + if (isset($_GET['dup'])) { $id = $_GET['dup']; $after = $_GET['dup']; diff --git a/src/usr/local/www/firewall_nat_out.php b/src/usr/local/www/firewall_nat_out.php index 29dce5a..cb31869 100644 --- a/src/usr/local/www/firewall_nat_out.php +++ b/src/usr/local/www/firewall_nat_out.php @@ -354,7 +354,7 @@ print($form); else: ?> <a href="?act=toggle&id=<?=$i?>"> - <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-hidden"?>" title="<?=gettext("Click to toggle enabled/disabled status")?>"></i> + <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("Click to toggle enabled/disabled status")?>"></i> </a> <?php diff --git a/src/usr/local/www/firewall_shaper.php b/src/usr/local/www/firewall_shaper.php index 079a8ce..b10bdd2 100644 --- a/src/usr/local/www/firewall_shaper.php +++ b/src/usr/local/www/firewall_shaper.php @@ -157,15 +157,17 @@ if ($_GET) { if (write_config()) { $retval = 0; $retval |= filter_configure(); - $savemsg = get_std_save_message($retval); if (stristr($retval, "error") <> true) { $savemsg = get_std_save_message($retval); + $class = 'success'; } else { $savemsg = $retval; + $class = 'warning'; } } else { $savemsg = gettext("Unable to write config.xml (Access Denied?)"); + $class = 'warning'; } $dfltmsg = true; @@ -336,12 +338,13 @@ if ($_POST) { $retval = 0; $retval = filter_configure(); - $savemsg = get_std_save_message($retval); if (stristr($retval, "error") <> true) { $savemsg = get_std_save_message($retval); + $class = 'success'; } else { $savemsg = $retval; + $class = 'warning'; } /* reset rrd queues */ @@ -423,7 +426,7 @@ if ($input_errors) { } if ($savemsg) { - print_info_box($savemsg, 'success'); + print_info_box($savemsg, $class); } if (is_subsystem_dirty('shaper')) { |