From 335c975650580001b2176020c762c002bde198d6 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Wed, 17 Jun 2015 12:27:48 +0100 Subject: bitbake: toaster: fixes after replacing BuildRequest with Build This is a set of fixes that repair the interface after we switched from displaying BuildRequest data to Build data in the formerly "managed" mode. (Bitbake rev: 57f790b0c56297af8c83d5def8461bd5d61fe4af) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/projectapp.js | 4 ++-- bitbake/lib/toaster/toastergui/templates/project.html | 4 ++-- bitbake/lib/toaster/toastergui/views.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/toaster/toastergui') diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js index 40e2e1fffa..ea44bf34f1 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js +++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js @@ -132,8 +132,8 @@ projectApp.filter('timediff', function() { var seconds = parseInt(input); var minutes = Math.floor(seconds / 60); seconds = seconds - minutes * 60; - var hours = Math.floor(seconds / 3600); - seconds = seconds - hours * 3600; + var hours = Math.floor(minutes / 60); + minutes = minutes - hours * 60; return pad(hours) + ":" + pad(minutes) + ":" + pad(seconds); }; }); diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html index 1a8991fda4..b5d97cb419 100644 --- a/bitbake/lib/toaster/toastergui/templates/project.html +++ b/bitbake/lib/toaster/toastergui/templates/project.html @@ -145,7 +145,7 @@ vim: expandtab tabstop=2

Latest builds

-
+
@@ -182,7 +182,7 @@ vim: expandtab tabstop=2
- +
Build queued diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 2336ae3bec..00b1387d63 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -64,7 +64,9 @@ def _get_latest_builds(prj=None): if prj is not None: queryset = queryset.filter(project = prj) - return itertools.chain(queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-pk")[:3], queryset.filter(outcome=Build.IN_PROGRESS).order_by("-pk")) + return itertools.chain( + queryset.filter(outcome=Build.IN_PROGRESS).order_by("-pk"), + queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-pk")[:3] ) # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed @@ -76,7 +78,7 @@ def _project_recent_build_list(prj): "id": x.pk, "targets" : map(lambda y: {"target": y.target, "task": y.task }, x.target_set.all()), # TODO: create the task entry in the Target table "status": x.get_current_status(), - "errors": map(lambda y: {"type": y.lineno, "msg": y.message, "tb": y.pathname}, x.logmessage_set.filter(level__gte=LogMessage.WARNING)), + "errors": map(lambda y: {"type": y.lineno, "msg": y.message, "tb": y.pathname}, (x.logmessage_set.filter(level__gte=LogMessage.WARNING)|x.logmessage_set.filter(level=LogMessage.EXCEPTION))), "updated": x.completed_on.strftime('%s')+"000", "command_time": (x.completed_on - x.started_on).total_seconds(), "br_page_url": reverse('buildrequestdetails', args=(x.project.id, x.pk) ), -- cgit v1.2.3-54-g00ecf