diff --git a/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js b/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js index fbe4e2d08..fabb84903 100644 --- a/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js +++ b/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js @@ -1,5 +1,5 @@ $juci.module("router") -.controller("InternetExHostPageCtrl", function($scope, $rpc, $config, $uci){ +.controller("InternetExHostPageCtrl", function($scope, $rpc, $config, $uci, $tr){ $scope.exposedHostEnabled = 0; $scope.wan = {}; $scope.lan = {}; @@ -27,10 +27,10 @@ $juci.module("router") }; $scope.onSave = function(){ $uci.set("firewall.dmz", $scope.dmz).done(function(){ - $scope.info_message = "Settings saved!"; + $scope.info_message = $tr("STR_SETTINGSSAVED"); $scope.$apply(); }).fail(function(){ - $scope.error_message = "Saving failed!"; + $scope.error_message = $tr("STR_SETTINGSSAVEFAILED"); }); setTimeout(function(){ $scope.error_message = null; diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.general.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.html index 3f1df64ae..7913eb9fc 100644 --- a/luciexpress/htdocs/plugins/wifi/pages/wifi.general.html +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.html @@ -2,21 +2,27 @@

General WiFi Settings

Your EasyBox supports the industry-wide WiFi standards, enabling easy wireless connection of your devices.

+
Wifi Network
-
+
+ +
Enable WiFi On/Off button on EasyBox
-
+
-
+
+

{{info}}

+
+

Setup

@@ -31,7 +37,7 @@ @@ -61,7 +67,7 @@ @@ -145,7 +151,7 @@
Wifi Name (SSID)
-
+
Protection Mode
- @@ -77,7 +83,7 @@
Wifi Password
-
+

Display Characters:

@@ -99,13 +105,13 @@
Wifi Name (SSID)
-
+
Broadcast SSID
-
+
Wifi Password
-
+

Display Characters:

diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js index e624678e7..aa26134c7 100644 --- a/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js @@ -1,5 +1,5 @@ $juci.module("wifi") -.controller("WifiGeneralPageCtrl", function($scope){ +.controller("WifiGeneralPageCtrl", function($scope, $uci, $tr){ $scope.wifiEnabled = 1; $scope.mainWifiEnabled = 1; $scope.wifiButtonEnabled = 1; @@ -23,4 +23,51 @@ $juci.module("wifi") label: "WEP" }]; $scope.wifiPassword = "123123"; + + $scope.wifiCheckEnabled = function(){ + if(!$scope.radios) return 0; + $scope.wifiEnabled = $scope.radios + .filter(function(x) { return x.radio == "on"; }) + .length > 0; + return $scope.wifiEnabled; + } + + $scope.onWifiEnable = function(){ + if(!$scope.radios) { + $scope.wifiEnabled = !$scope.wifiEnabled; + return; + } + var enabled = $scope.wifiEnabled; + if(enabled) $scope.info = $tr("STR_ENABLINGWIFIRADIOS"); + else $scope.info = $tr("STR_DISABLINGWIFIRADIOS"); + async.eachSeries($scope.radios, function(radio, next) { + radio.radio = ((enabled)?"on":"off"); + $uci.set("wireless."+radio[".name"], radio).always(function(){ + console.log("Disabling "+radio[".name"]+" "+radio.radio); + next(); + }); + }, function(){ + $scope.info = null; + $scope.$apply(); + }); + } + $scope.onGuestEnable = function(){ + + } + $uci.show("wireless").done(function(interfaces){ + var list = Object.keys(interfaces) + .map(function(x){ return interfaces[x]; }); + $scope.radios = list.filter(function(x) { return x[".name"].indexOf("wl") == 0; }); + $scope.virtual_radios = list.filter(function(x) { return x.device && x[".name"].indexOf("wl") != 0; }); + if($scope.virtual_radios.length > 0) { // TODO: get main/guest from config + var radio = $scope.virtual_radios[0]; + $scope.main_wifi = { interface: radio, device: interfaces[radio.device] }; + } + if($scope.virtual_radios.length > 1) { // TODO: get main/guest from config + var radio = $scope.virtual_radios[1]; + $scope.guest_wifi = { interface: radio, device: interfaces[radio.device] }; + } + $scope.guestWifiEnabled = $scope.guest_wifi.interface.up == '1'; + $scope.$apply(); + }); });