From 328bfe7d29a0dfc900bf5fb4aad463336ba1bfcb Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 27 Aug 2017 11:41:27 +0200 Subject: [PATCH] firewall / nat, align target port to dst port when creating a new entry, for https://github.com/opnsense/core/issues/1787 --- src/www/firewall_nat_edit.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/www/firewall_nat_edit.php b/src/www/firewall_nat_edit.php index 6031b5cf1..a865d236b 100644 --- a/src/www/firewall_nat_edit.php +++ b/src/www/firewall_nat_edit.php @@ -476,6 +476,19 @@ $( document ).ready(function() { $('#dstendport').prop('selectedIndex', $("#dstbeginport").prop('selectedIndex') ); $('#dstendport').selectpicker('refresh'); $('#dstendport').change(); + // on new entry, align redirect target port to dst target + if ($("#entryid").length == 0) { + $('#localbeginport').prop('selectedIndex', $("#dstbeginport").prop('selectedIndex') ); + $('#localbeginport').change(); + } + }); + + $("input[for='dstbeginport']").change(function(){ + // on new entry, align redirect target port to dst target + if ($("#entryid").length == 0) { + $("input[for='localbeginport']").val($(this).val()); + $("input[for='localbeginport']").change(); + } }); // IPv4/IPv6 select @@ -1079,7 +1092,7 @@ $( document ).ready(function() { " /> " onclick="window.location.href='/firewall_nat.php'" /> - +