From cdaf5635b203d55116d2fd5454c7ffa30ac64d79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 16 May 2021 17:33:39 +0200 Subject: [PATCH] luci-mod-network: drop support for *adding* legacy bridges MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The old way of defining bridge (L2) as part of interface (L3) is deprecated. Don't support *adding* interfaces like that. Support for *editing* legacy bridges is kept for now for compatibility with existing legacy setups. Signed-off-by: Rafał Miłecki (cherry picked from commit b7f3cf66cadf6753153bc9d1feac1eca0c7e37f0) --- .../resources/view/network/interfaces.js | 39 +++---------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index e8c0c29594..15a43e20e9 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -827,7 +827,7 @@ return view.extend({ var m2 = new form.Map('network'), s2 = m2.section(form.NamedSection, '_new_'), protocols = network.getProtocols(), - proto, name, bridge, ifname_single, ifname_multi; + proto, name, ifname; protocols.sort(function(a, b) { return a.getProtocol() > b.getProtocol(); @@ -857,33 +857,15 @@ return view.extend({ return true; }; + ifname = s2.option(widgets.DeviceSelect, 'ifname', _('Device')); + ifname.noaliases = false; + ifname.optional = false; + proto = s2.option(form.ListValue, 'proto', _('Protocol')); proto.validate = name.validate; - bridge = s2.option(form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)')); - bridge.modalonly = true; - bridge.disabled = ''; - bridge.enabled = 'bridge'; - - ifname_single = s2.option(widgets.DeviceSelect, 'ifname_single', _('Interface')); - ifname_single.noaliases = false; - ifname_single.optional = false; - - ifname_multi = s2.option(widgets.DeviceSelect, 'ifname_multi', _('Interface')); - ifname_multi.nobridges = true; - ifname_multi.noaliases = true; - ifname_multi.multiple = true; - ifname_multi.optional = true; - ifname_multi.display_size = 6; - for (var i = 0; i < protocols.length; i++) { proto.value(protocols[i].getProtocol(), protocols[i].getI18n()); - - if (!protocols[i].isVirtual()) { - bridge.depends({ proto: protocols[i].getProtocol() }); - ifname_single.depends({ type: '', proto: protocols[i].getProtocol() }); - ifname_multi.depends({ type: 'bridge', proto: protocols[i].getProtocol() }); - } } m2.render().then(L.bind(function(nodes) { @@ -916,16 +898,7 @@ return view.extend({ var section_id = uci.add('network', 'interface', nameval); protoclass.set('proto', protoval); - - if (ifname_single.isActive('_new_')) { - protoclass.addDevice(ifname_single.formvalue('_new_')); - } - else if (ifname_multi.isActive('_new_')) { - protoclass.set('type', 'bridge'); - L.toArray(ifname_multi.formvalue('_new_')).map(function(dev) { - protoclass.addDevice(dev); - }); - } + protoclass.addDevice(ifname.formvalue('_new_')); m.children[0].addedSection = section_id; }).then(L.bind(m.children[0].renderMoreOptionsModal, m.children[0], nameval)); -- 2.30.2