From: Jo-Philipp Wich Date: Sat, 5 Jun 2021 14:16:14 +0000 (+0200) Subject: luci-mod-interfaces: simplify configuring MAC address of 802.1q devices X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e8dd9331c1242d588766bb75730ccbe7641268fd;p=project%2Fluci.git luci-mod-interfaces: simplify configuring MAC address of 802.1q devices Treat not explicitly configured, preexisting VLAN interfaces as simple network devices when adding configuration for them, since it is more likely that people want to set general device properties such as MAC address instead of reconfiguring ingress/egress QoS mapping, which is the only editable property of preexisting VLAN device config dialogs. Ref: https://github.com/openwrt/luci/issues/5102 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 3c6b59504aaa6ee33a2ee768aafc0aeaefb06004) --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index bb9e63d1e5..2adf2b870e 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -1246,6 +1246,18 @@ return view.extend({ if (m) { var devtype = getDevType(section_id); + /* Treat not explicitly configured, preexisting VLAN interfaces + as simple network devices when adding configuration for them, + since it is more likely that people want to set general device + properties such as MAC address instead of reconfiguring ingress/ + egress QoS mapping, which is the only editable property of + preexisting VLAN device config dialogs. + + Ref: https://github.com/openwrt/luci/issues/5102 + */ + if (devtype == '8021q') + devtype = 'ethernet'; + section_id = uci.add('network', 'device'); uci.set('network', section_id, 'name', m[1]);