blob: b761ffe1dfe3ce93c1d000c141fe80ba51aa7c5a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001{% load static %}
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002{% load humanize %}
Patrick Williamsc0f7c042017-02-23 20:41:17 -06003{% load project_url_tag %}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05004<script src="{% static 'js/mrbsection.js' %}"></script>
Patrick Williamsc0f7c042017-02-23 20:41:17 -06005
6{% if mru %}
7 {% if mrb_type == 'project' %}
8 <h2>
9 Latest project builds
10
11 {% if project.is_default %}
12 <span class="glyphicon glyphicon-question-sign get-help heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
13 {% endif %}
14 </h2>
15 {% else %}
16 <div class="page-header">
17 <h1>Latest builds</h1>
18 </div>
19 {% endif %}
20
21 <div id="latest-builds">
22 {% for build in mru %}
23 <div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
24 <!-- project title -->
25 {% if mrb_type != 'project' %}
26 <div class="row project-name">
27 <div class="col-md-12">
28 <small>
29 <a class="alert-link text-uppercase" href="{% project_url build.project %}">
30 {{build.project.name}}
31 </a>
32 </small>
33 </div>
34 </div>
35 {% endif %}
36
37 <div class="row" data-role="build-status-container">
38 <div class="col-md-12">
39 Loading...
40 </div>
41 </div>
42 </div>
43 {% endfor %}
44 </div>
45{% endif %}
46
47<!-- build main template -->
48<script id="build-template" type="text/x-jsrender">
49 <div class="col-md-3">
50 <!-- only show link for completed builds -->
51 <%if state == 'Succeeded' || state == 'Failed'%>
52 <a class="alert-link" href="<%:dashboard_url%>">
53 <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
54 <%:targets_abbreviated%>
55 </span>
56 </a>
57 <%else targets_abbreviated !== ''%>
58 <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
59 <%:targets_abbreviated%>
60 </span>
61 <%else%>
62 Fetching recipe names...
63 <%/if%>
64 </div>
65
66 <div data-build-state="<%:state%>">
67 <%if state == 'Parsing'%>
68 <%include tmpl='#parsing-recipes-build-template'/%>
69 <%else state == 'Queued'%>
70 <%include tmpl='#queued-build-template'/%>
71 <%else state == 'Succeeded' || state == 'Failed'%>
72 <%include tmpl='#succeeded-or-failed-build-template'/%>
73 <%else state == 'Cancelling'%>
74 <%include tmpl='#cancelling-build-template'/%>
75 <%else state == 'Starting'%>
76 <%include tmpl='#starting-template'/%>
77 <%else state == 'In Progress'%>
78 <%include tmpl='#in-progress-build-template'/%>
79 <%else state == 'Cancelled'%>
80 <%include tmpl='#cancelled-build-template'/%>
81 <%/if%>
82 </div>
83</script>
84
85<!-- queued build -->
86<script id="queued-build-template" type="text/x-jsrender">
87 <div class="col-md-5">
88 <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
89 title="This build is waiting for the build directory to become available">
90 </span>
91
92 Build queued
93 </div>
94
95 <div class="col-md-4">
96 <!-- cancel button -->
97 <%include tmpl='#cancel-template'/%>
98 </div>
99</script>
100
101<!-- parsing recipes build -->
102<script id="parsing-recipes-build-template" type="text/x-jsrender">
103 <!-- progress bar and parse completion percentage -->
104 <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
105 <!-- progress bar -->
106 <div class="progress">
107 <div id="recipes-parsed-percentage-bar-<%:id%>"
108 style="width: <%:recipes_parsed_percentage%>%;"
109 class="progress-bar">
110 </div>
111 </div>
112 </div>
113
114 <div class="col-md-4 progress-info">
115 <!-- parse completion percentage -->
116 <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
117 title="BitBake is parsing the layers required for your build">
118 </span>
119
120 Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete
121
122 <%include tmpl='#cancel-template'/%>
123 </div>
124</script>
125
126<!-- in progress build; tasks still starting -->
127<script id="starting-template" type="text/x-jsrender">
128 <div class="col-md-5">
129 <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
130 title="This build is waiting for tasks to start">
131 </span>
132
133 Tasks starting...
134 </div>
135
136 <div class="col-md-4">
137 <!-- cancel button -->
138 <%include tmpl='#cancel-template'/%>
139 </div>
140</script>
141
142<!-- in progress build; at least one task finished -->
143<script id="in-progress-build-template" type="text/x-jsrender">
144 <!-- progress bar and task completion percentage -->
145 <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
146 <!-- progress bar -->
147 <div class="progress" id="build-pc-done-title-<%:id%>">
148 <div id="build-pc-done-bar-<%:id%>"
149 style="width: <%:tasks_complete_percentage%>%;"
150 class="progress-bar">
151 </div>
152 </div>
153 </div>
154
155 <div class="col-md-4 progress-info">
156 <!-- task completion percentage -->
157 <span id="build-pc-done-<%:id%>"><%:tasks_complete_percentage%></span>% of
158 tasks complete
159
160 <!-- cancel button -->
161 <%include tmpl='#cancel-template'/%>
162 </div>
163</script>
164
165<!-- cancelling build -->
166<script id="cancelling-build-template" type="text/x-jsrender">
167 <div class="col-md-9">
168 Cancelling the build ...
169 </div>
170</script>
171
172<!-- succeeded or failed build -->
173<script id="succeeded-or-failed-build-template" type="text/x-jsrender">
174 <!-- completed_on -->
175 <div class="col-md-2">
176 <%:completed_on%>
177 </div>
178
179 <!-- errors -->
180 <div class="col-md-2">
181 <%if errors%>
182 <span class="glyphicon glyphicon-minus-sign"></span>
183 <a href="<%:dashboard_errors_url%>" class="alert-link">
184 <%:errors%> error<%:errors_pluralise%>
185 </a>
186 <%/if%>
187 </div>
188
189 <!-- warnings -->
190 <div class="col-md-2">
191 <%if warnings%>
192 <span class="glyphicon glyphicon-warning-sign build-warnings"></span>
193 <a href="<%:dashboard_warnings_url%>" class="alert-link build-warnings">
194 <%:warnings%> warning<%:warnings_pluralise%>
195 </a>
196 <%/if%>
197 </div>
198
199 <!-- build time -->
200 <div class="col-md-3">
201 Build time:
202
203 <span data-role="data-recent-build-buildtime-field">
204 <%if state == 'Succeeded'%>
205 <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
206 <%else%>
207 <%:buildtime%>
208 <%/if%>
209 </span>
210
211 <!-- rebuild button -->
212 <%include tmpl='#rebuild-template'/%>
213 </div>
214</script>
215
216<!-- cancelled build -->
217<script id="cancelled-build-template" type="text/x-jsrender">
218 <!-- build cancelled message -->
219 <div class="col-md-6">
220 Build cancelled
221 </div>
222
223 <!-- rebuild button -->
224 <div class="col-md-3">
225 <%include tmpl='#rebuild-template'/%>
226 </div>
227</script>
228
229<!-- rebuild button or no rebuild icon -->
230<script id="rebuild-template" type="text/x-jsrender">
231 <%if is_default_project_build%>
232 <!-- no rebuild info icon -->
233 <span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 'Succeeded'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
234 title="Builds in this project cannot be started from Toaster: they are started from the command line">
235 </span>
236 <%else%>
237 <!-- rebuild button -->
238 <span class="rebuild-btn alert-link <%if state == 'Success'%>success<%else state == 'Failed'%>danger<%else%>info<%/if%> pull-right"
239 data-request-url="<%:rebuild_url%>" data-target='<%:build_targets_json%>'>
240 <span class="glyphicon glyphicon-repeat"></span>
241 Rebuild
242 </span>
243 <%/if%>
244</script>
245
246<!-- cancel button or no cancel icon -->
247<script id="cancel-template" type="text/x-jsrender">
248 <%if is_default_project_build%>
249 <!-- no cancel icon -->
250 <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
251 <%else%>
252 <!-- cancel button -->
253 <span class="cancel-build-btn pull-right alert-link"
254 data-buildrequest-id="<%:buildrequest_id%>" data-request-url="<%:cancel_url%>">
255 <span class="glyphicon glyphicon-remove-circle"></span>
256 Cancel
257 </span>
258 <%/if%>
259</script>
260
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500261<script>
262 $(document).ready(function () {
263 var ctx = {
264 mrbType : "{{mrb_type}}",
265 }
266
267 try {
268 mrbSectionInit(ctx);
269 } catch (e) {
270 document.write("Sorry, An error has occurred loading this page");
271 console.warn(e);
272 }
273 });
274</script>