summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2014-03-21 05:35:50 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-28 13:44:51 +0000
commit405e190b314db29e1332c56376dff026a9631202 (patch)
treef9a7258813022224887fd2ecb81d1b2fe7ebf93e /bitbake/lib/toaster/toastergui/views.py
parent8c3eb5ee4582b6f6d489549290937657f37fc19e (diff)
downloadpoky-405e190b314db29e1332c56376dff026a9631202.tar.gz
bitbake: 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] (Bitbake rev: 09b099903bdf51bfb277b9a8f922255cfe83ab96) Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rw-r--r--bitbake/lib/toaster/toastergui/views.py49
1 files changed, 45 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index d1234fe804..4f31ddb4bf 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -25,7 +25,7 @@ from django.db.models import Q, Sum
25from django.shortcuts import render, redirect 25from django.shortcuts import render, redirect
26from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable 26from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
27from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency 27from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
28from orm.models import Target_Installed_Package, Target_File 28from orm.models import Target_Installed_Package, Target_Image_File
29from django.views.decorators.cache import cache_control 29from django.views.decorators.cache import cache_control
30from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger 30from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
31from django.http import HttpResponseBadRequest 31from django.http import HttpResponseBadRequest
@@ -350,18 +350,59 @@ def builds(request):
350 return render(request, template, context) 350 return render(request, template, context)
351 351
352 352
353##
353# build dashboard for a single build, coming in as argument 354# build dashboard for a single build, coming in as argument
355# Each build may contain multiple targets and each target
356# may generate multiple image files. display them all.
357#
354def builddashboard(request, build_id): 358def builddashboard(request, build_id):
355 template = "builddashboard.html" 359 template = "builddashboard.html"
356 if Build.objects.filter(pk=build_id).count() == 0 : 360 if Build.objects.filter(pk=build_id).count() == 0 :
357 return redirect(builds) 361 return redirect(builds)
362 build = Build.objects.filter(pk = build_id)[0];
363 layerVersionId = Layer_Version.objects.filter( build = build_id );
364 recipeCount = Recipe.objects.filter( layer_version__id__in = layerVersionId ).count( );
365 tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' );
366
367 # set up custom target list with computed package and image data
368 targets = [ ];
369 ntargets = 0;
370 hasImages = False;
371 for t in tgts:
372 elem = { };
373 elem[ 'target' ] = t;
374 if ( t.is_image ):
375 hasImages = True;
376 npkg = 0;
377 pkgsz = 0;
378 pid= 0;
379 tp = Target_Installed_Package.objects.filter( target_id = t.id );
380 package = None;
381 for p in tp:
382 pid = p.package_id;
383 package = Package.objects.get( pk = p.package_id )
384 pkgsz = pkgsz + package.size;
385 npkg = npkg + 1;
386 elem[ 'npkg' ] = npkg;
387 elem[ 'pkgsz' ] = pkgsz;
388 ti = Target_Image_File.objects.filter( target_id = t.id );
389 imageFiles = [ ];
390 for i in ti:
391 imageFiles.append({ 'path': i.file_name, 'size' : i.file_size });
392 elem[ 'imageFiles' ] = imageFiles;
393 targets.append( elem );
394
358 context = { 395 context = {
359 'build' : Build.objects.filter(pk=build_id)[0], 396 'build' : build,
360 'recipecount' : Recipe.objects.filter(layer_version__id__in=Layer_Version.objects.filter(build=build_id)).count(), 397 'hasImages' : hasImages,
361 'logmessages' : LogMessage.objects.filter(build=build_id), 398 'ntargets' : ntargets,
399 'targets' : targets,
400 'recipecount' : recipeCount,
401 'logmessages' : LogMessage.objects.filter(build=build_id),
362 } 402 }
363 return render(request, template, context) 403 return render(request, template, context)
364 404
405
365def task(request, build_id, task_id): 406def task(request, build_id, task_id):
366 template = "task.html" 407 template = "task.html"
367 if Task.objects.filter(pk=task_id).count() == 0 : 408 if Task.objects.filter(pk=task_id).count() == 0 :