luci-mod-network: fix changing ifname in disabled legacy bridge mode

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2021-03-29 16:33:07 +02:00
parent f48f9f11e7
commit 7dde01be3c

View file

@ -382,16 +382,19 @@ return baseclass.extend({
disableLegacyBridging = isIface && deviceSectionExists(null, 'br-%s'.format(ifc.getName()), 'bridge'), disableLegacyBridging = isIface && deviceSectionExists(null, 'br-%s'.format(ifc.getName()), 'bridge'),
o, ss; o, ss;
if (isIface) {
var type;
/* If an externally configured br-xxx interface already exists, /* If an externally configured br-xxx interface already exists,
* then disable legacy bridge configuration */ * then disable legacy bridge configuration */
if (disableLegacyBridging) { if (disableLegacyBridging) {
o = this.addOption(s, gensection, form.HiddenValue, 'type'); type = this.addOption(s, gensection, form.HiddenValue, 'type');
o.cfgvalue = function() { return '' }; type.cfgvalue = function() { return '' };
} }
else if (isIface) { else {
var type;
type = this.addOption(s, gensection, form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)')); type = this.addOption(s, gensection, form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)'));
}
type.modalonly = true; type.modalonly = true;
type.disabled = ''; type.disabled = '';
type.enabled = 'bridge'; type.enabled = 'bridge';