summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-firewall
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-01-16 15:29:54 +0100
committerJo-Philipp Wich <jo@mein.io>2020-01-16 15:31:01 +0100
commit267085cf2d498c34b92a6e8edae627b1705f88a2 (patch)
tree26c963178318290461d9094d1eb340e2343dacce /applications/luci-app-firewall
parent5093e8bf5cf5c750a8887bf9612450a375373a62 (diff)
luci-app-firewall: support 'direction' and 'device' parameters for rules
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall')
-rw-r--r--applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js29
1 files changed, 27 insertions, 2 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js
index a0d4cfc06..8c50baa82 100644
--- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js
@@ -223,9 +223,34 @@ return L.view.extend({
o.default = o.enabled;
o.editable = true;
- //ft.opt_enabled(s, Button);
- //ft.opt_name(s, Value, _('Name'));
+ o = s.taboption('advanced', form.ListValue, 'direction', _('Match device'));
+ o.modalonly = true;
+ o.value('', _('unspecified'));
+ o.value('in', _('Inbound device'));
+ o.value('out', _('Outbound device'));
+ o.cfgvalue = function(section_id) {
+ var val = uci.get('firewall', section_id, 'direction');
+ switch (val) {
+ case 'in':
+ case 'ingress':
+ return 'in';
+
+ case 'out':
+ case 'egress':
+ return 'out';
+ }
+
+ return null;
+ };
+
+ o = s.taboption('advanced', widgets.DeviceSelect, 'device', _('Device name'),
+ _('Specifies whether to tie this traffic rule to a specific inbound or outbound network device.'));
+ o.modalonly = true;
+ o.noaliases = true;
+ o.rmempty = false;
+ o.depends('direction', 'in');
+ o.depends('direction', 'out');
o = s.taboption('advanced', form.ListValue, 'family', _('Restrict to address family'));
o.modalonly = true;