luci-mod-network: make device selector dependent on protocol (again)
This commit effectively reverts the change made with907b4222f7
("luci-mod-network: don't hide "Device" on protocol change"). Floating tunnel protocols such as 6in4, plain PPP over modem device, VPNC etc. do not have any layer 2 device at all, for such protocols the device selector should be hidden. Also swap back the incorrect option order introduced with commitb7f3cf66ca
("luci-mod-network: drop support for *adding* legacy bridges"). Since device depends on proto, it should come after the protocol selection, not before. Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commitfc12933670
)
This commit is contained in:
parent
1ef7cbf9da
commit
b796bff7a9
1 changed files with 6 additions and 5 deletions
|
@ -505,10 +505,6 @@ return view.extend({
|
||||||
}, this);
|
}, this);
|
||||||
o.write = function() {};
|
o.write = function() {};
|
||||||
|
|
||||||
o = s.taboption('general', widgets.DeviceSelect, 'device', _('Device'));
|
|
||||||
o.nobridges = false;
|
|
||||||
o.optional = false;
|
|
||||||
o.network = ifc.getName();
|
|
||||||
|
|
||||||
proto_select = s.taboption('general', form.ListValue, 'proto', _('Protocol'));
|
proto_select = s.taboption('general', form.ListValue, 'proto', _('Protocol'));
|
||||||
proto_select.modalonly = true;
|
proto_select.modalonly = true;
|
||||||
|
@ -525,6 +521,11 @@ return view.extend({
|
||||||
.then(L.bind(this.renderMoreOptionsModal, this, s.section));
|
.then(L.bind(this.renderMoreOptionsModal, this, s.section));
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
o = s.taboption('general', widgets.DeviceSelect, 'device', _('Device'));
|
||||||
|
o.nobridges = false;
|
||||||
|
o.optional = false;
|
||||||
|
o.network = ifc.getName();
|
||||||
|
|
||||||
o = s.taboption('general', form.Flag, 'auto', _('Bring up on boot'));
|
o = s.taboption('general', form.Flag, 'auto', _('Bring up on boot'));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.default = o.enabled;
|
o.default = o.enabled;
|
||||||
|
@ -876,7 +877,6 @@ return view.extend({
|
||||||
o = s.children[i];
|
o = s.children[i];
|
||||||
|
|
||||||
switch (o.option) {
|
switch (o.option) {
|
||||||
case 'device':
|
|
||||||
case 'proto':
|
case 'proto':
|
||||||
case 'auto':
|
case 'auto':
|
||||||
case '_dhcp':
|
case '_dhcp':
|
||||||
|
@ -888,6 +888,7 @@ return view.extend({
|
||||||
case 'igmp_snooping':
|
case 'igmp_snooping':
|
||||||
case 'stp':
|
case 'stp':
|
||||||
case 'type':
|
case 'type':
|
||||||
|
case 'device':
|
||||||
var deps = [];
|
var deps = [];
|
||||||
for (var j = 0; j < protocols.length; j++) {
|
for (var j = 0; j < protocols.length; j++) {
|
||||||
if (!protocols[j].isVirtual()) {
|
if (!protocols[j].isVirtual()) {
|
||||||
|
|
Loading…
Reference in a new issue