Skip to content

Commit

Permalink
luci-app-usteer: retrieve SSIDs to be used in the config
Browse files Browse the repository at this point in the history
This commit retrieves the list of SSIDs availables to prepopulate the ssid_list UI element of the config.

Signed-off-by: Miguel Angel Mulero Martinez <migmul@gmail.com>
  • Loading branch information
McGiverGim authored and systemcrash committed Feb 5, 2024
1 parent 0fbe58e commit 5b6a705
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
'require ui';
'require form';
'require uci';
'require network';
'require tools.widgets as widgets';

var Hosts, Remotehosts, Remoteinfo, Localinfo, Clients;
var Hosts, Remotehosts, Remoteinfo, Localinfo, Clients, WifiNetworks;

var dns_cache = [];

Expand Down Expand Up @@ -326,7 +327,8 @@ return view.extend({
this.callGetRemotehosts().catch (function (){return null;}),
this.callGetRemoteinfo().catch (function (){return null;}),
this.callGetLocalinfo().catch (function (){return null;}),
this.callGetClients().catch (function (){return null;})
this.callGetClients().catch (function (){return null;}),
network.getWifiNetworks()
]);
},

Expand Down Expand Up @@ -379,6 +381,7 @@ return view.extend({
Remoteinfo = data[3];
Localinfo = data[4];
Clients = data[5];
WifiNetworks = data[6];

s = m.section(form.TypedSection);
s.anonymous = true;
Expand Down Expand Up @@ -606,7 +609,12 @@ return view.extend({
o.optional = true;
o.datatype = 'list(string)';

o = s.taboption('settings', form.DynamicList, 'ssid_list', _('SSID list'), _('List of SSIDs to enable steering on'));
o = s.taboption('settings', form.MultiValue, 'ssid_list', _('SSID list'), _('List of SSIDs to enable steering on'));
WifiNetworks.forEach(function (wifiNetwork) {
if (wifiNetwork.getSSID()) {
o.value(wifiNetwork.getSSID())
}
});
o.optional = true;
o.datatype = 'list(string)';

Expand Down

0 comments on commit 5b6a705

Please sign in to comment.