1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

bitbake: toastergui: convert all builds page to ToasterTable

For better long-term maintainability, use ToasterTable instead
of Django template and view code to display the all builds page.

NB the builds.html template has been left in, as this will
otherwise cause conflicts when merging the new theme.

[YOCTO #8738]

(Bitbake rev: e0590fc8103afeb4c5e613a826057555c8193d59)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elliot Smith
2016-01-15 13:00:49 +02:00
committed by Richard Purdie
parent 6c12ca7f93
commit 294579b531
7 changed files with 434 additions and 80 deletions
+31 -1
View File
@@ -446,6 +446,12 @@ class Build(models.Model):
def get_outcome_text(self):
return Build.BUILD_OUTCOME[int(self.outcome)][1]
@property
def failed_tasks(self):
""" Get failed tasks for the build """
tasks = self.task_build.all()
return tasks.filter(order__gt=0, outcome=Task.OUTCOME_FAILED)
@property
def errors(self):
return (self.logmessage_set.filter(level=LogMessage.ERROR) |
@@ -456,9 +462,33 @@ class Build(models.Model):
def warnings(self):
return self.logmessage_set.filter(level=LogMessage.WARNING)
@property
def timespent(self):
return self.completed_on - self.started_on
@property
def timespent_seconds(self):
return (self.completed_on - self.started_on).total_seconds()
return self.timespent.total_seconds()
@property
def target_labels(self):
"""
Sorted (a-z) "target1:task, target2, target3" etc. string for all
targets in this build
"""
targets = self.target_set.all()
target_labels = []
target_label = None
for target in targets:
target_label = target.target
if target.task:
target_label = target_label + ':' + target.task
target_labels.append(target_label)
target_labels.sort()
return target_labels
def get_current_status(self):
"""