Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/luci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-07-26 13:36:04 +0300
committerJo-Philipp Wich <jo@mein.io>2019-07-26 13:36:04 +0300
commitd25f95c93dab254a7bbbb2a5e766f852f26b667b (patch)
tree488be4e13864032666836447422855e79cef8215 /applications/luci-app-firewall/htdocs
parentb4129640b476a196594d3b9f8d1a76f0579cb22f (diff)
luci-app-firewall: explicitely set 'DNAT' target on new forwards
Fixes: #2920 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall/htdocs')
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
index ffbfe3ccd0..63af69f8a9 100644
--- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
@@ -107,6 +107,16 @@ return L.view.extend({
return uci.get('firewall', section_id, 'name') || _('Unnamed forward');
};
+ s.handleAdd = function(ev) {
+ var config_name = this.uciconfig || this.map.config,
+ section_id = uci.add(config_name, this.sectiontype);
+
+ uci.set(config_name, section_id, 'target', 'DNAT');
+
+ this.addedSection = section_id;
+ this.renderMoreOptionsModal(section_id);
+ };
+
o = s.taboption('general', form.Value, 'name', _('Name'));
o.placeholder = _('Unnamed forward');
o.modalonly = true;