summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/project.html
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/project.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/project.html366
1 files changed, 366 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html
new file mode 100644
index 0000000000..c3a470c54a
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/project.html
@@ -0,0 +1,366 @@
1{% extends "base.html" %}
2{% load projecttags %}
3{% load humanize %}
4{% block pagecontent %}
5
6<script>
7
8var buildrequests = [];
9
10function targetInPage(targetname) {
11 return targetname in $("ul#target-list > li > a").map(function (i, x) {return x.text});
12}
13
14function setEventHandlers() {
15 $("i#del-target-icon").unbind().click(function (evt) {
16 console.log("del target", evt.target.attributes["x-data"].value);
17 postEditAjaxRequest({"targetDel": evt.target.attributes["x-data"].value});
18 });
19 $("button#add-target-button").unbind().click( function (evt) {
20 if ( $("input#target")[0].value.length == 0) {
21 alert("cannot add empty target");
22 return;
23 }
24 postEditAjaxRequest({"targetAdd" : $("input#target")[0].value});
25 });
26}
27
28function onEditPageUpdate(data) {
29 // update targets
30 var i; var orightml = "";
31
32 $("span#target-count").html(data.targets.length);
33 for (i = 0; i < data.targets.length; i++) {
34 if (! targetInPage(data.targets[i].target)) {
35 orightml += '<li><a href="#">'+data.targets[i].target;
36 if (data.targets[i].task != "" && data.targets[i].task !== null) {
37 orightml += " ("+data.targets[i].task+")";
38 }
39 orightml += '</a><i title="" data-original-title="" class="icon-trash" id="del-target-icon" x-data="'+data.targets[i].pk+'"></i></li>';
40 }
41 }
42
43 $("ul#target-list").html(orightml);
44
45 // update recent builds
46
47 setEventHandlers();
48}
49
50function onEditAjaxSuccess(data, textstatus) {
51 console.log("XHR returned:", data, "(" + textstatus + ")");
52 if (data.error != "ok") {
53 alert("error on request:\n" + data.error);
54 return;
55 }
56 onEditPageUpdate(data);
57}
58
59function onEditAjaxError(jqXHR, textstatus, error) {
60 alert("XHR errored:\n" + error + "\n(" + textstatus + ")");
61}
62
63function postEditAjaxRequest(reqdata) {
64 var ajax = $.ajax({
65 type:"POST",
66 data: $.param(reqdata),
67 url:"{% url 'xhr_projectedit' project.id%}",
68 headers: { 'X-CSRFToken': $.cookie("csrftoken")},
69 success: onEditAjaxSuccess,
70 error: onEditAjaxError,
71 })
72}
73
74
75
76
77$(document).ready(function () {
78 setEventHandlers();
79
80 /* Provide XHR calls for the "build" buttons.*/
81 $("button#build-all-button").click( function (evt) {
82 var ajax = $.ajax({
83 type:"POST",
84 url:"{% url 'xhr_projectbuild' project.id %}",
85 headers: { 'X-CSRFToken': $.cookie("csrftoken")},
86 success: function (data, textstatus) {
87 if (data.error != "ok") {
88 alert("XHR fail: " + data.error );
89 }
90 },
91 error: function (jqXHR, textstatus, error) { alert("XHR errored:" + error + "(" + textstatus + ")"); },
92 })
93 });
94});
95
96
97</script>
98
99
100 <div class="page-header">
101 <h1>
102 {{project.name}}
103 {% if project.build_set.all.count == 0 %}
104 <small>No builds yet</small>
105 {% else %}
106 <small><a href="#">{{project.build_set.all.count}} builds</a></small>
107 {% endif %}
108 </h1>
109 </div>
110
111
112 <div class="well">
113 <form class="build-form">
114 <div class="input-append input-prepend controls">
115 <input type="text" class="huge span7" placeholder="Type the target(s) you want to build" autocomplete="off" data-minLength="1" data-autocomplete="off"
116 data-provide="typeahead" data-source='["core-image-base [meta | daisy]",
117 "core-image-clutter [meta | daisy]",
118 "core-image-directfb [meta | daisy]",
119 "core-image-myimage [meta-imported-layer | 3e1dbabbf3&hellip;]",
120 "core-image-anotherimage [meta-imported-layer | master]",
121 "core-image-full-cmdline [meta | daisy]",
122 "core-image-lsb [meta | daisy]",
123 "core-image-lsb-dev [meta | daisy]",
124 "core-image-lsb-sdk [meta| daisy]",
125 "core-image-minimal [meta| daisy]"
126 ]'>
127 <a href="#" id="build-button" class="btn btn-large btn-primary" disabled>
128 Build
129 <i class="icon-question-sign get-help heading-help" style="margin-left: 5px;" title="Type the name of one or more targets you want to build, separated by a space. You can also specify a task by appending a semicolon and a task name to a target name, like so: <code>core-image-minimal:do_build</code>"></i>
130 </a>
131 </div>
132 <p>
133 <a href="all-targets.html" style="padding-right: 5px;">
134 View all targets
135 </a>
136 |
137 <a href="{% url 'projectbuilds' project.id%}" style="padding-left:5px;">
138 View all project builds ({{project.build_set.count}})
139 </a>
140 </form>
141 </div>
142
143
144
145
146
147 {% if builds|length > 0 or buildrequests|length > 0 %}
148 <h2 class="air">Recent Builds</h2>
149
150 <div id="scheduled-builds">
151 {% for br in buildrequests %}
152<div class="alert {% if br.0.state == br.0.REQ_FAILED%}alert-error{%else%}alert-info{%endif%}" id="build-request">
153 <div class="row-fluid">
154 <div class="lead span4">
155 <span>
156 {{br.0.brtarget_set.all.0.target}} {%if br.brtarget_set.all.count > 1%}(+ {{br.brtarget_set.all.count|add:"-1"}}){%endif%} {{br.1.machine.value}} (Created {{br.0.created}})
157 </span>
158 </div>
159 <div class="span2">
160 {{br.0.get_state_display}}
161 </div>
162 <div class="span8">
163{% if br.state == br.REQ_FAILED%}
164 {% for bre in br.0.brerror_set.all %} {{bre.errmsg}} ({{bre.errtype}}) <br/><hr/><code>{{bre.traceback}}</code>{%endfor%}
165{%endif%}
166 </div>
167
168 </div>
169</div>
170
171 {% endfor %}
172
173 </div>
174
175
176
177<!-- Lifted from build.html -->
178 {% for build in builds %}
179<div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}">
180 <div class="row-fluid">
181 <div class="lead span5">
182 {%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%}
183 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
184 <a href="{%url 'builddashboard' build.pk%}" class="{%if build.outcome == build.SUCCEEDED %}success{%else%}error{%endif%}">
185 {% endif %}
186 <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%} {{build.machine}} ({{build.completed_on|naturaltime}})</span>
187 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
188 </a>
189 {% endif %}
190 </div>
191 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
192 <div class="span2 lead">
193 {% if build.errors_no %}
194 <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>
195 {% endif %}
196 </div>
197 <div class="span2 lead">
198 {% if build.warnings_no %}
199 <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>
200 {% endif %}
201 </div >
202 <div class="lead pull-right">
203 Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a>
204 </div>
205 {%endif%}{%if build.outcome == build.IN_PROGRESS %}
206 <div class="span4">
207 <div class="progress" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete">
208 <div style="width: {{build.completeper}}%;" class="bar"></div>
209 </div>
210 </div>
211 <div class="lead pull-right">ETA: in {{build.eta|naturaltime}}</div>
212 {%endif%}
213 </div>
214 </div>
215 {% endfor %}
216<!-- end of lift-->
217 {%endif%}
218
219 <h2 class="air">Project configuration</h2>
220
221 <div class="row-fluid">
222
223 <div id="layer-container" class="well well-transparent span4">
224 <h3>
225 Add layers
226 <i data-original-title="OpenEmbedded organises metadata into modules called 'layers'. Layers allow you to isolate different types of customizations from each other. <a href='http://www.yoctoproject.org/docs/1.6.1/dev-manual/dev-manual.html#understanding-and-creating-layers' target='_blank'>More on layers</a>" class="icon-question-sign get-help heading-help" title=""></i>
227 </h3>
228 <form style="margin-top:20px;">
229 <div class="input-append">
230 <input class="input-xlarge" id="layer" autocomplete="off" placeholder="Type a layer name" data-provide="typeahead" data-source="" data-minlength="1" data-autocomplete="off" type="text">
231 <button id="add-layer" class="btn" disabled="">Add</button>
232 </div>
233 <div id="import-alert" class="alert alert-info" style="display:none;">
234 Toaster does not know about this layer. Please <a href="#">import it</a>
235 </div>
236 <div id="dependency-alert" class="alert alert-info" style="display:none;">
237 <p><strong>meta-tizen</strong> depends on the layers below. Check the ones you want to add: </p>
238 <ul class="unstyled">
239 {% for f in layer_dependency %}
240 <li>
241 <label class="checkbox">
242 <input checked="checked" type="checkbox">
243 meta-ruby
244 </label>
245 </li>
246 {% endfor %}
247 </ul>
248 <button id="add-layer-dependencies" class="btn btn-info add-layer">Add layers</button>
249 </div>
250
251 <p><a href="{% url 'importlayer' %}">Import your layer</a> | <a href="{% url 'layers'%}">View all layers</a></p>
252 </form>
253
254 <h4 class="air">
255 Added layers
256 <span class="muted counter">{{project.projectlayer_set.count}}</span>
257 <i data-original-title="Your added layers will be listed in this same order in your <code>bblayers.conf</code> file" class="icon-question-sign get-help heading-help" title=""></i>
258 </h4>
259 <ul class="unstyled configuration-list">
260 {% for pl in project.projectlayer_set.all %}
261 <li>
262 <a href="#">{{pl.layercommit.layer.name}} (<span class="layer-version">{{pl.layercommit.layer.layer_index_url}}</span>)</a>
263 {% if pl.optional %}
264 <i title="" data-original-title="" class="icon-trash" id="del-layer-icon" x-data="{{pl.pk}}"></i>
265 {% endif %}
266 </li>
267 {% endfor %}
268 </ul>
269 </div>
270
271 <div id="target-container" class="well well-transparent span4">
272 <h3>
273 Add targets
274 <i data-original-title="A target is what you want to build, usually an image recipe that produces a root file system" class="icon-question-sign get-help heading-help" title=""></i>
275 </h3>
276 <form style="margin-top:20px;">
277 <div class="input-append">
278 <input id="target" class="input-xlarge" autocomplete="off" placeholder="Type a target name" data-provide="typeahead" data-source="" data-minlength="1" data-autocomplete="off" type="text">
279 <button id="add-target-button" class="btn" type="button">Add</button>
280 </div>
281
282 <p><a href="{% url 'targets' %}" class="link">View all targets</a></p>
283 </form>
284 <h4 class="air">
285 Added targets
286 <span id="target-count" class="muted counter">{{project.projecttarget_set.count}}</span>
287 </h4>
288 <ul class="unstyled configuration-list" id="target-list">
289 {% for target in project.projecttarget_set.all %}
290 {% if target %}
291 <li>
292 <a href="#">{{target.target}}{% if target.task%} (target.task){%endif%}</a>
293 {% if target.notprovided %}
294 <i title="" data-original-title="" id="msg1" class="icon-exclamation-sign get-help-yellow" data-title="<strong>Target may not be provided</strong>" data-content="From the layer information it currently has, Toaster thinks this target is not provided by any of your added layers. If a target is not provided by one of your added layers, the build will fail.<h5>What Toaster suggests</h5><p>The <a href='#'>meta-abc</a> and <a href='#'>meta-efg</a> layers provide core-image-notprovided. You could add one of them to your project.</p><button class='btn btn-block'>Add meta-abc</button><button class='btn btn-block'>Add meta-efg</button><button id='dismiss1' class='btn btn-block btn-info'>Stop showing this message</button>"></i>
295 {% elif target.notknown %}
296 <i title="" data-original-title="" id="msg2" class="icon-exclamation-sign get-help-yellow" data-title="<strong>Target may not be provided</strong>" data-content="From the layer information it currently has, Toaster thinks this target is not provided by any of your added layers. If a target is not provided by one of your added layers, the build will fail.<h5>What Toaster suggests</h5><p>Review your added layers to make sure one of them provides core-image-unknown. Clicking on a layer name will give you all the information Toaster has about the layer. </p> <button class='btn btn-block btn-info'>Stop showing this message</button>"></i>
297 {% endif %}
298 <i title="" data-original-title="" class="icon-trash" id="del-target-icon" x-data="{{target.pk}}"></i>
299 </li>
300 {% endif %}
301 {% endfor %}
302
303
304 </ul>
305 </div>
306
307 <div class="well well-transparent span4">
308
309 <h3>
310 Project machine
311 <i class="icon-question-sign get-help heading-help" title="The machine is the hardware for which you want to build. You can only set one machine per project"></i>
312 </h3>
313 <p class="lead" id="selected-machine"> {{machine}}
314 <i id="change-machine" class="icon-pencil"></i>
315 </p>
316 <form id="select-machine">
317 <div class="alert alert-info">
318 <strong>Machine changes have a big impact on build outcome.</strong>
319 You cannot really compare the builds for the new machine with the previous ones.
320 </div>
321 <div class="input-append">
322 <input type="text" id="machine" autocomplete="off" value="qemux86" data-provide="typeahead"
323 data-minLength="1"
324 data-autocomplete="off"
325 data-source='[
326 ]'>
327 <button id="apply-change-machine" class="btn" type="button">Save</button>
328 <a href="#" id="cancel-machine" class="btn btn-link">Cancel</a>
329 </div>
330 <p><a href="{% url 'machines' %}" class="link">View all machines</a></p>
331 </form>
332 <p class="link-action">
333 <a href="{% url 'projectconf' project.id %}" class="link">Edit configuration variables</a>
334 <i class="icon-question-sign get-help heading-help" title="You can set other project configuration options here. Each option, like everything else in the build system, is a variable - value pair"></i>
335 </p>
336
337 </div>
338
339
340 </div>
341
342 <h2>Project details</h2>
343
344 <div class="well well-transparent">
345 <h3>Project name</h3>
346 <p class="lead">
347 {{project.name}}
348 <i title="" data-original-title="" class="icon-pencil"></i>
349 </p>
350 <h3>Project owner</h3>
351 <p class="lead">
352 {{puser.username}}
353 <i title="" data-original-title="" class="icon-pencil"></i>
354 </p>
355 <h3>Owner's email</h3>
356 <p class="lead">
357 {{puser.email}}
358 <i title="" data-original-title="" class="icon-pencil"></i>
359 </p>
360 <h3>Yocto Project version</h3>
361 <p class="lead">
362 {{project.release.name}} - {{project.release.description}}
363 <i title="" data-original-title="" class="icon-pencil"></i>
364 </p>
365 </div>
366{% endblock %}