diff --git a/src/www/firewall_virtual_ip.php b/src/www/firewall_virtual_ip.php index fb3aebd7b..4321d865e 100644 --- a/src/www/firewall_virtual_ip.php +++ b/src/www/firewall_virtual_ip.php @@ -190,6 +190,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { header("Location: firewall_virtual_ip.php"); exit; } + } elseif (isset($pconfig['act']) && $pconfig['act'] == 'del_x' && isset($pconfig['rule']) && count($pconfig['rule']) > 0) { + // delete selected VIPs, sort rule in reverse order to delete the highest item sequences first + redirectReadOnlyUser(); + foreach (array_reverse($pconfig['rule']) as $ruleId) { + if (isset($a_vip[$ruleId])) { + deleteVIPEntry($ruleId); + } + } + write_config(); + header("Location: firewall_virtual_ip.php"); + exit; } elseif (isset($pconfig['act']) && $pconfig['act'] == 'move' && isset($pconfig['rule']) && count($pconfig['rule']) > 0) { redirectReadOnlyUser(); // move selected rules @@ -237,6 +248,26 @@ $main_buttons = array( }); }); + $("#del_x").click(function(){ + BootstrapDialog.show({ + type:BootstrapDialog.TYPE_DANGER, + title: "", + message: "", + buttons: [{ + label: "", + action: function(dialogRef) { + dialogRef.close(); + }}, { + label: "", + action: function(dialogRef) { + $("#id").val(""); + $("#action").val("del_x"); + $("#iform").submit() + } + }] + }); + }); + // link move buttons $(".act_move").click(function(){ var id = $(this).attr("id").split('_').pop(-1); @@ -335,6 +366,9 @@ $main_buttons = array( "> + " data-toggle="tooltip" class="btn btn-default btn-xs"> + +