[oe-commits] [bitbake] 11/40: toaster: remove links from time field on failed builds

git at git.openembedded.org git at git.openembedded.org
Wed Aug 10 23:11:54 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit 6f9c472d95ee800da079f6b828b956d9f8c67ce6
Author: Elliot Smith <elliot.smith at intel.com>
AuthorDate: Wed Jul 13 11:37:01 2016 +0100

    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]
    
    Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
 lib/toaster/toastergui/tables.py                     |  8 ++++++--
 lib/toaster/toastergui/templates/builddashboard.html | 11 +++++++++--
 lib/toaster/toastergui/templates/mrb_section.html    | 10 +++++++++-
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/lib/toaster/toastergui/tables.py b/lib/toaster/toastergui/tables.py
index 79673f5..969eb04 100644
--- a/lib/toaster/toastergui/tables.py
+++ b/lib/toaster/toastergui/tables.py
@@ -1197,9 +1197,13 @@ class BuildsTable(ToasterTable):
 
         time_template = '''
         {% load projecttags %}
-        <a href="{% url "buildtime" data.id %}">
+        {% if data.outcome == extra.Build.SUCCEEDED %}
+            <a href="{% url "buildtime" data.id %}">
+                {{data.timespent_seconds | sectohms}}
+            </a>
+        {% else %}
             {{data.timespent_seconds | sectohms}}
-        </a>
+        {% endif %}
         '''
 
         image_files_template = '''
diff --git a/lib/toaster/toastergui/templates/builddashboard.html b/lib/toaster/toastergui/templates/builddashboard.html
index 07fc26c..61ae583 100644
--- a/lib/toaster/toastergui/templates/builddashboard.html
+++ b/lib/toaster/toastergui/templates/builddashboard.html
@@ -38,8 +38,15 @@
 			{% endif %}
 			<span class="pull-right">
 				Build time:
-				<a class="alert-link" href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
-			</span>
+			  <span data-build-field="buildtime">
+          {% if build.outcome == build.SUCCEEDED %}
+            <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+          {% else %}
+            {{ build.timespent_seconds|sectohms }}
+          {% endif %}
+        </span>
+      </span>
+
 		{%endif%}
 </div>
 
diff --git a/lib/toaster/toastergui/templates/mrb_section.html b/lib/toaster/toastergui/templates/mrb_section.html
index 38a72f9..b761ffe 100644
--- a/lib/toaster/toastergui/templates/mrb_section.html
+++ b/lib/toaster/toastergui/templates/mrb_section.html
@@ -198,7 +198,15 @@
 
   <!-- build time -->
   <div class="col-md-3">
-    Build time: <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
+    Build time:
+
+    <span data-role="data-recent-build-buildtime-field">
+      <%if state == 'Succeeded'%>
+        <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
+      <%else%>
+        <%:buildtime%>
+      <%/if%>
+    </span>
 
     <!-- rebuild button -->
     <%include tmpl='#rebuild-template'/%>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list