From: Jo-Philipp Wich Date: Fri, 13 Feb 2015 22:49:48 +0000 (+0100) Subject: luci2.wireless: fix WDS interface status in getWirelessStatus() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6c317248bae87fb7e9edeba351d328907f346cc4;p=project%2Fluci2%2Fui.git luci2.wireless: fix WDS interface status in getWirelessStatus() Signed-off-by: Jo-Philipp Wich --- diff --git a/luci2/htdocs/luci2/wireless.js b/luci2/htdocs/luci2/wireless.js index 1ba6b81..c724f85 100644 --- a/luci2/htdocs/luci2/wireless.js +++ b/luci2/htdocs/luci2/wireless.js @@ -63,6 +63,7 @@ Class.extend({ return L.rpc.flush(); }).then(function(networks) { var rv = { }; + var net_by_devname = { }; var phy_attrs = [ 'country', 'channel', 'frequency', 'frequency_offset', @@ -80,7 +81,7 @@ Class.extend({ rv[networks[i].phy] = { networks: [ ] } ); - var net = { + var net = net_by_devname[networks[i].device] = { device: networks[i].device }; @@ -90,6 +91,17 @@ Class.extend({ for (var j = 0; j < net_attrs.length; j++) net[net_attrs[j]] = networks[i][net_attrs[j]]; + /* copy parent interface properties to wds interfaces */ + if (net.device.match(/^(.+)\.sta\d+$/) && + net_by_devname[RegExp.$1]) + { + var pnet = net_by_devname[RegExp.$1]; + for (var j = 0; j < net_attrs.length; j++) + if (typeof(networks[i][net_attrs[j]]) === 'undefined' || + net_attrs[j] == 'encryption') + net[net_attrs[j]] = pnet[net_attrs[j]]; + } + phy.networks.push(net); }