diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-01-14 12:46:54 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-16 08:25:31 +0000 |
commit | 2d78912bc62b7452433e3c785327d542449e3011 (patch) | |
tree | 279414cc98424924973d6aa0d378a3b8396b24f3 /bitbake/lib/toaster/toastergui/templates | |
parent | ce784879f48086ba8d33d7589293afbaf94780a0 (diff) | |
download | poky-2d78912bc62b7452433e3c785327d542449e3011.tar.gz |
bitbake: toastergui: all builds page lists failed build requests
This patch modifies the all builds page by splitting the page
into two variants - the "interactive" (default) and "managed" mode
versions.
In the "managed" mode version, we display build requests instead of
builds, including the failed build requests that have no build
associated with them.
[YOCTO #6671]
(Bitbake rev: c5f5fb80308228585aa7ff9721352feb5ed9c961)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/managed_builds.html | 135 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/managed_mrb_section.html | 172 |
2 files changed, 307 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/managed_builds.html b/bitbake/lib/toaster/toastergui/templates/managed_builds.html new file mode 100644 index 0000000000..5944dc4747 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/managed_builds.html | |||
@@ -0,0 +1,135 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {% load static %} | ||
4 | {% load projecttags %} | ||
5 | {% load humanize %} | ||
6 | |||
7 | {% block pagecontent %} | ||
8 | <div class="row-fluid"> | ||
9 | |||
10 | {% include "managed_mrb_section.html" %} | ||
11 | |||
12 | |||
13 | {% if 1 %} | ||
14 | <div class="page-header top-air"> | ||
15 | <h1> | ||
16 | {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %} | ||
17 | {{objects.paginator.count}} build{{objects.paginator.count|pluralize}} found | ||
18 | {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %} | ||
19 | No builds found | ||
20 | {%else%} | ||
21 | All builds | ||
22 | {%endif%} | ||
23 | </h1> | ||
24 | </div> | ||
25 | |||
26 | {% if objects.paginator.count == 0 %} | ||
27 | <div class="row-fluid"> | ||
28 | <div class="alert"> | ||
29 | <form class="no-results input-append" id="searchform"> | ||
30 | <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{% endif %} | ||
31 | <button class="btn" type="submit" value="Search">Search</button> | ||
32 | <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all builds</button> | ||
33 | </form> | ||
34 | </div> | ||
35 | </div> | ||
36 | |||
37 | |||
38 | {% else %} | ||
39 | {% include "basetable_top_buildprojects.html" %} | ||
40 | <!-- Table data rows; the order needs to match the order of "tablecols" definitions; and the <td class value needs to match the tablecols clclass value for show/hide buttons to work --> | ||
41 | {% for br in objects %}{% if br.build %} {% with build=br.build %} {# if we have a build, just display it #} | ||
42 | <tr class="data"> | ||
43 | <td class="outcome"><a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a></td> | ||
44 | <td class="target">{% for t in build.target_set.all %} <a href="{% url "builddashboard" build.id %}"> {{t.target}} </a> <br />{% endfor %}</td> | ||
45 | <td class="machine"><a href="{% url "builddashboard" build.id %}">{{build.machine}}</a></td> | ||
46 | <td class="started_on"><a href="{% url "builddashboard" build.id %}">{{build.started_on|date:"d/m/y H:i"}}</a></td> | ||
47 | <td class="completed_on"><a href="{% url "builddashboard" build.id %}">{{build.completed_on|date:"d/m/y H:i"}}</a></td> | ||
48 | <td class="failed_tasks error"> | ||
49 | {% query build.task_build outcome=4 order__gt=0 as exectask%} | ||
50 | {% if exectask.count == 1 %} | ||
51 | <a href="{% url "task" build.id exectask.0.id %}">{{exectask.0.recipe.name}}.{{exectask.0.task_name}}</a> | ||
52 | {% if MANAGED and build.project %} | ||
53 | <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}"> | ||
54 | <i class="icon-download-alt" title="" data-original-title="Download task log file"></i> | ||
55 | </a> | ||
56 | {% endif %} | ||
57 | {% elif exectask.count > 1%} | ||
58 | <a href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}} task{{exectask.count|pluralize}}</a> | ||
59 | {%endif%} | ||
60 | </td> | ||
61 | <td class="errors_no"> | ||
62 | {% if build.errors_no %} | ||
63 | <a class="errors_no error" href="{% url "builddashboard" build.id %}#errors">{{build.errors_no}} error{{build.errors_no|pluralize}}</a> | ||
64 | {% if MANAGED and build.project %} | ||
65 | <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}"> | ||
66 | <i class="icon-download-alt" title="" data-original-title="Download build log"></i> | ||
67 | </a> | ||
68 | {% endif %} | ||
69 | {%endif%} | ||
70 | </td> | ||
71 | <td class="warnings_no">{% if build.warnings_no %}<a class="warnings_no warning" href="{% url "builddashboard" build.id %}#warnings">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>{%endif%}</td> | ||
72 | <td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td> | ||
73 | {% if not MANAGED or not build.project %} | ||
74 | <td class="log">{{build.cooker_log_path}}</td> | ||
75 | {% endif %} | ||
76 | <td class="output"> | ||
77 | {% if build.outcome == build.SUCCEEDED %} | ||
78 | <a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a> | ||
79 | {% endif %} | ||
80 | </td> | ||
81 | {% if MANAGED %} | ||
82 | <td class="project"> | ||
83 | {% if build.project %} | ||
84 | <a href="{% url 'project' build.project.id %}">{{build.project.name}}</a> | ||
85 | {% endif %} | ||
86 | </td> | ||
87 | {% endif %} | ||
88 | </tr> | ||
89 | |||
90 | |||
91 | {%endwith%} | ||
92 | {% else %} {# we don't have a build for this build request, mask the data with build request data #} | ||
93 | |||
94 | |||
95 | |||
96 | <tr class="data"> | ||
97 | <td class="outcome">{% if buildrequest.state == buildrequest.REQ_FAILED %}<i class="icon-minus-sign error"></i>{%else%}FIXME_build_request_state{%endif%}</td> | ||
98 | <td class="target"> | ||
99 | <span data-toggle="tooltip" {%if br.brtarget_set.all.count > 1%}title="Targets: {%for target in br.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{br.brtarget_set.all.0.target}} {%if br.brtarget_set.all.count > 1%}(+ {{br.brtarget_set.all.count|add:"-1"}}){%endif%} </span> | ||
100 | </td> | ||
101 | <td class="machine"> | ||
102 | {{br.machine}} | ||
103 | </td> | ||
104 | <td class="started_on"> | ||
105 | {{br.created|date:"d/m/y H:i"}} | ||
106 | </td> | ||
107 | <td class="completed_on"> | ||
108 | {{br.updated|date:"d/m/y H:i"}} | ||
109 | </td> | ||
110 | <td class="failed_tasks error"> | ||
111 | {{br.brerror_set.all.0.errmsg|whitespace_slice:":32"}} | ||
112 | </td> | ||
113 | <td class="errors_no"> | ||
114 | </td> | ||
115 | <td class="warnings_no"> | ||
116 | </td> | ||
117 | <td class="time"> | ||
118 | {{br.timespent.total_seconds|sectohms}} | ||
119 | </td> | ||
120 | <td class="output"> {# we have no output here #} | ||
121 | </td> | ||
122 | <td class="project"> | ||
123 | <a href="{% url 'project' br.project.id %}">{{br.project.name}}</a> | ||
124 | </td> | ||
125 | </tr> | ||
126 | {%endif%} | ||
127 | {% endfor %} | ||
128 | |||
129 | |||
130 | {% include "basetable_bottom.html" %} | ||
131 | {% endif %} {# objects.paginator.count #} | ||
132 | {% endif %} {# empty #} | ||
133 | </div><!-- end row-fluid--> | ||
134 | |||
135 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/managed_mrb_section.html b/bitbake/lib/toaster/toastergui/templates/managed_mrb_section.html new file mode 100644 index 0000000000..d4959a0b52 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/managed_mrb_section.html | |||
@@ -0,0 +1,172 @@ | |||
1 | {% load static %} | ||
2 | {% load projecttags %} | ||
3 | {% load humanize %} | ||
4 | |||
5 | |||
6 | {%if mru.count > 0%} | ||
7 | |||
8 | <div class="page-header top-air"> | ||
9 | <h1> | ||
10 | Latest builds | ||
11 | </h1> | ||
12 | </div> | ||
13 | <div id="latest-builds"> | ||
14 | {% for buildrequest in mru %}{% with build=buildrequest.build %} | ||
15 | |||
16 | {% if build %} {# if we have a build, just display it #} | ||
17 | |||
18 | <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%} {% if MANAGED and build.project %}project-name{% endif %} "> | ||
19 | {% if MANAGED and build.project %} | ||
20 | <span class="label {%if build.outcome == build.SUCCEEDED%}label-success{%elif build.outcome == build.FAILED%}label-danger{%else%}label-info{%endif%}"> {{build.project.name}} </span> | ||
21 | {% endif %} | ||
22 | |||
23 | <div class="row-fluid"> | ||
24 | <div class="span3 lead"> | ||
25 | {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} | ||
26 | <a href="{%url 'builddashboard' build.pk%}" class="{%if build.outcome == build.SUCCEEDED %}success{%else%}error{%endif%}"> | ||
27 | {% endif %} | ||
28 | <span data-toggle="tooltip" {%if build.target_set.all.count > 1%}title="Targets: {%for target in build.target_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{build.target_set.all.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} | ||
29 | </span> | ||
30 | {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} | ||
31 | </a> | ||
32 | {% endif %} | ||
33 | </div> | ||
34 | <div class="span2 lead"> | ||
35 | {% if build.completed_on|format_build_date %} | ||
36 | {{ build.completed_on|date:'d/m/y H:i' }} | ||
37 | {% else %} | ||
38 | {{ build.completed_on|date:'H:i' }} | ||
39 | {% endif %} | ||
40 | </div> | ||
41 | {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} | ||
42 | <div class="span2 lead"> | ||
43 | {% if build.errors_no %} | ||
44 | <i class="icon-minus-sign red"></i> <a href="{%url 'builddashboard' build.pk%}#errors" class="error">{{build.errors_no}} error{{build.errors_no|pluralize}}</a> | ||
45 | {% endif %} | ||
46 | </div> | ||
47 | <div class="span2 lead"> | ||
48 | {% if build.warnings_no %} | ||
49 | <i class="icon-warning-sign yellow"></i> <a href="{%url 'builddashboard' build.pk%}#warnings" class="warning">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a> | ||
50 | {% endif %} | ||
51 | </div> | ||
52 | <div class="lead "> | ||
53 | <span class="lead{%if not MANAGED or not build.project%} pull-right{%endif%}"> | ||
54 | Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a> | ||
55 | </span> | ||
56 | {% if MANAGED and build.project %} | ||
57 | <a class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%elif build.outcome == build.FAILED%}btn-danger{%else%}btn-info{%endif%} pull-right" onclick="scheduleBuild({% url 'xhr_projectbuild' build.project.id as bpi%}{{bpi|json}}, {{build.project.name|json}}, {{build.get_sorted_target_list|mapselect:'target'|json}})">Run again</a> | ||
58 | {% endif %} | ||
59 | </div> | ||
60 | {%endif%} | ||
61 | {%if build.outcome == build.IN_PROGRESS %} | ||
62 | <div class="span4"> | ||
63 | <div class="progress" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete"> | ||
64 | <div style="width: {{build.completeper}}%;" class="bar"></div> | ||
65 | </div> | ||
66 | </div> | ||
67 | <div class="lead pull-right">ETA: in {{build.eta|naturaltime}}</div> | ||
68 | {%endif%} | ||
69 | </div> | ||
70 | </div> | ||
71 | |||
72 | {% else %} {# we use the project's page recent build design #} | ||
73 | |||
74 | <div class="alert {% if buildrequest.state == buildrequest.REQ_FAILED %}alert-error{% else %}alert-info{% endif %}"> | ||
75 | <div class="row-fluid"> | ||
76 | |||
77 | |||
78 | {% if buildrequest.state == buildrequest.REQ_FAILED %} | ||
79 | <div class="lead span3"> | ||
80 | <span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} </span> | ||
81 | </div> | ||
82 | <div > | ||
83 | </div> | ||
84 | <div class="row-fluid"> | ||
85 | {% for e in buildrequest.brerror_set.all|slice:":3" %} | ||
86 | <div class="air well"> | ||
87 | <pre>{{e.errmsg|whitespace_slice:":150"}}</pre> | ||
88 | </div> | ||
89 | {% endfor %} | ||
90 | </div> | ||
91 | |||
92 | {% elif buildrequest.state == buildrequest.REQ_QUEUED %} | ||
93 | |||
94 | <div class="lead span5"> | ||
95 | |||
96 | <span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} </span> | ||
97 | </div> | ||
98 | <div class="span4 lead" >Build queued | ||
99 | <i title="This build will start as soon as a build server is available" class="icon-question-sign get-help get-help-blue heading-help" data-toggle="tooltip"></i> | ||
100 | </div> | ||
101 | |||
102 | {% elif buildrequest.state == buildrequest.REQ_CREATED %} | ||
103 | |||
104 | <div class="lead span3"> | ||
105 | <span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} </span> | ||
106 | </div> | ||
107 | <div class="span6" > | ||
108 | <span class="lead">Creating build</span> | ||
109 | </div> | ||
110 | |||
111 | {% elif buildrequest.state == buildrequest.REQ_INPROGRESS %} | ||
112 | |||
113 | <div class="lead span5"> | ||
114 | <span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} </span> | ||
115 | </div> | ||
116 | <div class="span4 lead"> | ||
117 | Checking out layers | ||
118 | </div> | ||
119 | {% else %} | ||
120 | |||
121 | <div>FIXME!</div> | ||
122 | |||
123 | {% endif %} | ||
124 | <div class="lead pull-right"> | ||
125 | </div> | ||
126 | </div> | ||
127 | </div> | ||
128 | |||
129 | |||
130 | |||
131 | {% endif %} {# this ends the build request most recent build section #} | ||
132 | |||
133 | {%endwith%}{% endfor %} | ||
134 | </div> | ||
135 | |||
136 | <script> | ||
137 | |||
138 | function _makeXHRBuildCall(url, data, onsuccess, onfail) { | ||
139 | $.ajax( { | ||
140 | type: "POST", | ||
141 | url: url, | ||
142 | data: data, | ||
143 | headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, | ||
144 | success: function (_data) { | ||
145 | if (_data.error != "ok") { | ||
146 | alert(_data.error); | ||
147 | } else { | ||
148 | if (onsuccess != undefined) onsuccess(_data); | ||
149 | } | ||
150 | }, | ||
151 | error: function (_data) { | ||
152 | alert("Call failed"); | ||
153 | console.log(_data); | ||
154 | if (onfail) onfail(data); | ||
155 | } }); | ||
156 | } | ||
157 | |||
158 | |||
159 | function scheduleBuild(url, projectName, buildlist) { | ||
160 | console.log("scheduleBuild"); | ||
161 | _makeXHRBuildCall(url, {targets: buildlist.join(" ")}, function (_data) { | ||
162 | |||
163 | $('#latest-builds').prepend('<div class="alert alert-info" style="padding-top:0px">' + '<span class="label label-info" style="font-weight: normal; margin-bottom: 5px; margin-left:-15px; padding-top:5px;">'+projectName+'</span><div class="row-fluid">' + | ||
164 | '<div class="span4 lead">' + buildlist.join(" ") + | ||
165 | '</div><div class="span4 lead pull-right">Build queued. Your build will start shortly.</div></div></div>'); | ||
166 | }); | ||
167 | } | ||
168 | |||
169 | </script> | ||
170 | |||
171 | {%endif%} | ||
172 | |||