Also auto-enable the radio upon network join.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ss.tab('general', _('General Setup'));
ss.tab('advanced', _('Advanced Settings'));
ss.tab('general', _('General Setup'));
ss.tab('advanced', _('Advanced Settings'));
- var isDisabled = (radioNet.get('disabled') == '1');
+ var isDisabled = (radioNet.get('disabled') == '1' ||
+ uci.get('wireless', radioNet.getWifiDeviceName(), 'disabled') == 1);
o = ss.taboption('general', form.DummyValue, '_wifistat_modal', _('Status'));
o.cfgvalue = L.bind(function(radioNet) {
o = ss.taboption('general', form.DummyValue, '_wifistat_modal', _('Status'));
o.cfgvalue = L.bind(function(radioNet) {
var section_id = null;
return this.map.save(function() {
var section_id = null;
return this.map.save(function() {
+ var wifi_sections = uci.sections('wireless', 'wifi-iface');
+
if (replopt.formvalue('_new_') == '1') {
if (replopt.formvalue('_new_') == '1') {
- var sections = uci.sections('wireless', 'wifi-iface');
+ for (var i = 0; i < wifi_sections.length; i++)
+ if (wifi_sections[i].device == radioDev.getName())
+ uci.remove('wireless', wifi_sections[i]['.name']);
+ }
+
+ if (uci.get('wireless', radioDev.getName(), 'disabled') == '1') {
+ for (var i = 0; i < wifi_sections.length; i++)
+ if (wifi_sections[i].device == radioDev.getName())
+ uci.set('wireless', wifi_sections[i]['.name'], 'disabled', '1');
- for (var i = 0; i < sections.length; i++)
- if (sections[i].device == radioDev.getName())
- uci.remove('wireless', sections[i]['.name']);
+ uci.unset('wireless', radioDev.getName(), 'disabled');
- section_id = next_free_sid(uci.sections('wifi-iface').length);
+ section_id = next_free_sid(wifi_sections.length);
uci.add('wireless', 'wifi-iface', section_id);
uci.set('wireless', section_id, 'device', radioDev.getName());
uci.add('wireless', 'wifi-iface', section_id);
uci.set('wireless', section_id, 'device', radioDev.getName());