luci-mod-network: Support for disabling routes
authorAnton Kikin <a.kikin@tano-systems.com>
Tue, 6 Apr 2021 01:21:01 +0000 (04:21 +0300)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 21 Jun 2021 10:53:21 +0000 (12:53 +0200)
Support for disabling routes in netifd was added in commit [1]. This commit
adds support for disabling routes through the LuCI interface.

Additionally hidden the route options descriptions in the header of the
routes table (they are still available in the modal view).

[1]: https://git.openwrt.org/?p=project/netifd.git;a=commit;h=327da9895327bc56b23413ee91a6e6b6e0e4329d

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
(cherry picked from commit bfe8a01040c8a74f38818195620f069f5bc10c5c)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js

index b218daac349ff6e7af4119d44b5c9108d58c428a..7e11a3cb4181c28680b94fdf8e87297dc1c2a837 100644 (file)
@@ -20,6 +20,7 @@ return view.extend({
                        s.anonymous = true;
                        s.addremove = true;
                        s.sortable = true;
+                       s.nodescriptions = true;
 
                        s.tab('general', _('General Settings'));
                        s.tab('advanced', _('Advanced Settings'));
@@ -28,6 +29,10 @@ return view.extend({
                        o.rmempty = false;
                        o.nocreate = true;
 
+                       o = s.taboption('general', form.Flag, 'disabled', _('Disable'), _('Disable this route'));
+                       o.rmempty = true;
+                       o.default = o.disabled;
+
                        o = s.taboption('general', form.Value, 'target', _('Target'), (i == 4) ? _('Host-<abbr title="Internet Protocol Address">IP</abbr> or Network') : _('<abbr title="Internet Protocol Version 6">IPv6</abbr>-Address or Network (CIDR)'));
                        o.datatype = (i == 4) ? 'ip4addr' : 'ip6addr';
                        o.rmempty = false;