diff options
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projectapp.js | 25 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/project.html | 6 |
2 files changed, 25 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js index 74471a1a51..bee3c56be2 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js +++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js | |||
| @@ -337,8 +337,12 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc | |||
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | $scope.buildExistingTarget = function(targets) { | 339 | $scope.buildExistingTarget = function(targets) { |
| 340 | $scope.buildTargetList(targets.map(function(v,i,a){return v.target})); | ||
| 341 | } | ||
| 342 | |||
| 343 | $scope.buildTargetList = function(targetlist) { | ||
| 340 | var oldTargetName = $scope.targetName; | 344 | var oldTargetName = $scope.targetName; |
| 341 | $scope.targetName = targets.map(function(v,i,a){return v.target}).join(' '); | 345 | $scope.targetName = targetlist.join(' '); |
| 342 | $scope.buildNamedTarget(); | 346 | $scope.buildNamedTarget(); |
| 343 | $scope.targetName = oldTargetName; | 347 | $scope.targetName = oldTargetName; |
| 344 | } | 348 | } |
| @@ -733,12 +737,27 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc | |||
| 733 | angular.element(id+"-opposite").toggle(); | 737 | angular.element(id+"-opposite").toggle(); |
| 734 | } | 738 | } |
| 735 | 739 | ||
| 736 | $scope.selectedMostBuildTargets = function () { | 740 | /** |
| 737 | keys = Object.keys($scope.mostBuiltTargets); | 741 | * Functionality related to "Most build targets" |
| 742 | */ | ||
| 743 | |||
| 744 | $scope.enableBuildSelectedTargets = function () { | ||
| 745 | var keys = Object.keys($scope.mostBuiltTargets); | ||
| 738 | keys = keys.filter(function (e) { if ($scope.mostBuiltTargets[e]) return e }); | 746 | keys = keys.filter(function (e) { if ($scope.mostBuiltTargets[e]) return e }); |
| 739 | return keys.length == 0; | 747 | return keys.length == 0; |
| 740 | } | 748 | } |
| 741 | 749 | ||
| 750 | $scope.buildSelectedTargets = function () { | ||
| 751 | var keys = Object.keys($scope.mostBuiltTargets); | ||
| 752 | keys = keys.filter(function (e) { if ($scope.mostBuiltTargets[e]) return e }); | ||
| 753 | |||
| 754 | $scope.buildTargetList(keys); | ||
| 755 | for (var i = 0; i < keys.length; i++) | ||
| 756 | { | ||
| 757 | $scope.mostBuiltTargets[keys[i]] = 0; | ||
| 758 | } | ||
| 759 | } | ||
| 760 | |||
| 742 | /** | 761 | /** |
| 743 | * Helper function to deal with error string recognition and manipulation | 762 | * Helper function to deal with error string recognition and manipulation |
| 744 | */ | 763 | */ |
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html index 815c24c4b5..fe3bcf29e0 100644 --- a/bitbake/lib/toaster/toastergui/templates/project.html +++ b/bitbake/lib/toaster/toastergui/templates/project.html | |||
| @@ -92,7 +92,7 @@ vim: expandtab tabstop=2 | |||
| 92 | <form class="build-form" ng-submit="buildNamedTarget()"> | 92 | <form class="build-form" ng-submit="buildNamedTarget()"> |
| 93 | <div class="input-append controls"> | 93 | <div class="input-append controls"> |
| 94 | <input type="text" class="huge span7" placeholder="Type the target(s) you want to build" autocomplete="off" ng-model="targetName" typeahead="e.name for e in getAutocompleteSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"/> | 94 | <input type="text" class="huge span7" placeholder="Type the target(s) you want to build" autocomplete="off" ng-model="targetName" typeahead="e.name for e in getAutocompleteSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"/> |
| 95 | <button type="submit" id="build-button" class="btn btn-large btn-primary" ng-disabled="!targetName.length"> | 95 | <button type="submit" class="btn btn-large btn-primary" ng-disabled="!targetName.length"> |
| 96 | Build | 96 | Build |
| 97 | </button> | 97 | </button> |
| 98 | </div> | 98 | </div> |
| @@ -289,7 +289,7 @@ vim: expandtab tabstop=2 | |||
| 289 | <form ng-submit="buildNamedTarget()"> | 289 | <form ng-submit="buildNamedTarget()"> |
| 290 | <div class="input-append"> | 290 | <div class="input-append"> |
| 291 | <input type="text" class="input-xlarge" placeholder="Type the target(s) you want to build" autocomplete="off" data-minLength="1" ng-model="targetName1" typeahead="e.name for e in getAutocompleteSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"> | 291 | <input type="text" class="input-xlarge" placeholder="Type the target(s) you want to build" autocomplete="off" data-minLength="1" ng-model="targetName1" typeahead="e.name for e in getAutocompleteSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"> |
| 292 | <button type="submit" id="build-button" class="btn btn-primary" ng-disabled="!targetName1.length"> | 292 | <button type="submit" class="btn btn-primary" ng-disabled="!targetName1.length"> |
| 293 | Build </button> | 293 | Build </button> |
| 294 | </div> | 294 | </div> |
| 295 | {% csrf_token %} | 295 | {% csrf_token %} |
| @@ -306,7 +306,7 @@ vim: expandtab tabstop=2 | |||
| 306 | </label> | 306 | </label> |
| 307 | </li> | 307 | </li> |
| 308 | </ul> | 308 | </ul> |
| 309 | <button class="btn btn-large btn-primary" ng-disabled="selectedMostBuildTargets()">Build selected targets</button> | 309 | <button class="btn btn-large btn-primary" ng-disabled="enableBuildSelectedTargets()" ng-click="buildSelectedTargets()">Build selected targets</button> |
| 310 | </div> | 310 | </div> |
| 311 | </div> | 311 | </div> |
| 312 | 312 | ||
