diff options
author | David Reyna <David.Reyna@windriver.com> | 2014-03-21 05:35:50 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-28 13:44:26 +0000 |
commit | 09b099903bdf51bfb277b9a8f922255cfe83ab96 (patch) | |
tree | e20c296b925530ff4830e67ec7f3c0d3b524addb /lib/toaster/toastergui/views.py | |
parent | 794680f6480e0aea65f2ea611730083bc4aad0d5 (diff) | |
download | bitbake-09b099903bdf51bfb277b9a8f922255cfe83ab96.tar.gz |
toaster: add Image detail and multiple targets to dashboard
Filled in the Image section detail information and allow for multiple targets.
Each target has a separate section. Added license manifest display. Changed the
target of the license manifest link. Added Tasks failed in the build summary.
The target lists required filters to create sorted lists.
[YOCTO #4258]
[YOCTO #5936]
Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Diffstat (limited to 'lib/toaster/toastergui/views.py')
-rw-r--r-- | lib/toaster/toastergui/views.py | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py index d1234fe80..4f31ddb4b 100644 --- a/lib/toaster/toastergui/views.py +++ b/lib/toaster/toastergui/views.py @@ -25,7 +25,7 @@ from django.db.models import Q, Sum from django.shortcuts import render, redirect from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency -from orm.models import Target_Installed_Package, Target_File +from orm.models import Target_Installed_Package, Target_Image_File from django.views.decorators.cache import cache_control from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponseBadRequest @@ -350,18 +350,59 @@ def builds(request): return render(request, template, context) +## # build dashboard for a single build, coming in as argument +# Each build may contain multiple targets and each target +# may generate multiple image files. display them all. +# def builddashboard(request, build_id): template = "builddashboard.html" if Build.objects.filter(pk=build_id).count() == 0 : return redirect(builds) + build = Build.objects.filter(pk = build_id)[0]; + layerVersionId = Layer_Version.objects.filter( build = build_id ); + recipeCount = Recipe.objects.filter( layer_version__id__in = layerVersionId ).count( ); + tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' ); + + # set up custom target list with computed package and image data + targets = [ ]; + ntargets = 0; + hasImages = False; + for t in tgts: + elem = { }; + elem[ 'target' ] = t; + if ( t.is_image ): + hasImages = True; + npkg = 0; + pkgsz = 0; + pid= 0; + tp = Target_Installed_Package.objects.filter( target_id = t.id ); + package = None; + for p in tp: + pid = p.package_id; + package = Package.objects.get( pk = p.package_id ) + pkgsz = pkgsz + package.size; + npkg = npkg + 1; + elem[ 'npkg' ] = npkg; + elem[ 'pkgsz' ] = pkgsz; + ti = Target_Image_File.objects.filter( target_id = t.id ); + imageFiles = [ ]; + for i in ti: + imageFiles.append({ 'path': i.file_name, 'size' : i.file_size }); + elem[ 'imageFiles' ] = imageFiles; + targets.append( elem ); + context = { - 'build' : Build.objects.filter(pk=build_id)[0], - 'recipecount' : Recipe.objects.filter(layer_version__id__in=Layer_Version.objects.filter(build=build_id)).count(), - 'logmessages' : LogMessage.objects.filter(build=build_id), + 'build' : build, + 'hasImages' : hasImages, + 'ntargets' : ntargets, + 'targets' : targets, + 'recipecount' : recipeCount, + 'logmessages' : LogMessage.objects.filter(build=build_id), } return render(request, template, context) + def task(request, build_id, task_id): template = "task.html" if Task.objects.filter(pk=task_id).count() == 0 : |