luci-mod-network: fix device dependencies in add interface dialog
Commitb7f3cf66ca
"luci-mod-network: drop support for *adding* legacy bridges" dropped the protocol dependcies of the ifname/device selector in the add new interface dialog. Re-add the required dependencies and swap the order of the protocol and device inputs while we're at it since latter depends on the former. Fixes:b7f3cf66ca
("luci-mod-network: drop support for *adding* legacy bridges") Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit147188f6ee
)
This commit is contained in:
parent
54b2195dcf
commit
1ef7cbf9da
1 changed files with 6 additions and 3 deletions
|
@ -960,15 +960,18 @@ return view.extend({
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
proto = s2.option(form.ListValue, 'proto', _('Protocol'));
|
||||||
|
proto.validate = name.validate;
|
||||||
|
|
||||||
device = s2.option(widgets.DeviceSelect, 'device', _('Device'));
|
device = s2.option(widgets.DeviceSelect, 'device', _('Device'));
|
||||||
device.noaliases = false;
|
device.noaliases = false;
|
||||||
device.optional = false;
|
device.optional = false;
|
||||||
|
|
||||||
proto = s2.option(form.ListValue, 'proto', _('Protocol'));
|
|
||||||
proto.validate = name.validate;
|
|
||||||
|
|
||||||
for (var i = 0; i < protocols.length; i++) {
|
for (var i = 0; i < protocols.length; i++) {
|
||||||
proto.value(protocols[i].getProtocol(), protocols[i].getI18n());
|
proto.value(protocols[i].getProtocol(), protocols[i].getI18n());
|
||||||
|
|
||||||
|
if (!protocols[i].isVirtual())
|
||||||
|
device.depends('proto', protocols[i].getProtocol());
|
||||||
}
|
}
|
||||||
|
|
||||||
m2.render().then(L.bind(function(nodes) {
|
m2.render().then(L.bind(function(nodes) {
|
||||||
|
|
Loading…
Reference in a new issue