From 64d099f6909ad2a66babf50ae9eadf20b367cba5 Mon Sep 17 00:00:00 2001 From: bergware Date: Thu, 27 Mar 2025 04:56:03 +0100 Subject: [PATCH] Wireless enhancements - Added "Regulatory region" selection - Added "automatic" choice in security selection for manually configured networks - Added support for "auto" security setting on initial boot --- emhttp/plugins/dynamix/Wireless.page | 45 +++++++---- emhttp/plugins/dynamix/include/Wireless.php | 4 +- emhttp/plugins/dynamix/include/regions.key | 83 +++++++++++++++++++++ emhttp/plugins/dynamix/sheets/Wireless.css | 4 +- etc/rc.d/rc.wireless | 27 +++++-- 5 files changed, 140 insertions(+), 23 deletions(-) create mode 100644 emhttp/plugins/dynamix/include/regions.key diff --git a/emhttp/plugins/dynamix/Wireless.page b/emhttp/plugins/dynamix/Wireless.page index c2da55b00..777fed763 100644 --- a/emhttp/plugins/dynamix/Wireless.page +++ b/emhttp/plugins/dynamix/Wireless.page @@ -16,8 +16,9 @@ Cond="file_exists('/sys/class/net/wlan0')" */ ?>
 
@@ -27,14 +28,26 @@ if (file_exists($cfg)) $wlan0 = parse_ini_file($cfg,true)['wlan0']; _(Wi-Fi)_: -: +_(Regulatory region)_: +: _(Manual input)_ [XX]: +   : +
_(Connected)_: @@ -77,7 +90,7 @@ function update_wifi(load) { } function manage_wifi(ssid,task) { - if (task==2) { + if (task == 2) { clearTimeout(timers.wifi); $.post('/webGui/include/Wireless.php',{cmd:'forget',ssid:ssid},function(){ swal.close(); @@ -96,18 +109,22 @@ function manage_wifi(ssid,task) { } } -function showDHCP(val,v) { - if (val=='no') { +function showManual(val) { + if (val == '00') $('#manual').show(); else $('#manual').hide(); +} + +function showDHCP(val, v) { + if (val == 'no') { $('tr.static'+v).show(); $('select[name=DNS'+v+']').val('yes'); $('select[name=DNS'+v+'] option:eq(0)').prop('disabled',true); - if (v=='6') $('tr.dns6').show(); + if (v == '6') $('tr.dns6').show(); $('tr.server'+v).show(); - } else if (val=='yes') { + } else if (val == 'yes') { $('tr.static'+v).hide(); $('select[name=DNS'+v+']').val('no'); $('select[name=DNS'+v+'] option:eq(0)').prop('disabled',false); - if (v=='6') $('tr.dns6').show(); + if (v == '6') $('tr.dns6').show(); $('tr.server'+v).hide(); } else { $('tr.static'+v).hide(); @@ -116,9 +133,9 @@ function showDHCP(val,v) { } } -function showDNS(val,v) { - if (val=='no') $('tr.server'+v).hide(); - if (val=='yes') $('tr.server'+v).show(); +function showDNS(val, v) { + if (val == 'no') $('tr.server'+v).hide(); + if (val == 'yes') $('tr.server'+v).show(); } function showPassword() { @@ -133,9 +150,9 @@ function showPassword() { } function showSecurity(val) { - if (val=='none') { + if (val == 'open') { $('#username,#password').hide(); - } else if (val.slice(-1)=='e') { + } else if (val.substr(0,4) == 'IEEE' || val == 'auto') { $('#username,#password').show(); } else { $('#username').hide(); diff --git a/emhttp/plugins/dynamix/include/Wireless.php b/emhttp/plugins/dynamix/include/Wireless.php index 86d11588b..fb808f2d9 100644 --- a/emhttp/plugins/dynamix/include/Wireless.php +++ b/emhttp/plugins/dynamix/include/Wireless.php @@ -186,8 +186,8 @@ case 'join': } if ($manual || $safe) { echo ""._('Security')."