Эх сурвалжийг харах

Fix Networking Interface actions bug

DSR! 2 жил өмнө
parent
commit
ec150e4d60

+ 2 - 2
src/pineapple/modules/Networking/api/module.php

@@ -294,7 +294,7 @@ class Networking extends SystemModule
         }
 
         exec($command, $info);
-        $this->response = implode("\n", $info);
+        $this->response = ["info" => implode("\n", $info)];
     }
 
     private function interfaceActions()
@@ -315,6 +315,6 @@ class Networking extends SystemModule
         }
 
         exec($command, $info);
-        $this->response = implode("\n", $info);
+        $this->response = ["info" => implode("\n", $info)];
     }
 }

+ 2 - 3
src/pineapple/modules/Networking/js/module.js

@@ -215,9 +215,8 @@ registerController('NetworkingModeController', ['$api', '$scope', '$timeout', fu
             type: type,
             interface: wlan
         }, function(response) {
+            $scope.actions = '';
             if (response.error === undefined) {
-                $scope.actions = response;
-
                 // reload interfaces in monitor command cases
                 if (type === 3 || type === 4) {
                     $scope.getInterfaces();
@@ -234,7 +233,7 @@ registerController('NetworkingModeController', ['$api', '$scope', '$timeout', fu
             type: type
         }, function(response) {
             if (response.error === undefined) {
-                $scope.info = response;
+                $scope.info = response.info;
             }
         });
     });