diff options
author | S. Brusch <ne20002@gmx.ch> | 2023-02-09 13:40:45 +0100 |
---|---|---|
committer | S. Brusch <ne20002@gmx.ch> | 2023-02-10 11:05:24 +0100 |
commit | a159d98f97b56f80d3211c56f19d8b3db0adaec4 (patch) | |
tree | 394b4e3da1eeabcd3ca17e19a530ce21a967c71d /applications/luci-app-bcp38/htdocs/luci-static/resources | |
parent | 62f88b6924e17551d282aa89b8373c6fbe7df1e2 (diff) |
luci-app-bcp38: migration to JavaScript
- One to one migration of lua based package to JavaSript.
Signed-off-by: S. Brusch <ne20002@gmx.ch>
Diffstat (limited to 'applications/luci-app-bcp38/htdocs/luci-static/resources')
-rw-r--r-- | applications/luci-app-bcp38/htdocs/luci-static/resources/view/bcp38/form.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/applications/luci-app-bcp38/htdocs/luci-static/resources/view/bcp38/form.js b/applications/luci-app-bcp38/htdocs/luci-static/resources/view/bcp38/form.js new file mode 100644 index 0000000000..9e14047698 --- /dev/null +++ b/applications/luci-app-bcp38/htdocs/luci-static/resources/view/bcp38/form.js @@ -0,0 +1,50 @@ +'use strict'; +'require view'; +'require form'; +'require tools.widgets as widgets'; + +return view.extend({ + render: function() { + var m, s, o; + + m = new form.Map('bcp38', _('BCP38'), + _('This function blocks packets with private address destinations ' + + 'from going out onto the internet as per ' + + '<a href="http://tools.ietf.org/html/bcp38">BCP 38</a>. ' + + 'For IPv6, only source specific default routes are installed, so ' + + 'no BCP38 firewall routes are needed.')); + + + s = m.section(form.TypedSection, 'bcp38', _('BCP38 config')); + s.anonymous = true; + + o = s.option(form.Flag, 'enabled', _('Enable')); + o.default = '0'; + o.rmempty = false; + + o = s.option(form.Flag, 'detect_upstream', _('Auto-detect upstream IP'), + _('Attempt to automatically detect if the upstream IP ' + + 'will be blocked by the configuration, and add an exception if it will. ' + + 'If this does not work correctly, you can add exceptions manually below.')); + o.rmempty = false; + + o = s.option(widgets.DeviceSelect, 'interface', _('Interface name'), + _('Interface to apply the blocking to should be the upstream WAN interface).')); + o.modalonly = true; + o.noaliases = true; + o.multiple = false; + o.rmempty = false; + + o = s.option(form.DynamicList, 'match', _('Blocked IP ranges')); + o.datatype = 'ip4addr'; + + o = s.option(form.DynamicList, 'nomatch', _('Allowed IP ranges'), + _('Takes precedence over blocked ranges. ' + + 'Use to whitelist your upstream network if you\'re behind a double NAT ' + + 'and the auto-detection doesn\'t work.')); + o.datatype = 'ip4addr'; + + return m.render(); + }, +}); + |