diff options
author | Amit Kumar Chaudhary <amit@floatingpondtech.com> | 2014-03-12 18:47:42 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-14 07:18:46 -0700 |
commit | d3d3a2c6ba71767e49a5b62fe74bf3b47688b911 (patch) | |
tree | e562cce83656e3a1d68d732b2cec5c2fe9ef507e | |
parent | 1db32b097b5a4f305e056ae26b940be832efa7cf (diff) | |
download | poky-d3d3a2c6ba71767e49a5b62fe74bf3b47688b911.tar.gz |
bitbake: toaster: add errors and warnings listing
Add the errors and warnings listing to the build
dashboard page.
(Bitbake rev: 2004c0fd1dd049d26279ee10a18e69e6852247fa)
Signed-off-by: Amit Kumar Chaudhary <amit@floatingpondtech.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/main.js | 20 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/builddashboard.html | 56 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 3 |
3 files changed, 76 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/main.js b/bitbake/lib/toaster/toastergui/static/js/main.js index c80f716edb..07aba3d86b 100644 --- a/bitbake/lib/toaster/toastergui/static/js/main.js +++ b/bitbake/lib/toaster/toastergui/static/js/main.js | |||
@@ -91,3 +91,23 @@ $(document).ready(function() { | |||
91 | }); | 91 | }); |
92 | 92 | ||
93 | }); | 93 | }); |
94 | |||
95 | $(document).ready(function() { | ||
96 | //toggle the errors and warnings sections | ||
97 | $('.show-errors').click(function() { | ||
98 | $('#collapse-errors').addClass('in'); | ||
99 | }); | ||
100 | $('.toggle-errors').click(function() { | ||
101 | $('#collapse-errors').toggleClass('in'); | ||
102 | }); | ||
103 | $('.show-warnings').click(function() { | ||
104 | $('#collapse-warnings').addClass('in'); | ||
105 | }); | ||
106 | $('.toggle-warnings').click(function() { | ||
107 | $('#collapse-warnings').toggleClass('in'); | ||
108 | }); | ||
109 | //show warnings section when requested from the previous page | ||
110 | if (location.href.search('#warnings') > -1) { | ||
111 | $('#collapse-warnings').addClass('in'); | ||
112 | } | ||
113 | }); | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index b6506c73d0..763a28d1bf 100644 --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html | |||
@@ -18,10 +18,10 @@ | |||
18 | <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}"> | 18 | <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}"> |
19 | <div class="row-fluid lead"> | 19 | <div class="row-fluid lead"> |
20 | <span class="pull-left"><strong>{%if build.outcome == build.SUCCEEDED%}Completed{%elif build.outcome == build.FAILED%}Failed{%else%}{%endif%}</strong> {{build.completed_on|date:"d/m/y H:i"}} with </span>{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}{% if build.errors_no %} | 20 | <span class="pull-left"><strong>{%if build.outcome == build.SUCCEEDED%}Completed{%elif build.outcome == build.FAILED%}Failed{%else%}{%endif%}</strong> {{build.completed_on|date:"d/m/y H:i"}} with </span>{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}{% if build.errors_no %} |
21 | <span class="span2"><i class="icon-minus-sign red"></i><strong><a href="{%url 'builddashboard' build.pk%}" class="error"> {{build.errors_no}} error{{build.errors_no|pluralize}}</a></strong></span> | 21 | <span class="span2"><i class="icon-minus-sign red"></i><strong><a href="#errors" class="error"> {{build.errors_no}} error{{build.errors_no|pluralize}}</a></strong></span> |
22 | {% endif %} | 22 | {% endif %} |
23 | {% if build.warnings_no %} | 23 | {% if build.warnings_no %} |
24 | <span class="span2"><i class="icon-warning-sign yellow"></i><strong><a href="{%url 'builddashboard' build.pk%}" class="warning"> {{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a></strong></span> | 24 | <span class="span2"><i class="icon-warning-sign yellow"></i><strong><a href="#warnings" class="warning"> {{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a></strong></span> |
25 | {% endif %} | 25 | {% endif %} |
26 | <span class="pull-right">Build time: <a href="build-time.html">{{ build.timespent|sectohms }}</a></span> | 26 | <span class="pull-right">Build time: <a href="build-time.html">{{ build.timespent|sectohms }}</a></span> |
27 | {%endif%} | 27 | {%endif%} |
@@ -29,6 +29,32 @@ | |||
29 | </div> | 29 | </div> |
30 | </div> | 30 | </div> |
31 | 31 | ||
32 | {% if build.errors_no %} | ||
33 | <div class="accordion span10 pull-right" id="errors"> | ||
34 | <div class="accordion-group"> | ||
35 | <div class="accordion-heading"> | ||
36 | <a class="accordion-toggle error toggle-errors"> | ||
37 | <h2 id="error-toggle"> | ||
38 | <i class="icon-minus-sign"></i> | ||
39 | {{build.errors_no}} error{{build.errors_no|pluralize}} | ||
40 | </h2> | ||
41 | </a> | ||
42 | </div> | ||
43 | <div class="accordion-body collapse in" id="collapse-errors"> | ||
44 | <div class="accordion-inner"> | ||
45 | <div class="span10"> | ||
46 | {% for error in logmessages %}{% if error.level == 2 %} | ||
47 | <div class="alert alert-error"> | ||
48 | <pre>{{error.message}}</pre> | ||
49 | </div> | ||
50 | {% endif %}{% endfor %} | ||
51 | </div> | ||
52 | </div> | ||
53 | </div> | ||
54 | </div> | ||
55 | </div> | ||
56 | {% endif %} | ||
57 | |||
32 | {%if build.outcome == build.SUCCEEDED%} | 58 | {%if build.outcome == build.SUCCEEDED%} |
33 | <!-- built images --> | 59 | <!-- built images --> |
34 | <div class="row-fluid span10 pull-right"> | 60 | <div class="row-fluid span10 pull-right"> |
@@ -71,4 +97,30 @@ | |||
71 | </div> | 97 | </div> |
72 | </div> | 98 | </div> |
73 | 99 | ||
100 | {% if build.warnings_no %} | ||
101 | <div class="accordion span10 pull-right" id="warnings"> | ||
102 | <div class="accordion-group"> | ||
103 | <div class="accordion-heading"> | ||
104 | <a class="accordion-toggle warning toggle-warnings"> | ||
105 | <h2 id="warning-toggle"> | ||
106 | <i class="icon-warning-sign"></i> | ||
107 | {{build.warnings_no}} warning{{build.warnings_no|pluralize}} | ||
108 | </h2> | ||
109 | </a> | ||
110 | </div> | ||
111 | <div class="accordion-body collapse" id="collapse-warnings"> | ||
112 | <div class="accordion-inner"> | ||
113 | <div class="span10"> | ||
114 | {% for warning in logmessages %}{% if warning.level == 1 %} | ||
115 | <div class="alert alert-warning"> | ||
116 | <pre>{{warning.message}}</pre> | ||
117 | </div> | ||
118 | {% endif %}{% endfor %} | ||
119 | </div> | ||
120 | </div> | ||
121 | </div> | ||
122 | </div> | ||
123 | </div> | ||
124 | {% endif %} | ||
125 | |||
74 | {% endblock %} | 126 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index a499c30b62..7f61ade9c8 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -356,7 +356,8 @@ def builddashboard(request, build_id): | |||
356 | return redirect(builds) | 356 | return redirect(builds) |
357 | context = { | 357 | context = { |
358 | 'build' : Build.objects.filter(pk=build_id)[0], | 358 | 'build' : Build.objects.filter(pk=build_id)[0], |
359 | 'recipecount' : Recipe.objects.filter(layer_version__id__in=Layer_Version.objects.filter(build=build_id)).count() | 359 | 'recipecount' : Recipe.objects.filter(layer_version__id__in=Layer_Version.objects.filter(build=build_id)).count(), |
360 | 'logmessages' : LogMessage.objects.filter(build=build_id), | ||
360 | } | 361 | } |
361 | return render(request, template, context) | 362 | return render(request, template, context) |
362 | 363 | ||