summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/projectapp.js
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2015-03-14 09:00:15 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-25 12:39:58 +0000
commiteeef93ad072cce86de9c59d51df2b8ccc4349b2e (patch)
tree1e74f541d0d62dda71bc1f298ebd0e36a8a9f68c /bitbake/lib/toaster/toastergui/static/js/projectapp.js
parent1a4c8a849ac14e6a7a90d5730758b010b68ffd9f (diff)
downloadpoky-eeef93ad072cce86de9c59d51df2b8ccc4349b2e.tar.gz
bitbake: toaster: most-build-targets bug fixes
Fixes for the following for the "Most built targets" section of the project page: 1) limit the number of most built targets to 5, 2) order the list of most built targets by build count, 3) select only those builds that had build status of 'fail', 'success', or a BuildRequest of 'failed', 4) if there are no layers in the project then (on refresh) all of the checkboxes in the 'Most built targets' list are disabled. Note that per agreement with UI designer, the only sort on the most target list is build count as described in (3) above; secondary sorting is random. [YOCTO #7177] (Bitbake rev: dda2f07193e740860f4497c3761d340d8c5c2b41) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/projectapp.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectapp.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
index 26e054dc23..0b6e0126dd 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
@@ -484,11 +484,13 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
484 layerAdd: selectedArray.join(","), 484 layerAdd: selectedArray.join(","),
485 } 485 }
486 }).then(function () { 486 }).then(function () {
487 $scope.adjustMostBuiltItems(selectedArray.length);
487 $scope.layerAddName = undefined; 488 $scope.layerAddName = undefined;
488 }); 489 });
489 }); 490 });
490 } 491 }
491 else { 492 else {
493 $scope.adjustMostBuiltItems(1);
492 $scope._makeXHRCall({ 494 $scope._makeXHRCall({
493 method: "POST", url: $scope.urls.xhr_edit, 495 method: "POST", url: $scope.urls.xhr_edit,
494 data: { 496 data: {
@@ -503,6 +505,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
503 }; 505 };
504 506
505 $scope.layerDel = function(id) { 507 $scope.layerDel = function(id) {
508 $scope.adjustMostBuiltItems(-1);
506 $scope._makeXHRCall({ 509 $scope._makeXHRCall({
507 method: "POST", url: $scope.urls.xhr_edit, 510 method: "POST", url: $scope.urls.xhr_edit,
508 data: { 511 data: {
@@ -511,6 +514,14 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
511 }); 514 });
512 }; 515 };
513 516
517 $scope.adjustMostBuiltItems = function(listDelta) {
518 $scope.layerCount += listDelta;
519 $scope.mutedtargets = ($scope.layerCount == 0 ? "muted" : "");
520 };
521
522/*
523*/
524
514 525
515 /** 526 /**
516 * Verifies if a project settings change would trigger layer updates. If user confirmation is needed, 527 * Verifies if a project settings change would trigger layer updates. If user confirmation is needed,
@@ -799,6 +810,14 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
799 return keys.length === 0; 810 return keys.length === 0;
800 }; 811 };
801 812
813 $scope.disableBuildCheckbox = function(t) {
814 if ( $scope.layerCount == 0 ) {
815 $scope.mostBuiltTargets[t] = 0;
816 return true;
817 };
818 return false;
819 }
820
802 $scope.buildSelectedTargets = function () { 821 $scope.buildSelectedTargets = function () {
803 var keys = Object.keys($scope.mostBuiltTargets); 822 var keys = Object.keys($scope.mostBuiltTargets);
804 keys = keys.filter(function (e) { if ($scope.mostBuiltTargets[e]) return e; }); 823 keys = keys.filter(function (e) { if ($scope.mostBuiltTargets[e]) return e; });