]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
firewall.cgi: Dynamically show/hide DNAT and SNAT configure elements.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 18 Apr 2015 23:04:14 +0000 (01:04 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 18 Apr 2015 23:19:11 +0000 (01:19 +0200)
Fixes #10732.

html/cgi-bin/firewall.cgi
html/html/themes/darkdos/include/style.css
html/html/themes/ipfire-legacy/include/style.css
html/html/themes/ipfire/include/css/style.css
html/html/themes/maniac/include/style.css

index 3e1b33618c98fa01aecb30543e20d1628e73ba4d..c207ec74873aff8c68185fe199eb9ca30afcdb7d 100644 (file)
@@ -157,6 +157,19 @@ print<<END;
                        \$("#actions").toggle();
                });
 
+               // Hide SNAT items when DNAT is selected and vice versa.
+               if (\$('input[name=nat]:checked').val() == 'dnat') {
+                       \$('.snat').hide();
+               } else {
+                       \$('.dnat').hide();
+               }
+
+               // Show/Hide elements when SNAT/DNAT get changed.
+               \$('input[name=nat]').change(function() {
+                       \$('.snat').toggle();
+                       \$('.dnat').toggle();
+               });
+
                // Time constraints
                if(!\$("#USE_TIME_CONSTRAINTS").attr("checked")) {
                        \$("#TIME_CONSTRAINTS").hide();
@@ -1643,7 +1656,7 @@ END
                                $Lang::tr{'fwdfw use nat'}
                        </label>
                        <div class="NAT">
-                               <table width='100%' border='0'>
+                               <table class='fw-nat' width='100%' border='0'>
                                        <tr>
                                                <td width='5%'></td>
                                                <td width='40%'>
@@ -1655,9 +1668,9 @@ END
 END
 
        print <<END;
-                                               <td width='25%' align='right'>$Lang::tr{'dnat address'}:</td>
+                                               <td width='25%' align='right'><span class='dnat'>$Lang::tr{'dnat address'}:</span></td>
                                                <td width='30%'>
-                                                       <select name='dnat' style='width: 100%;'>
+                                                       <select name='dnat' class='dnat' style='width: 100%;'>
                                                                <option value='AUTO' $selected{'dnat'}{'AUTO'}>- $Lang::tr{'automatic'} -</option>
                                                                <option value='Default IP' $selected{'dnat'}{'Default IP'}>$Lang::tr{'red1'} ($redip)</option>
 END
@@ -1688,9 +1701,9 @@ END
                                                                $Lang::tr{'fwdfw snat'}
                                                        </label>
                                                </td>
-                                               <td width='25%' align='right'>$Lang::tr{'snat new source ip address'}:</td>
+                                               <td width='25%' align='right'><span class='snat'>$Lang::tr{'snat new source ip address'}:</span></td>
                                                <td width='30%'>
-                                                       <select name='snat' style='width: 100%;'>
+                                                       <select name='snat' class='snat' style='width: 100%;'>
 END
 
                foreach my $alias (sort keys %aliases) {
index e7140cde8818794fbeb7903d6175e1f0a7ac61df..cc4b3c965359f6a047a0dd76cc7a57abd2dfc69b 100644 (file)
@@ -366,6 +366,10 @@ min-width: 2.0em;
 max-width: 2.5em;
 }
 
+table.fw-nat tbody tr td {
+       height: 2.25em;
+}
+
 /* LAYOUT - 3 COLUMNS */
 
        /* Primary content */
index d2c458e51012025594181b91bed960092203e6b0..288a0feeb3ccd0585ee0986b69fc818db7e9abe6 100644 (file)
@@ -343,6 +343,10 @@ min-width: 2.0em;
 max-width: 2.5em;
 }
 
+table.fw-nat tbody tr td {
+       height: 2.25em;
+}
+
 /* LAYOUT - 3 COLUMNS */
 
        /* Primary content */
index 0e990d68114e74e5a9478aba8b4a8b39b08e3c1b..e0ac3cd1168c9869397f266638acc40aeff5ee01 100644 (file)
@@ -324,3 +324,7 @@ table {
 .tbl tr:last-child td {
        border-bottom: 1px solid lightgrey;
 }
+
+table.fw-nat tbody tr td {
+       height: 2.25em;
+}
index eca34cb850349501cdc01f5dcfee927a117a5695..3cb2741301c5a606cc2fe29ee6dc1682849689fe 100644 (file)
@@ -372,6 +372,10 @@ min-width: 2.0em;
 max-width: 2.5em;
 }
 
+table.fw-nat tbody tr td {
+       height: 2.25em;
+}
+
 /* LAYOUT - 3 COLUMNS */
 
        /* Primary content */