]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: projectapp Implement machine select command
authorMichael Wood <michael.g.wood@intel.com>
Tue, 21 Apr 2015 10:38:03 +0000 (11:38 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 8 May 2015 16:42:06 +0000 (17:42 +0100)
Use the project page to select the machine rather than setting it and
then redirecting to the project page. This will also avoid having to have a
special handler in the machines page it's self.

(Bitbake rev: 9847e04d86063e4464afb402cb1352243b51f504)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/toaster/toastergui/static/js/projectapp.js

index d52ba73f3d1ba0138057306347e0740434db1df6..1fd4a54f57f254e2bf1d44451f36d4662ec53f7c 100644 (file)
@@ -424,6 +424,24 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
         $scope.layerAddId = item.id;
     };
 
+    $scope.machineSelect = function (machineName) {
+        $scope._makeXHRCall({
+            method: "POST", url: $scope.urls.xhr_edit,
+            data: {
+              machineName:  machineName,
+            }
+        }).then(function () {
+          $scope.machine.name = machineName;
+
+          $scope.displayAlert($scope.zone2alerts, "You have changed the machine to: <strong>" + $scope.machine.name + "</strong>", "alert-info");
+          var machineDistro = angular.element("#machine-distro");
+
+          angular.element("html, body").animate({ scrollTop: machineDistro.position().top }, 700).promise().done(function() {
+            $animate.addClass(machineDistro, "machines-highlight");
+          });
+        });
+    };
+
 
     $scope.layerAddById = function (id) {
         $scope.layerAddId = id;
@@ -752,7 +770,9 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
 
         _cmdExecuteWithParam("/machineselect=", function (machine) {
             $scope.machineName = machine;
-            $scope.toggle('#select-machine');
+            $scope.machine.name = machine;
+            $scope.machineSelect(machine);
+
         });