Merge pull request #5190 from TDT-AG/pr/20210715-proto-bonding
authorJo-Philipp Wich <jo@mein.io>
Mon, 9 Aug 2021 17:47:23 +0000 (19:47 +0200)
committerGitHub <noreply@github.com>
Mon, 9 Aug 2021 17:47:23 +0000 (19:47 +0200)
luci-proto-bonding: fix member because of API change

protocols/luci-proto-bonding/htdocs/luci-static/resources/protocol/bonding.js

index 5af062aaca42ee9be0bdfa5659200aecbb9be354..4c774290f0b92968319ca03f9bb45f8dd474c707 100644 (file)
@@ -24,14 +24,16 @@ function getSelectableSlaves(section_id) {
                                                var slaves = L.toArray(uci.get('network', interfaces[j]['.name'], 'slaves'));
 
                                                for (var k = 0; k < slaves.length; k++) {
-                                                       if (devices[i].ifname == slaves[k] && interfaces[j]['.name'] != section_id) {
-                                                               in_use = true;
+                                                       if (devices[i].ifname == slaves[k] || devices[i].device == slaves[k]) {
+                                                               if (interfaces[j]['.name'] != section_id) {
+                                                                       in_use = true;
+                                                               }
                                                        }
                                                }
                                        }
                                }
                                if (in_use == false) {
-                                       rv.push(devices[i].ifname);
+                                       devices[i].device == null ? rv.push(devices[i].ifname) : rv.push(devices[i].device)
                                }
                        }
                }