bitbake: toaster: projectapp Implement machine select command

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>
This commit is contained in:
Michael Wood
2015-04-21 11:38:03 +01:00
committed by Richard Purdie
parent ed26a06a07
commit a4cfca604b

View 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);
});