From 6c317248bae87fb7e9edeba351d328907f346cc4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 13 Feb 2015 23:49:48 +0100 Subject: [PATCH] luci2.wireless: fix WDS interface status in getWirelessStatus() Signed-off-by: Jo-Philipp Wich --- luci2/htdocs/luci2/wireless.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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); } -- 2.11.0