From dce503764653051ddb1b3d67eb7d6059b8d31f92 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Wed, 13 Jul 2016 11:37:01 +0100 Subject: [PATCH] bitbake: toaster: remove links from time field on failed builds Failed builds don't have any time data recorded for them, so the time field in the builds table, the time shown in the recent builds area, and the build time shown in the build dashboard should not be links for failed builds. [YOCTO #8443] (Bitbake rev: 6f9c472d95ee800da079f6b828b956d9f8c67ce6) Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/tables.py | 8 ++++++-- .../toaster/toastergui/templates/builddashboard.html | 11 +++++++++-- .../lib/toaster/toastergui/templates/mrb_section.html | 10 +++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 79673f5dab..969eb04aaa 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -1197,9 +1197,13 @@ class BuildsTable(ToasterTable): time_template = ''' {% load projecttags %} - + {% if data.outcome == extra.Build.SUCCEEDED %} + + {{data.timespent_seconds | sectohms}} + + {% else %} {{data.timespent_seconds | sectohms}} - + {% endif %} ''' image_files_template = ''' diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index 07fc26c6dd..61ae583d23 100644 --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html @@ -38,8 +38,15 @@ {% endif %} Build time: - {{ build.timespent_seconds|sectohms }} - + + {% if build.outcome == build.SUCCEEDED %} + {{ build.timespent_seconds|sectohms }} + {% else %} + {{ build.timespent_seconds|sectohms }} + {% endif %} + + + {%endif%} diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 38a72f9afb..b761ffe1df 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -198,7 +198,15 @@
- Build time: <%:buildtime%> + Build time: + + + <%if state == 'Succeeded'%> + <%:buildtime%> + <%else%> + <%:buildtime%> + <%/if%> + <%include tmpl='#rebuild-template'/%>