luci-mod-network: use "ports" option for setting bridge ports
authorRafał Miłecki <rafal@milecki.pl>
Mon, 17 May 2021 12:01:24 +0000 (14:01 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 27 May 2021 10:19:08 +0000 (12:19 +0200)
netifd has been recently patched to use more accurate "ports" option
instead of "ifname"

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a90115cd82372eaaa0ed531800b568387e200c97)

modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index b4d941c60d2f7e7b485efc2c874329490e278829..12ed08ad17da034426107a5f8561e2fa38046cfd 100644 (file)
@@ -499,7 +499,7 @@ return baseclass.extend({
                o.multiple = true;
                o.noaliases = true;
                o.nobridges = true;
-               o.ucioption = 'ifname';
+               o.ucioption = 'ports';
                o.write = o.remove = setIfActive;
                o.default = L.toArray(dev ? dev.getPorts() : null).filter(function(p) { return p.getType() != 'wifi' }).map(function(p) { return p.getName() });
                o.filter = function(section_id, device_name) {
@@ -509,7 +509,7 @@ return baseclass.extend({
 
                        /* only show wifi networks which are already present in "option ifname" */
                        if (choice_dev.getType() == 'wifi') {
-                               var ifnames = L.toArray(uci.get('network', section_id, 'ifname'));
+                               var ifnames = L.toArray(uci.get('network', section_id, 'ports'));
 
                                for (var i = 0; i < ifnames.length; i++)
                                        if (ifnames[i] == device_name)
@@ -918,8 +918,8 @@ return baseclass.extend({
 
                var seen_ports = {};
 
-               L.toArray(uci.get('network', s.section, 'ifname')).forEach(function(ifname) {
-                       seen_ports[ifname] = true;
+               L.toArray(uci.get('network', s.section, 'ports')).forEach(function(port) {
+                       seen_ports[port] = true;
                });
 
                uci.sections('network', 'bridge-vlan', function(bvs) {