From 7dde01be3cc197f79bc6812a2c912c1889dbf1ee Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 29 Mar 2021 16:33:07 +0200 Subject: luci-mod-network: fix changing ifname in disabled legacy bridge mode Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/tools/network.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'modules/luci-mod-network') diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js index 4eee9f9576..544cad2c75 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -382,16 +382,19 @@ return baseclass.extend({ disableLegacyBridging = isIface && deviceSectionExists(null, 'br-%s'.format(ifc.getName()), 'bridge'), o, ss; - /* If an externally configured br-xxx interface already exists, - * then disable legacy bridge configuration */ - if (disableLegacyBridging) { - o = this.addOption(s, gensection, form.HiddenValue, 'type'); - o.cfgvalue = function() { return '' }; - } - else if (isIface) { + if (isIface) { var type; - type = this.addOption(s, gensection, form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)')); + /* If an externally configured br-xxx interface already exists, + * then disable legacy bridge configuration */ + if (disableLegacyBridging) { + type = this.addOption(s, gensection, form.HiddenValue, 'type'); + type.cfgvalue = function() { return '' }; + } + else { + type = this.addOption(s, gensection, form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)')); + } + type.modalonly = true; type.disabled = ''; type.enabled = 'bridge'; -- cgit v1.2.3