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 <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2021-06-05 16:16:14 +02:00
parent 1bfeec6994
commit 3c6b59504a

View file

@ -1124,6 +1124,18 @@ return view.extend({
if (m) { if (m) {
var devtype = getDevType(section_id); 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'); section_id = uci.add('network', 'device');
uci.set('network', section_id, 'name', m[1]); uci.set('network', section_id, 'name', m[1]);