summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-04-21 11:38:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-08 17:42:06 +0100
commita4cfca604b2c5ab35baf69c2070afa0087842b68 (patch)
tree9343dc50aba81066a241b76e7ba04274dbb75811
parented26a06a07a75c8039f2a9b251b350331c7474aa (diff)
downloadpoky-a4cfca604b2c5ab35baf69c2070afa0087842b68.tar.gz
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>
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectapp.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
index d52ba73f3d..1fd4a54f57 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
@@ -424,6 +424,24 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
424 $scope.layerAddId = item.id; 424 $scope.layerAddId = item.id;
425 }; 425 };
426 426
427 $scope.machineSelect = function (machineName) {
428 $scope._makeXHRCall({
429 method: "POST", url: $scope.urls.xhr_edit,
430 data: {
431 machineName: machineName,
432 }
433 }).then(function () {
434 $scope.machine.name = machineName;
435
436 $scope.displayAlert($scope.zone2alerts, "You have changed the machine to: <strong>" + $scope.machine.name + "</strong>", "alert-info");
437 var machineDistro = angular.element("#machine-distro");
438
439 angular.element("html, body").animate({ scrollTop: machineDistro.position().top }, 700).promise().done(function() {
440 $animate.addClass(machineDistro, "machines-highlight");
441 });
442 });
443 };
444
427 445
428 $scope.layerAddById = function (id) { 446 $scope.layerAddById = function (id) {
429 $scope.layerAddId = id; 447 $scope.layerAddId = id;
@@ -752,7 +770,9 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
752 770
753 _cmdExecuteWithParam("/machineselect=", function (machine) { 771 _cmdExecuteWithParam("/machineselect=", function (machine) {
754 $scope.machineName = machine; 772 $scope.machineName = machine;
755 $scope.toggle('#select-machine'); 773 $scope.machine.name = machine;
774 $scope.machineSelect(machine);
775
756 }); 776 });
757 777
758 778