summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-02-13 23:49:48 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-02-13 23:49:48 +0100
commit6c317248bae87fb7e9edeba351d328907f346cc4 (patch)
tree8b0a959a6f0d9a2f716e59784aa6321f0e5701f9
parentc716d8e7e770eb2ad2be8a99be1543c211f964d4 (diff)
downloadluci2-ui-6c317248bae87fb7e9edeba351d328907f346cc4.tar.gz
luci2.wireless: fix WDS interface status in getWirelessStatus()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--luci2/htdocs/luci2/wireless.js14
1 files changed, 13 insertions, 1 deletions
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);
}