juci-wireless: fix invalid warning for duplicate ssid ref #14804
authorReidar Cederqvist <reidar.cederqvist@gmail.com>
Tue, 24 Apr 2018 10:09:34 +0000 (12:09 +0200)
committerReidar Cederqvist <reidar.cederqvist@gmail.com>
Tue, 24 Apr 2018 10:09:34 +0000 (12:09 +0200)
if you have two interfaces on the same radio with the same ssid it was giving a
warning. this commit removes the warning if one of the interfaces not in AP mode

plugins/juci-wireless/src/widgets/uci.wireless.interface.js

index 4f22f0b..f3e9261 100644 (file)
@@ -115,10 +115,15 @@ JUCI.app
        $scope.onSSIDChanged = function(){
                if(!$scope.interface) return;
                if(!$scope.interfaces) return;
+               /* Ignore non AP interfaces */
+               if($scope.interface.mode && $scope.interface.mode.value != "ap") return;
 
                //Check if SSID is used more than once on the same radio
                var found = $scope.interfaces.find(function(x){
-                       return x != $scope.interface && x.ssid.value == $scope.interface.ssid.value && x.device.value == $scope.interface.device.value;
+                       return x != $scope.interface &&
+                               x.mode.value == "ap" &&
+                               x.ssid.value == $scope.interface.ssid.value &&
+                               x.device.value == $scope.interface.device.value;
                });
 
                if(found)