Commit 622e8dba authored by Ad Schellevis's avatar Ad Schellevis

firewall / add select all, for https://github.com/opnsense/core/issues/1514

parent 07f5033b
......@@ -216,6 +216,11 @@ $( document ).ready(function() {
$("#iform").submit();
});
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
// watch scroll position and set to last known on page load
watchScrollPosition();
});
......@@ -245,7 +250,7 @@ $( document ).ready(function() {
<td colspan="2"> </td>
</tr>
<tr>
<th width="2%">&nbsp;</th>
<th width="2%"><input type="checkbox" id="selectAll"></th>
<th width="2%">&nbsp;</th>
<th width="2%">&nbsp;</th>
<th><?=gettext("If");?></th>
......@@ -293,7 +298,7 @@ $( document ).ready(function() {
?>
<tr <?=isset($natent['disabled'])?"class=\"text-muted\"":"";?> ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
<td>
<input type="checkbox" name="rule[]" value="<?=$nnats;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$nnats;?>" />
</td>
<td>
<?php if (isset($natent['nordr'])): ?>
......
......@@ -165,9 +165,13 @@ $main_buttons = array(
$("#action").val("toggle");
$("#iform").submit();
});
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
// watch scroll position and set to last known on page load
watchScrollPosition();
});
</script>
......@@ -193,7 +197,7 @@ $main_buttons = array(
<table class="table table-striped">
<thead>
<tr>
<th>&nbsp;</th>
<th><input type="checkbox" id="selectAll"></th>
<th>&nbsp;</th>
<th><?=gettext("Interface"); ?></th>
<th><?=gettext("External IP"); ?></th>
......@@ -210,7 +214,7 @@ $main_buttons = array(
?>
<tr <?=isset($natent['disabled'])?"class=\"text-muted\"":"";?> valign="top" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
<td>
<input type="checkbox" name="rule[]" value="<?=$i;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$i;?>" />
</td>
<td>
<a href="#" type="submit" id="toggle_<?=$i;?>" data-toggle="tooltip" title="<?=(!isset($natent['disabled'])) ? gettext("disable rule") : gettext("enable rule");?>" class="act_toggle">
......
......@@ -167,6 +167,12 @@ $main_buttons = array(
$("#action").val("toggle");
$("#iform").submit();
});
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
// watch scroll position and set to last known on page load
watchScrollPosition();
});
......@@ -191,7 +197,7 @@ $main_buttons = array(
<thead>
<tr>
<th width="2%">&nbsp;</th>
<th width="2%">&nbsp;</th>
<th width="2%"><input type="checkbox" id="selectAll"></th>
<th width="2%">&nbsp;</th>
<th><?=gettext("Interface"); ?></th>
<th><?=gettext("External Prefix"); ?></th>
......@@ -207,7 +213,7 @@ $main_buttons = array(
<tr <?=isset($natent['disabled'])?"class=\"text-muted\"":"";?> ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';">
<td> </td>
<td>
<input type="checkbox" name="rule[]" value="<?=$i;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$i;?>" />
</td>
<td>
<a href="#" class="act_toggle" id="toggle_<?=$i;?>" data-toggle="tooltip" title="<?=(!isset($natent['disabled'])) ? gettext("disable rule") : gettext("enable rule");?>">
......
......@@ -234,6 +234,12 @@ include("head.inc");
$("#action").val("toggle");
$("#iform").submit();
});
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
// watch scroll position and set to last known on page load
watchScrollPosition();
});
......@@ -329,7 +335,7 @@ include("head.inc");
<thead>
<tr><th colspan="12"><?=gettext("Manual rules:"); ?></th></tr>
<tr>
<th>&nbsp;</th>
<th><input type="checkbox" id="selectAll"></th>
<th>&nbsp;</th>
<th><?=gettext("Interface");?></th>
<th class="hidden-xs hidden-sm"><?=gettext("Source");?></th>
......@@ -350,7 +356,7 @@ include("head.inc");
?>
<tr <?=$mode == "disabled" || $mode == "automatic" || isset($natent['disabled'])?"class=\"text-muted\"":"";?> ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$i;?>';">
<td>
<input type="checkbox" name="rule[]" value="<?=$i;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$i;?>" />
</td>
<td>
<?php
......
......@@ -240,6 +240,11 @@ $( document ).ready(function() {
$("#fw_category").addClass('hidden');
}
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
});
</script>
......@@ -280,7 +285,7 @@ $( document ).ready(function() {
<table class="table table-striped table-hover" id="rules">
<thead>
<tr>
<th>&nbsp;</th>
<th><input type="checkbox" id="selectAll"></th>
<th>&nbsp;</th>
<th><?=gettext("Proto");?></th>
<th><?=gettext("Source");?></th>
......@@ -436,7 +441,7 @@ $( document ).ready(function() {
?>
<tr class="rule" data-category="<?=!empty($filterent['category']) ? $filterent['category'] : "";?>">
<td>
<input type="checkbox" name="rule[]" value="<?=$i;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$i;?>" />
</td>
<td>
<a href="#" class="act_toggle" id="toggle_<?=$i;?>" data-toggle="tooltip" title="<?=(empty($filterent['disabled'])) ? gettext("disable rule") : gettext("enable rule");?>"><span class="glyphicon <?=$iconfn;?>"></span></a>
......
......@@ -205,6 +205,10 @@ $( document ).ready(function() {
});
$("#scrub_interface_disable").change();
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
// watch scroll position and set to last known on page load
watchScrollPosition();
......@@ -295,7 +299,7 @@ $( document ).ready(function() {
<th colspan="2"> </th>
</tr>
<tr>
<th>&nbsp;</th>
<th><input type="checkbox" id="selectAll"></th>
<th><?=gettext("Interfaces");?></th>
<th class="hidden-xs hidden-sm"><?=gettext("Source");?></th>
<th class="hidden-xs hidden-sm"><?=gettext("Destination");?></th>
......@@ -310,7 +314,7 @@ $( document ).ready(function() {
foreach ($a_scrub as $i => $scrubEntry):?>
<tr>
<td>
<input type="checkbox" name="rule[]" value="<?=$i;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$i;?>" />
<a href="#" class="act_toggle" data-id="<?=$i;?>" data-toggle="tooltip" title="<?=(empty($scrubEntry['disabled'])) ? gettext("disable") : gettext("enable");?>">
<span class="glyphicon glyphicon-play <?=(empty($scrubEntry['disabled'])) ? "text-success" : "text-muted";?>"></span>
</a>
......
......@@ -256,6 +256,11 @@ $main_buttons = array(
$("#action").val("move");
$("#iform").submit();
});
// select All
$("#selectAll").click(function(){
$(".rule_select").prop("checked", $(this).prop("checked"));
});
});
</script>
<?php include("fbegin.inc"); ?>
......@@ -280,7 +285,7 @@ $main_buttons = array(
<table class="table table-striped">
<thead>
<tr>
<td></td>
<td><input type="checkbox" id="selectAll"></td>
<td><?=gettext("Virtual IP address");?></td>
<td><?=gettext("Interface");?></td>
<td><?=gettext("Type");?></td>
......@@ -297,7 +302,7 @@ $main_buttons = array(
if(!empty($vipent['subnet']) || !empty($vipent['range']) || !empty($vipent['subnet_bits']) || (isset($vipent['range']['from']) && !empty($vipent['range']['from']))): ?>
<tr ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
<td>
<input type="checkbox" name="rule[]" value="<?=$i;?>" />
<input class="rule_select" type="checkbox" name="rule[]" value="<?=$i;?>" />
</td>
<td>
<?=($vipent['type'] == "single" || $vipent['type'] == "network") && !empty($vipent['subnet_bits']) ? $vipent['subnet']."/".$vipent['subnet_bits'] : "";?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment