diff options
Diffstat (limited to 'modules/luci-mod-status/htdocs/luci-static/resources/view')
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js index 7cb3e78e7a..333884449f 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js @@ -48,21 +48,18 @@ return baseclass.extend({ ev.currentTarget.disabled = true; ev.currentTarget.blur(); - if (exec == 'addlist') { - var macs = [ mac ] + /* Disconnect client before adding to maclist */ + wifinet.disconnectClient(mac, true, 5, 60000); - for (var mac in this.iface_maclist) { - macs.push(mac) - } + if (exec == 'addlist') { + wifinet.maclist.push(mac); - uci.set('wireless', wifinet.sid, 'maclist', macs); + uci.set('wireless', wifinet.sid, 'maclist', wifinet.maclist); return uci.save() .then(L.bind(L.ui.changes.init, L.ui.changes)) .then(L.bind(L.ui.changes.displayChanges, L.ui.changes)); } - - wifinet.disconnectClient(mac, true, 5, 60000); }, handleGetWPSStatus: function(wifinet) { @@ -121,7 +118,7 @@ return baseclass.extend({ var WPS_button = null; - if (this.isWPSEnabled[net.sid]) { + if (net.isWPSEnabled) { if (net.wps_status == 'Active') { WPS_button = E('button', { 'class' : 'cbi-button cbi-button-remove', @@ -190,7 +187,7 @@ return baseclass.extend({ }, this, radios_networks_hints[i]))); if (hasWPS && uci.get('wireless', radios_networks_hints[i].sid, 'wps_pushbutton') == '1') { - this.isWPSEnabled[radios_networks_hints[i].sid] = true; + radios_networks_hints[i].isWPSEnabled = true; tasks.push(L.resolveDefault(this.handleGetWPSStatus(radios_networks_hints[i].getIfname()), null) .then(L.bind(function(net, data) { net.wps_status = data ? data.pbc_status : _('No Data'); @@ -204,8 +201,6 @@ return baseclass.extend({ }, this)); }, - isDeviceAdded: {}, - render: function(data) { var seen = {}, radios = data[0], @@ -236,14 +231,14 @@ return baseclass.extend({ var rows = []; for (var i = 0; i < networks.length; i++) { - var macfilter = uci.get('wireless', networks[i].sid, 'macfilter'); + var macfilter = uci.get('wireless', networks[i].sid, 'macfilter'), + maclist = {}; if (macfilter != null && macfilter != 'disable') { - this.isDeviceAdded = {}; - var macs = L.toArray(uci.get('wireless', networks[i].sid, 'maclist')); - for (var j = 0; j < macs.length; j++) { - var mac = macs[j].toUpperCase(); - this.isDeviceAdded[mac] = true; + networks[i].maclist = L.toArray(uci.get('wireless', networks[i].sid, 'maclist')); + for (var j = 0; j < networks[i].maclist.length; j++) { + var mac = networks[i].maclist[j].toUpperCase(); + maclist[mac] = true; } } @@ -326,7 +321,7 @@ return baseclass.extend({ if (assoclist.firstElementChild.childNodes.length < 6) assoclist.firstElementChild.appendChild(E('th', { 'class': 'th cbi-section-actions' })); - if (macfilter != null && macfilter != 'disable' && !this.isDeviceAdded[bss.mac]) { + if (macfilter != null && macfilter != 'disable' && !maclist[bss.mac]) { row.push(new L.ui.ComboButton('button', { 'addlist': macfilter == 'allow' ? _('Add to Whitelist') : _('Add to Blacklist'), 'disconnect': _('Disconnect') |