luci-mod-network: restore DNS option semantics for proto static
authorJo-Philipp Wich <jo@mein.io>
Sat, 20 Mar 2021 23:36:24 +0000 (00:36 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 20 Mar 2021 23:36:24 +0000 (00:36 +0100)
The peerdns settings makes little practical sense for proto:static
interfaces, so revert to allow setting the DNS server list directly.

Fixes: faad7464a8 ("luci-mod-network: add support for network.device sections")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index 19021c4ef1dfcb2a921a09d854643dbbcf3c9cc8..02a2a89a57a8672600a60a8f6e23d39ccd932bba 100644 (file)
@@ -596,9 +596,11 @@ return view.extend({
                                o.default = o.enabled;
 
                                o = nettools.replaceOption(s, 'advanced', form.Flag, 'peerdns', _('Use DNS servers advertised by peer'), _('If unchecked, the advertised DNS server addresses are ignored'));
+                               o.depends({ 'proto': 'static', '!reverse': true });
                                o.default = o.enabled;
 
                                o = nettools.replaceOption(s, 'advanced', form.DynamicList, 'dns', _('Use custom DNS servers'));
+                               o.depends('proto', 'static');
                                o.depends('peerdns', '0');
                                o.datatype = 'ipaddr';