diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projectapp.js | 19 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/project.html | 7 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 6 |
3 files changed, 26 insertions, 6 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; }); |
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html index 40048c2f2c..9d51a57208 100644 --- a/bitbake/lib/toaster/toastergui/templates/project.html +++ b/bitbake/lib/toaster/toastergui/templates/project.html | |||
@@ -328,10 +328,10 @@ vim: expandtab tabstop=2 | |||
328 | <h4 class="air"> | 328 | <h4 class="air"> |
329 | Most built targets | 329 | Most built targets |
330 | </h4> | 330 | </h4> |
331 | <ul class="unstyled configuration-list"> | 331 | <ul class="unstyled configuration-list {[mutedtargets]}"> |
332 | <li ng-repeat="t in frequenttargets"> | 332 | <li ng-repeat="t in frequenttargets"> |
333 | <label class="checkbox"> | 333 | <label class="checkbox"> |
334 | <input type="checkbox" ng-model="mostBuiltTargets[t]">{[t]} | 334 | <input type="checkbox" ng-model="mostBuiltTargets[t]" ng-disabled="disableBuildCheckbox(t)" ng-checked="mostBuiltTargets[t] && !disableBuildCheckbox(t)">{[t]} |
335 | </label> | 335 | </label> |
336 | </li> | 336 | </li> |
337 | </ul> | 337 | </ul> |
@@ -443,7 +443,8 @@ angular.element(document).ready(function() { | |||
443 | scope.frequenttargets = {{freqtargets|json}}; | 443 | scope.frequenttargets = {{freqtargets|json}}; |
444 | scope.machine = {{machine|json}}; | 444 | scope.machine = {{machine|json}}; |
445 | scope.releases = {{releases|json}}; | 445 | scope.releases = {{releases|json}}; |
446 | 446 | scope.layerCount = scope.layers.length; | |
447 | scope.mutedtargets = (scope.layerCount == 0 ? "muted" : "") | ||
447 | var now = (new Date()).getTime(); | 448 | var now = (new Date()).getTime(); |
448 | scope.todaydate = now - (now % 86400000); | 449 | scope.todaydate = now - (now % 86400000); |
449 | 450 | ||
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index d999959446..fdd80222ab 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -2204,11 +2204,11 @@ if toastermain.settings.MANAGED: | |||
2204 | freqtargets = [] | 2204 | freqtargets = [] |
2205 | try: | 2205 | try: |
2206 | freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.target_set.all()), Build.objects.filter(project = prj, outcome__lt = Build.IN_PROGRESS)))) | 2206 | freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.target_set.all()), Build.objects.filter(project = prj, outcome__lt = Build.IN_PROGRESS)))) |
2207 | freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.brtarget_set.all()), BuildRequest.objects.filter(project = prj, state__lte = BuildRequest.REQ_QUEUED)))) | 2207 | freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.brtarget_set.all()), BuildRequest.objects.filter(project = prj, state = BuildRequest.REQ_FAILED)))) |
2208 | except TypeError: | 2208 | except TypeError: |
2209 | pass | 2209 | pass |
2210 | freqtargets = Counter(freqtargets) | 2210 | freqtargets = Counter(freqtargets) |
2211 | freqtargets = sorted(freqtargets, key = lambda x: freqtargets[x]) | 2211 | freqtargets = sorted(freqtargets, key = lambda x: freqtargets[x], reverse=True) |
2212 | 2212 | ||
2213 | context = { | 2213 | context = { |
2214 | "project" : prj, | 2214 | "project" : prj, |
@@ -2228,7 +2228,7 @@ if toastermain.settings.MANAGED: | |||
2228 | "branch" : { "name" : x.layercommit.get_vcs_reference(), "layersource" : x.layercommit.up_branch.layer_source.name if x.layercommit.up_branch != None else None}}, | 2228 | "branch" : { "name" : x.layercommit.get_vcs_reference(), "layersource" : x.layercommit.up_branch.layer_source.name if x.layercommit.up_branch != None else None}}, |
2229 | prj.projectlayer_set.all().order_by("id")), | 2229 | prj.projectlayer_set.all().order_by("id")), |
2230 | "targets" : map(lambda x: {"target" : x.target, "task" : x.task, "pk": x.pk}, prj.projecttarget_set.all()), | 2230 | "targets" : map(lambda x: {"target" : x.target, "task" : x.task, "pk": x.pk}, prj.projecttarget_set.all()), |
2231 | "freqtargets": freqtargets, | 2231 | "freqtargets": freqtargets[:5], |
2232 | "releases": map(lambda x: {"id": x.pk, "name": x.name, "description":x.description}, Release.objects.all()), | 2232 | "releases": map(lambda x: {"id": x.pk, "name": x.name, "description":x.description}, Release.objects.all()), |
2233 | "project_html": 1, | 2233 | "project_html": 1, |
2234 | } | 2234 | } |