luci-mod-network: drop support for *adding* legacy bridges
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 <rafal@milecki.pl>
This commit is contained in:
parent
94d35bbaa1
commit
b7f3cf66ca
1 changed files with 6 additions and 33 deletions
|
@ -831,7 +831,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();
|
||||
|
@ -861,33 +861,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) {
|
||||
|
@ -920,16 +902,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));
|
||||
|
|
Loading…
Reference in a new issue