diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-12-11 16:42:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-10 15:20:25 +0000 |
commit | 2251426ae420640c082ec0d0109b9be435075411 (patch) | |
tree | 0f58f48d18bbfd9054c928f3ef554365f74d6ed8 /bitbake | |
parent | c2fc6ca2fa68aca17235cac306b6df4b882fe9ff (diff) | |
download | poky-2251426ae420640c082ec0d0109b9be435075411.tar.gz |
bitbake: toaster: Create the base page navigation structure
Updating the general container pages to use the graphical
design and features from the design phase.
In the process of adapting the Simple UI to the designed
interface, we create all the pages and the navigation
structure for the Toaster GUI.
Views for each page have been added, and the url mapping
has been updated to reflect newly added pages.
The table page has been refactored to be component-oriented
instead of class-oriented in order to facilitate reusage.
Changes are made in different layers of the template
(base, basetable) in order to maximize code reuse among
different pages in the build.
(Bitbake rev: d31f039ae31b77023722c06e66542751536a1362)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
19 files changed, 571 insertions, 159 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index d58cbeaed5..3508962e67 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html | |||
@@ -1,30 +1,64 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | {% load static %} | 2 | {% load static %} |
3 | <html> | 3 | <html> |
4 | <head> | 4 | <head> |
5 | <title>Toaster Simple Explorer</title> | 5 | <title>Toaster</title> |
6 | <script src="{% static 'js/jquery-2.0.3.js' %}"> | 6 | <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" type="text/css"> |
7 | <link rel="stylesheet" href="{% static 'css/bootstrap-responsive.min.css' %}" type='text/css'> | ||
8 | <link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}" type='text/css'> | ||
9 | <link rel="stylesheet" href="{% static 'css/prettify.css' %}" type='text/css'> | ||
10 | <link rel="stylesheet" href="{% static 'css/default.css' %}" type='text/css'> | ||
11 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
12 | <script src="{% static 'js/jquery-2.0.3.min.js' %}"> | ||
7 | </script> | 13 | </script> |
8 | <script src="{% static 'js/bootstrap.js' %}"> | 14 | <script src="{% static 'js/bootstrap.min.js' %}"> |
9 | </script> | 15 | </script> |
10 | <link href="{% static 'css/bootstrap.css' %}" rel="stylesheet" type="text/css"> | 16 | <script src="{% static 'js/prettify.js' %}"> |
11 | </head> | 17 | </script> |
18 | <script src="{% static 'js/main.js' %}"> | ||
19 | </script> | ||
20 | <script> | ||
21 | function reload_params(params) { | ||
22 | uri = window.location.href; | ||
23 | [url, parameters] = uri.split("?"); | ||
24 | // deserialize the call parameters | ||
25 | cparams = parameters.split("&"); | ||
26 | nparams = {} | ||
27 | for (i = 0; i < cparams.length; i++) { | ||
28 | temp = cparams[i].split("="); | ||
29 | nparams[temp[0]] = temp[1]; | ||
30 | } | ||
31 | // update parameter values | ||
32 | for (i in params) { | ||
33 | nparams[encodeURIComponent(i)] = encodeURIComponent(params[i]); | ||
34 | } | ||
35 | // serialize the structure | ||
36 | callparams = [] | ||
37 | for (i in nparams) { | ||
38 | callparams.push(i+"="+nparams[i]); | ||
39 | } | ||
40 | window.location.href = url+"?"+callparams.join('&'); | ||
41 | |||
42 | } | ||
43 | </script> | ||
44 | </head> | ||
12 | 45 | ||
13 | <body style="height: 100%"> | 46 | <body style="height: 100%"> |
14 | <div style="width:100%; height: 100%; position:absolute"> | 47 | <div class="navbar navbar-static-top"> |
15 | <div style="width: 100%; height: 3em" class="nav"> | 48 | <div class="navbar-inner"> |
16 | <ul class="nav nav-tabs"> | 49 | <a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a> |
17 | <li><a href="{% url "all-builds" %}">All Builds</a></li> | 50 | <a class="brand" href="/">Toaster</a> |
18 | <li><a href="{% url "all-layers" %}">All Layers</a></li> | 51 | <a class="pull-right manual" href="#"> |
19 | </ul> | 52 | <i class="icon-book"></i> |
53 | Toaster manual | ||
54 | </a> | ||
55 | </div> | ||
20 | </div> | 56 | </div> |
21 | 57 | ||
22 | <div style="overflow-y:scroll; width: 100%; position: absolute; top: 3em; bottom:70px "> | 58 | <div class="container-fluid"> |
23 | {% block pagecontent %} | 59 | {% block pagecontent %} |
24 | {% endblock %} | 60 | {% endblock %} |
25 | </div> | 61 | </div> |
26 | <div class="navbar" style="position: absolute; bottom: 0; width:100%"><br/>About Toaster | Yocto Project </div> | ||
27 | </div> | ||
28 | </body> | 62 | </body> |
29 | </html> | 63 | </html> |
30 | 64 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html index d590f28bc5..1b037f9539 100644 --- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html +++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html | |||
@@ -1,17 +1,56 @@ | |||
1 | {% extends "basetable.html" %} | 1 | {% extends "base.html" %} |
2 | 2 | {% load humanize %} | |
3 | {% block pagename %} | 3 | {% block pagecontent %} |
4 | <ul class="nav nav-tabs" style="display: inline-block"> | 4 | |
5 | <li><a>Build {{build.target_set.all|join:" "}} at {{build.started_on}} : </a></li> | 5 | |
6 | <li><a href="{% url "task" build.id %}"> Tasks </a></li> | 6 | <div class="span12"> |
7 | <li><a href="{% url "bpackage" build.id %}"> Build Packages </a></li> | 7 | <!-- Breadcrumbs --> |
8 | {% for t in build.target_set.all %} | 8 | <div class="section"> |
9 | {% if t.is_image %} | 9 | <ul class="breadcrumb" id="breadcrumb"> |
10 | <li><a href="{% url "tpackage" build.id t.pk %}"> Packages for {{t.target}} </a> </li> | 10 | <li><a href="{% url 'all-builds' %}">All builds</a></li> |
11 | {% endif %} | 11 | <li><a href="{%url 'builddashboard' build.pk%}">{{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}})</a></li> |
12 | {% endfor %} | 12 | {% block localbreadcrumb %}{% endblock %} |
13 | <li><a href="{% url "configuration" build.id %}"> Configuration </a> </li> | 13 | </ul> |
14 | </ul> | 14 | <script> |
15 | <h1>Toaster - Build {% block pagetitle %} {% endblock %}</h1> | 15 | $( function () { |
16 | $('#breadcrumb > li').append("<span class=\"divider\">→</span>"); | ||
17 | $('#breadcrumb > li:last').addClass("active"); | ||
18 | $('#breadcrumb > li:last > span').remove(); | ||
19 | }); | ||
20 | </script> | ||
21 | </div> | ||
22 | |||
23 | <div class="row-fluid"> | ||
24 | |||
25 | <!-- begin left sidebar container --> | ||
26 | <div id="nav" class="span2"> | ||
27 | <ul class="nav nav-list well"> | ||
28 | <li class="nav-header">Images</li> | ||
29 | {% for t in build.target_set.all %} | ||
30 | <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li> | ||
31 | {% endfor %} | ||
32 | <li class="nav-header">Build</li> | ||
33 | <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li> | ||
34 | <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li> | ||
35 | <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li> | ||
36 | <li><a href="{% url 'packages' build.pk %}">Packages</a></li> | ||
37 | <li class="nav-header">Performance</li> | ||
38 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> | ||
39 | <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | ||
40 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> | ||
41 | </ul> | ||
42 | </div> | ||
43 | |||
44 | <!-- end left sidebar container --> | ||
45 | <!-- Begin right container --> | ||
46 | <div class="row span10"> | ||
47 | {% block buildinfomain %}{% endblock %} | ||
48 | </div> | ||
49 | |||
50 | |||
51 | </div> | ||
52 | </div> | ||
53 | |||
54 | |||
16 | {% endblock %} | 55 | {% endblock %} |
17 | 56 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable.html b/bitbake/lib/toaster/toastergui/templates/basetable.html deleted file mode 100644 index 16628eafbe..0000000000 --- a/bitbake/lib/toaster/toastergui/templates/basetable.html +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {% block pagecontent %} | ||
4 | <script> | ||
5 | function showhideTableColumn(i, sh) { | ||
6 | if (sh) | ||
7 | $('td:nth-child('+i+'),th:nth-child('+i+')').show(); | ||
8 | else | ||
9 | $('td:nth-child('+i+'),th:nth-child('+i+')').hide(); | ||
10 | } | ||
11 | |||
12 | |||
13 | function filterTableRows(test) { | ||
14 | if (test.length > 0) { | ||
15 | var r = test.split(/[ ,]+/).map(function (e) { return new RegExp(e, 'i') }); | ||
16 | $('tr.data').map( function (i, el) { | ||
17 | (! r.map(function (j) { return j.test($(el).html())}).reduce(function (c, p) { return c && p;} )) ? $(el).hide() : $(el).show(); | ||
18 | }); | ||
19 | } else | ||
20 | { | ||
21 | $('tr.data').show(); | ||
22 | } | ||
23 | } | ||
24 | </script> | ||
25 | <div style="margin-bottom: 0.5em"> | ||
26 | |||
27 | {% block pagename %} | ||
28 | {% endblock %} | ||
29 | <div align="left" style="display:inline-block; width: 40%; margin-left: 2em"> Filter: <input type="search" id="filterstring" style="width: 80%" onkeyup="filterTableRows($('#filterstring').val())" autocomplete="off"> | ||
30 | </div> | ||
31 | {% if hideshowcols %} | ||
32 | <div align="right" style="display: inline-block; width: 40%">Show/Hide columns: | ||
33 | {% for i in hideshowcols %} | ||
34 | <span>{{i.name}} <input type="checkbox" id="ct{{i.name}}" onchange="showhideTableColumn({{i.order}}, $('#ct{{i.name}}').is(':checked'))" checked autocomplete="off"></span> | | ||
35 | {% endfor %} | ||
36 | </div> | ||
37 | {% endif %} | ||
38 | </div> | ||
39 | |||
40 | <div style="display: block; float:right; margin-left: auto; margin-right:5em"><span class="pagination" style="vertical-align: top; margin-right: 3em">Showing {{objects.start_index}} to {{objects.end_index}} out of {{objects.paginator.count}} entries. </span> | ||
41 | <ul class="pagination" style="display: block-inline"> | ||
42 | {%if objects.has_previous %} | ||
43 | <li><a href="?page={{objects.previous_page_number}}">«</a></li> | ||
44 | {%else%} | ||
45 | <li class="disabled"><a href="#">«</a></li> | ||
46 | {%endif%} | ||
47 | {% for i in objects.page_range %} | ||
48 | <li{%if i == objects.number %} class="active" {%endif%}><a href="?page={{i}}">{{i}}</a></li> | ||
49 | {% endfor %} | ||
50 | {%if objects.has_next%} | ||
51 | <li><a href="?page={{objects.next_page_number}}">»</a></li> | ||
52 | {%else%} | ||
53 | <li class="disabled"><a href="#">»</a></li> | ||
54 | {%endif%} | ||
55 | </ul> | ||
56 | </div> | ||
57 | |||
58 | <table class="table table-striped table-condensed" style="width:95%"> | ||
59 | {% block pagetable %} | ||
60 | {% endblock %} | ||
61 | </table> | ||
62 | </div> | ||
63 | |||
64 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html b/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html new file mode 100644 index 0000000000..2a6f084929 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html | |||
@@ -0,0 +1,60 @@ | |||
1 | </table> | ||
2 | |||
3 | <!-- Show pagination controls --> | ||
4 | <div class="pagination pagination-centered"> | ||
5 | <div class="pull-left"> | ||
6 | Showing {{objects.start_index}} to {{objects.end_index}} out of {{objects.paginator.count}} entries. | ||
7 | </div> | ||
8 | |||
9 | <ul class="pagination" style="display: block-inline"> | ||
10 | {%if objects.has_previous %} | ||
11 | <li><a href="?page={{objects.previous_page_number}}&count={{request.GET.count}}">«</a></li> | ||
12 | {%else%} | ||
13 | <li class="disabled"><a href="#">«</a></li> | ||
14 | {%endif%} | ||
15 | {% for i in objects.page_range %} | ||
16 | <li{%if i == objects.number %} class="active" {%endif%}><a href="?page={{i}}&count={{request.GET.count}}">{{i}}</a></li> | ||
17 | {% endfor %} | ||
18 | {%if objects.has_next%} | ||
19 | <li><a href="?page={{objects.next_page_number}}&count={{request.GET.count}}">»</a></li> | ||
20 | {%else%} | ||
21 | <li class="disabled"><a href="#">»</a></li> | ||
22 | {%endif%} | ||
23 | </ul> | ||
24 | <div class="pull-right"> | ||
25 | <span class="help-inline" style="padding-top:5px;">Show rows:</span> | ||
26 | <select style="margin-top:5px;margin-bottom:0px;" class="pagesize"> | ||
27 | {% with "2 5 10 25 50 100" as list%} | ||
28 | {% for i in list.split %}<option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option> | ||
29 | {% endfor %} | ||
30 | {% endwith %} | ||
31 | </select> | ||
32 | </div> | ||
33 | </div> | ||
34 | |||
35 | <!-- Update page display settings --> | ||
36 | |||
37 | <script> | ||
38 | $(document).ready(function() { | ||
39 | |||
40 | $('.chbxtoggle').each(function () { | ||
41 | showhideTableColumn($(this).attr('id'), $(this).is(':checked')) | ||
42 | }); | ||
43 | |||
44 | //turn edit columns dropdown into a multi-select menu | ||
45 | $('.dropdown-menu input, .dropdown-menu label').click(function(e) { | ||
46 | e.stopPropagation(); | ||
47 | }); | ||
48 | |||
49 | //show tooltip with applied filter | ||
50 | $('#filtered').tooltip({container:'table', placement:'bottom', delay:{hide:1500}, html:true}); | ||
51 | |||
52 | //progress bar tooltip | ||
53 | $('.progress, .lead span').tooltip({container:'table', placement:'top'}); | ||
54 | |||
55 | $(".pagesize").change(function () { | ||
56 | $(".pagesize option:selected").each(function () | ||
57 | {reload_params({"count":$(this).text()}); }); | ||
58 | }); | ||
59 | }); | ||
60 | </script> | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/bitbake/lib/toaster/toastergui/templates/basetable_top.html new file mode 100644 index 0000000000..b9277b4a3d --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/basetable_top.html | |||
@@ -0,0 +1,66 @@ | |||
1 | <!-- component to display a generic table --> | ||
2 | <script> | ||
3 | function showhideTableColumn(clname, sh) { | ||
4 | if (sh) $('.' + clname).show(); | ||
5 | else $('.' + clname).hide(); | ||
6 | } | ||
7 | |||
8 | |||
9 | function filterTableRows(test) { | ||
10 | if (test.length > 0) { | ||
11 | var r = test.split(/[ ,]+/).map(function (e) { return new RegExp(e, 'i') }); | ||
12 | $('tr.data').map( function (i, el) { | ||
13 | (! r.map(function (j) { return j.test($(el).html())}).reduce(function (c, p) { return c && p;} )) ? $(el).hide() : $(el).show(); | ||
14 | }); | ||
15 | } else | ||
16 | { | ||
17 | $('tr.data').show(); | ||
18 | } | ||
19 | } | ||
20 | </script> | ||
21 | |||
22 | <!-- control header --> | ||
23 | <div class="navbar"> | ||
24 | <div class="navbar-inner"> | ||
25 | <form class="navbar-search input-append pull-left"> | ||
26 | <input class="input-xxlarge" type="text" placeholder="Search {{objectname}}" /> | ||
27 | <button class="btn" type="button">Search</button> | ||
28 | </form> | ||
29 | <div class="pull-right"> | ||
30 | |||
31 | {% if tablecols %} | ||
32 | <div class="btn-group"> | ||
33 | <button class="btn dropdown-toggle" data-toggle="dropdown"> | ||
34 | Edit columns | ||
35 | <span class="caret"></span> | ||
36 | </button> | ||
37 | <ul class="dropdown-menu"> | ||
38 | |||
39 | {% for i in tablecols %} | ||
40 | <li> | ||
41 | <label class="checkbox"> | ||
42 | <input type="checkbox" class="chbxtoggle" id="{{i.clclass}}" value="ct{{i.name}}" {% if i.clclass %}{% if not i.hidden %}checked="checked"{%endif%} onchange="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))" {%else%} disabled{% endif %}/> {{i.name}} | ||
43 | </label> | ||
44 | </li> | ||
45 | {% endfor %} | ||
46 | </ul> | ||
47 | </div> | ||
48 | {% endif %} | ||
49 | |||
50 | <div style="display:inline"> | ||
51 | <span class="divider-vertical"></span> | ||
52 | <span class="help-inline" style="padding-top:5px;">Show rows:</span> | ||
53 | <select style="margin-top:5px;margin-bottom:0px;" class="pagesize"> | ||
54 | {% with "2 5 10 25 50 100" as list%} | ||
55 | {% for i in list.split %}<option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option> | ||
56 | {% endfor %} | ||
57 | {% endwith %} | ||
58 | </select> | ||
59 | </div> | ||
60 | </div> | ||
61 | </div> | ||
62 | </div> | ||
63 | |||
64 | <!-- the actual rows of the table --> | ||
65 | <table class="table table-bordered table-hover tablesorter" id="otable"> | ||
66 | |||
diff --git a/bitbake/lib/toaster/toastergui/templates/bpackage.html b/bitbake/lib/toaster/toastergui/templates/bpackage.html index 67fc65ca3e..3329ddae51 100644 --- a/bitbake/lib/toaster/toastergui/templates/bpackage.html +++ b/bitbake/lib/toaster/toastergui/templates/bpackage.html | |||
@@ -1,7 +1,12 @@ | |||
1 | {% extends "basebuildpage.html" %} | 1 | {% extends "basebuildpage.html" %} |
2 | 2 | ||
3 | {% block pagetitle %}Packages{% endblock %} | 3 | {% block localbreadcrumb %} |
4 | {% block pagetable %} | 4 | <li>Packages</li> |
5 | {% endblock %} | ||
6 | |||
7 | {% block buildinfomain %} | ||
8 | {% include "basetable_top.html" %} | ||
9 | |||
5 | {% if not objects %} | 10 | {% if not objects %} |
6 | <p>No packages were recorded for this target!</p> | 11 | <p>No packages were recorded for this target!</p> |
7 | {% else %} | 12 | {% else %} |
@@ -21,7 +26,7 @@ | |||
21 | {% for package in objects %} | 26 | {% for package in objects %} |
22 | 27 | ||
23 | <tr class="data"> | 28 | <tr class="data"> |
24 | <td><a name="#{{package.name}}" href="{% url "bfile" build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td> | 29 | <td><a name="#{{package.name}}" href="{% url "package" build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td> |
25 | <td>{{package.version}}-{{package.revision}}</td> | 30 | <td>{{package.version}}-{{package.revision}}</td> |
26 | <td>{%if package.recipe%}<a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td> | 31 | <td>{%if package.recipe%}<a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td> |
27 | 32 | ||
@@ -41,4 +46,5 @@ | |||
41 | 46 | ||
42 | {% endif %} | 47 | {% endif %} |
43 | 48 | ||
49 | {% include "basetable_bottom.html" %} | ||
44 | {% endblock %} | 50 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/build.html b/bitbake/lib/toaster/toastergui/templates/build.html index 4fa87d5271..27ce1ccbc5 100644 --- a/bitbake/lib/toaster/toastergui/templates/build.html +++ b/bitbake/lib/toaster/toastergui/templates/build.html | |||
@@ -1,43 +1,96 @@ | |||
1 | {% extends "basetable.html" %} | 1 | {% extends "base.html" %} |
2 | |||
3 | |||
4 | {% load projecttags %} | ||
5 | {% load humanize %} | ||
6 | |||
7 | {% block pagecontent %} | ||
8 | <div class="row-fluid"> | ||
9 | |||
10 | <div class="page-header" style="margin-top:40px;"> | ||
11 | <h1> | ||
12 | Recent Builds | ||
13 | </h1> | ||
14 | </div> | ||
15 | {{build_mru}} | ||
16 | {% for build in mru %} | ||
17 | <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}"> | ||
18 | <div class="row-fluid"> | ||
19 | <div class="lead span5"> | ||
20 | {%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%} | ||
21 | <a href="{%url 'builddashboard' build.pk%}"> | ||
22 | <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> | ||
23 | </a> | ||
24 | </div> | ||
25 | {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} | ||
26 | <div class="span2 lead"> | ||
27 | {% if build.errors_no %} | ||
28 | <i class="icon-minus-sign red"></i> <a href="{%url 'builddashboard' build.pk%}" class="error">{{build.errors_no}} error{{build.errors_no|pluralize}}</a> | ||
29 | {% endif %} | ||
30 | </div> | ||
31 | <div class="span2 lead"> | ||
32 | {% if build.warnings_no %} | ||
33 | <i class="icon-warning-sign yellow"></i> <a href="{%url 'builddashboard' build.pk%}" class="warning">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a> | ||
34 | {% endif %} | ||
35 | </div> | ||
36 | <div class="lead pull-right"> | ||
37 | Build time: <a href="build-time.html">{{ build|timespent }}</a> | ||
38 | </div> | ||
39 | {%endif%}{%if build.outcome == build.IN_PROGRESS %} | ||
40 | <div class="span4"> | ||
41 | <div class="progress" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete"> | ||
42 | <div style="width: {{build.completeper}}%;" class="bar"></div> | ||
43 | </div> | ||
44 | </div> | ||
45 | <div class="lead pull-right">ETA: in {{build.eta|naturaltime}}</div> | ||
46 | {%endif%} | ||
47 | </div> | ||
48 | </div> | ||
49 | |||
50 | {% endfor %} | ||
2 | 51 | ||
3 | {% block pagename %} | ||
4 | <h1>Toaster - Builds</h1> | ||
5 | {% endblock %} | ||
6 | 52 | ||
7 | {% block pagetable %} | 53 | <div class="page-header" style="margin-top:40px;"> |
54 | <h1> | ||
55 | All builds | ||
56 | </h1> | ||
57 | </div> | ||
58 | |||
59 | {% include "basetable_top.html" %} | ||
8 | 60 | ||
9 | {% load projecttags %} | ||
10 | <tr> | 61 | <tr> |
11 | <th>Outcome</th> | 62 | <th class="outcome span2"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="The outcome tells you if a build completed successfully or failed"></i> <a href="#" style="font-weight:normal;">Outcome</a> <div class="btn-group pull-right"> <a href="#outcome" role="button" class="btn btn-mini" data-toggle="modal"> <i class="icon-filter"></i> </a> </div> </th> |
12 | <th>Started On</th> | 63 | <th class="target"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="This is the build target(s): one or more recipes or image recipes"></i> <a href="#" style="font-weight:normal;">Target</a> </th> |
13 | <th>Completed On</th> | 64 | <th class="machine span3"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="The machine is the hardware for which you are building"></i> <a href="#" style="font-weight:normal;">Machine</a> </th> |
14 | <th>Target</th> | 65 | <th class="started_on"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="The date and time you started the build"></i> <a href="#" style="font-weight:normal;">Started on</a> <div class="btn-group pull-right"> <a href="#started-on" role="button" class="btn btn-mini" data-toggle="modal"> <i class="icon-filter"></i> </a> </div> </th> |
15 | <th>Machine</th> | 66 | <th class="completed_on"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="The date and time the build finished"></i> <a href="#" class="sorted"> Completed on </a> <div class="btn-group pull-right"> <a href="#completed-on" role="button" class="btn btn-mini" data-toggle="modal"> <i class="icon-filter"></i> </a> </div> <i class="icon-caret-down"></i> </th> |
16 | <th>Time</th> | 67 | <th class="failed_tasks"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="How many tasks failed during the build"></i> <a href="#" style="font-weight:normal;">Failed tasks</a> <div class="btn-group pull-right"> <a href="#failed-tasks" role="button" class="btn btn-mini" data-toggle="modal"> <i class="icon-filter"></i> </a> </div> <!--div id="filtered" class="btn-group pull-right" title="<p>Showing only builds with failed tasks</p><p><a class='btn btn-mini btn-primary' href='#'>Show all builds</a></p>"> <a class="btn btn-mini btn-primary"> <i class="icon-filter"></i> </a> </div--> </th> |
17 | <th>Errors</th> | 68 | <th class="errors"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="How many errors were encountered during the build (if any)"></i> <a href="#" style="font-weight:normal;">Errors</a> <div class="btn-group pull-right"> <a href="#errors" role="button" class="btn btn-mini" data-toggle="modal"> <i class="icon-filter"></i> </a> </div> </th> |
18 | <th>Warnings</th> | 69 | <th class="warnings"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="How many warnigns were encountered during the build (if any)"></i> <a href="#" style="font-weight:normal;">Warnings</a> <div class="btn-group pull-right"> <a href="#warnings" role="button" class="btn btn-mini" data-toggle="modal"> <i class="icon-filter"></i> </a> </div> <!--div id="filtered" class="btn-group pull-right" title="<p>Showing only builds without warnings</p><p><a class='btn btn-mini btn-primary' href='#'>Show all builds</a></p>"> <a class="btn btn-mini btn-primary"> <i class="icon-filter"></i> </a> </div--> </th> |
19 | <th>Output</th> | 70 | <th class="time"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="How long it took the build to finish"></i> <a href="#" style="font-weight:normal;">Time</a> </th> |
20 | <th>Log</th> | 71 | <th class="log span4"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="The location in disk of the build main log file"></i> <a href="#" style="font-weight:normal;">Log</a> </th> |
21 | <th>Bitbake Version</th> | 72 | <th class="output"> <i class="icon-question-sign get-help" data-toggle="tooltip" title="The root file system types produced by the build. You can find them in your <code>/build/tmp/deploy/images/</code> directory"></i> <a href="#" style="font-weight:normal;">Output</a> </th> |
22 | <th>Build Name</th> | 73 | |
23 | </tr> | 74 | </tr> |
24 | {% for build in objects %} | 75 | {% for build in objects %} |
25 | <tr class="data"> | 76 | <tr class="data"> |
26 | <td><a href="{% url "configuration" build.id %}">{{build.get_outcome_display}}</a></td> | 77 | <td class="outcome"><a href="{% url "configuration" 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> |
27 | <td>{{build.started_on}}</td> | 78 | <td class="target">{% for t in build.target_set.all %}{%if t.is_image %}<a href="{% url "target" build.id t.id %}">{% endif %}{{t.target}}{% if t.is_image %}</a>{% endif %}<br/>{% endfor %}</td> |
28 | <td>{{build.completed_on}}</td> | 79 | <td class="machine">{{build.machine}}</td> |
29 | <td>{% for t in build.target_set.all %}{%if t.is_image %}<a href="{% url "tpackage" build.id t.id %}">{% endif %}{{t.target}}{% if t.is_image %}</a>{% endif %}<br/>{% endfor %}</td> | 80 | <td class="started_on">{{build.started_on}}</td> |
30 | <td>{{build.machine}}</td> | 81 | <td class="completed_on">{{build.completed_on}}</td> |
31 | <td>{% time_difference build.started_on build.completed_on %}</td> | 82 | <td class="failed_tasks"></td> |
32 | <td>{{build.errors_no}}:{% if build.errors_no %}{% for error in logs %}{% if error.build == build %}{% if error.level == 2 %}<p>{{error.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td> | 83 | <td class="errors">{% if build.errors_no %}<a class="error" href="#">{{build.errors_no}} error{{build.errors_no|pluralize}}</a>{%endif%}</td> |
33 | <td>{{build.warnings_no}}:{% if build.warnings_no %}{% for warning in logs %}{% if warning.build == build %}{% if warning.level == 1 %}<p>{{warning.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td> | 84 | <td class="warnings">{% if build.warnings_no %}<a class="warning" href="#">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>{%endif%}</td> |
34 | <td>{% if build.outcome == 0 %}{% for t in build.target_set.all %}{% if t.is_image %}{{build.image_fstypes}}{% endif %}{% endfor %}{% endif %}</td> | 85 | <td class="time">{{build|timespent}}</td> |
35 | <td>{{build.cooker_log_path}}</td> | 86 | <td class="log">{{build.log}}</td> |
36 | <td>{{build.bitbake_version}}</td> | 87 | <td class="output">{% if build.outcome == 0 %}{% for t in build.target_set.all %}{% if t.is_image %}{{build.image_fstypes}}{% endif %}{% endfor %}{% endif %}</td> |
37 | <td>{{build.build_name}}</td> | ||
38 | </tr> | 88 | </tr> |
39 | 89 | ||
40 | {% endfor %} | 90 | {% endfor %} |
41 | {% endblock %} | ||
42 | 91 | ||
43 | 92 | ||
93 | {% include "basetable_bottom.html" %} | ||
94 | |||
95 | </div> | ||
96 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html new file mode 100644 index 0000000000..7c58cc0b25 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html | |||
@@ -0,0 +1,8 @@ | |||
1 | {% extends "basebuildpage.html" %} | ||
2 | {% block localbreadcrumb %} | ||
3 | <li>Dashboard</li> | ||
4 | {% endblock %} | ||
5 | |||
6 | {% block buildinfomain %} | ||
7 | |||
8 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/buildtime.html b/bitbake/lib/toaster/toastergui/templates/buildtime.html new file mode 100644 index 0000000000..ea84ae797c --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/buildtime.html | |||
@@ -0,0 +1,4 @@ | |||
1 | {% extends "basebuildpage.html" %} | ||
2 | {% block localbreadcrumb %} | ||
3 | <li>Build Time</li> | ||
4 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/configuration.html b/bitbake/lib/toaster/toastergui/templates/configuration.html index 521620fdce..e390a95ff5 100644 --- a/bitbake/lib/toaster/toastergui/templates/configuration.html +++ b/bitbake/lib/toaster/toastergui/templates/configuration.html | |||
@@ -1,7 +1,11 @@ | |||
1 | {% extends "basebuildpage.html" %} | 1 | {% extends "basebuildpage.html" %} |
2 | {% block localbreadcrumb %} | ||
3 | <li>Configuration</li> | ||
4 | {% endblock %} | ||
5 | |||
6 | {% block buildinfomain %} | ||
2 | 7 | ||
3 | {% block pagetitle %}Configuration{% endblock %} | 8 | {% include "basetable_top.html" %} |
4 | {% block pagetable %} | ||
5 | 9 | ||
6 | <tr> | 10 | <tr> |
7 | <th>Name</th> | 11 | <th>Name</th> |
@@ -19,4 +23,6 @@ | |||
19 | <td>{{variable.variable_value}}</td> | 23 | <td>{{variable.variable_value}}</td> |
20 | {% endfor %} | 24 | {% endfor %} |
21 | 25 | ||
26 | {% include "basetable_bottom.html" %} | ||
27 | |||
22 | {% endblock %} | 28 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/cpuusage.html b/bitbake/lib/toaster/toastergui/templates/cpuusage.html new file mode 100644 index 0000000000..02f07b7605 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/cpuusage.html | |||
@@ -0,0 +1,4 @@ | |||
1 | {% extends "basebuildpage.html" %} | ||
2 | {% block localbreadcrumb %} | ||
3 | <li>Cpu Usage</li> | ||
4 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/diskio.html b/bitbake/lib/toaster/toastergui/templates/diskio.html new file mode 100644 index 0000000000..c5cef6f385 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/diskio.html | |||
@@ -0,0 +1,4 @@ | |||
1 | {% extends "basebuildpage.html" %} | ||
2 | {% block localbreadcrumb %} | ||
3 | <li>Disk I/O</li> | ||
4 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/recipe.html b/bitbake/lib/toaster/toastergui/templates/recipe.html index d7f57eb9ea..87c69b8d3c 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipe.html +++ b/bitbake/lib/toaster/toastergui/templates/recipe.html | |||
@@ -1,14 +1,11 @@ | |||
1 | {% extends "basetable.html" %} | 1 | {% extends "basebuildpage.html" %} |
2 | 2 | ||
3 | {% block pagename %} | 3 | {% block localbreadcrumb %} |
4 | <ul class="nav nav-tabs" style="display: inline-block"> | 4 | <li>Recipes</li> |
5 | <li><a>Layer {{layer_version.layer.name}} : {{layer_version.branch}} : {{layer_version.commit}} : {{layer_version.priority}}</a></li> | ||
6 | </ul> | ||
7 | <h1>Toaster - Recipes for a Layer</h1> | ||
8 | {% endblock %} | 5 | {% endblock %} |
9 | 6 | ||
10 | {% block pagetable %} | 7 | {% block buildinfomain %} |
11 | {% load projecttags %} | 8 | {% include "basetable_top.html" %} |
12 | 9 | ||
13 | <tr> | 10 | <tr> |
14 | </tr> | 11 | </tr> |
@@ -49,4 +46,6 @@ | |||
49 | 46 | ||
50 | {% endfor %} | 47 | {% endfor %} |
51 | 48 | ||
49 | {% include "basetable_bottom.html" %} | ||
50 | |||
52 | {% endblock %} | 51 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/target.html b/bitbake/lib/toaster/toastergui/templates/target.html new file mode 100644 index 0000000000..f2d0ad461b --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/target.html | |||
@@ -0,0 +1,8 @@ | |||
1 | {% extends "basebuildpage.html" %} | ||
2 | |||
3 | {% block localbreadcrumb %} | ||
4 | <li>Target</li> | ||
5 | {% endblock %} | ||
6 | |||
7 | {% block buildinfomain %} | ||
8 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/task.html b/bitbake/lib/toaster/toastergui/templates/task.html index de965ab797..6af2c51277 100644 --- a/bitbake/lib/toaster/toastergui/templates/task.html +++ b/bitbake/lib/toaster/toastergui/templates/task.html | |||
@@ -1,7 +1,13 @@ | |||
1 | {% extends "basebuildpage.html" %} | 1 | {% extends "basebuildpage.html" %} |
2 | 2 | ||
3 | {% block pagetitle %}Tasks{% endblock %} | 3 | {% block localbreadcrumb %} |
4 | {% block pagetable %} | 4 | <li>Tasks</li> |
5 | {% endblock %} | ||
6 | |||
7 | {% block buildinfomain %} | ||
8 | {% include "basetable_top.html" %} | ||
9 | |||
10 | |||
5 | {% if not objects %} | 11 | {% if not objects %} |
6 | <p>No tasks were executed in this build!</p> | 12 | <p>No tasks were executed in this build!</p> |
7 | {% else %} | 13 | {% else %} |
@@ -64,4 +70,5 @@ | |||
64 | 70 | ||
65 | {% endif %} | 71 | {% endif %} |
66 | 72 | ||
73 | {% include "basetable_bottom.html" %} | ||
67 | {% endblock %} | 74 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 0c0d804c0c..5f60379932 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -24,3 +24,8 @@ register = template.Library() | |||
24 | @register.simple_tag | 24 | @register.simple_tag |
25 | def time_difference(start_time, end_time): | 25 | def time_difference(start_time, end_time): |
26 | return end_time - start_time | 26 | return end_time - start_time |
27 | |||
28 | @register.filter(name = 'timespent') | ||
29 | def timespent(build_object): | ||
30 | tdsec = (build_object.completed_on - build_object.started_on).total_seconds() | ||
31 | return "%02d:%02d:%02d" % (int(tdsec/3600), int((tdsec - tdsec/ 3600)/ 60), int(tdsec) % 60) | ||
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index b84c95f08b..f531eb0137 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
@@ -19,14 +19,34 @@ | |||
19 | from django.conf.urls import patterns, include, url | 19 | from django.conf.urls import patterns, include, url |
20 | from django.views.generic import RedirectView | 20 | from django.views.generic import RedirectView |
21 | 21 | ||
22 | urlpatterns = patterns('bldviewer.views', | 22 | urlpatterns = patterns('toastergui.views', |
23 | url(r'^builds/$', 'build', name='all-builds'), | 23 | # landing page |
24 | url(r'^build/(?P<build_id>\d+)/task/$', 'task', name='task'), | 24 | url(r'^builds/$', 'builds', name='all-builds'), |
25 | url(r'^build/(?P<build_id>\d+)/packages/$', 'bpackage', name='bpackage'), | 25 | # build info navigation |
26 | url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)/files/$', 'bfile', name='bfile'), | 26 | url(r'^build/(?P<build_id>\d+)$', 'builddashboard', name="builddashboard"), |
27 | url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packages/$', 'tpackage', name='tpackage'), | 27 | |
28 | url(r'^build/(?P<build_id>\d+)/configuration/$', 'configuration', name='configuration'), | 28 | url(r'^build/(?P<build_id>\d+)/tasks/$', 'tasks', name='tasks'), |
29 | url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', 'task', name='task'), | ||
30 | |||
31 | url(r'^build/(?P<build_id>\d+)/recipes/$', 'recipes', name='recipes'), | ||
32 | url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'), | ||
33 | |||
34 | url(r'^build/(?P<build_id>\d+)/packages/$', 'bpackage', name='packages'), | ||
35 | url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'bfile', name='package'), | ||
36 | |||
37 | # images are known as targets in the internal model | ||
38 | url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'target', name='target'), | ||
39 | url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packages$', 'tpackage', name='targetpackages'), | ||
40 | |||
41 | url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'), | ||
42 | url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'), | ||
43 | url(r'^build/(?P<build_id>\d+)/cpuusage$', 'cpuusage', name='cpuusage'), | ||
44 | url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'), | ||
45 | |||
46 | |||
47 | # urls not linked from the dashboard | ||
29 | url(r'^layers/$', 'layer', name='all-layers'), | 48 | url(r'^layers/$', 'layer', name='all-layers'), |
30 | url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'), | 49 | url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'), |
50 | # default redirection | ||
31 | url(r'^$', RedirectView.as_view( url= 'builds/')), | 51 | url(r'^$', RedirectView.as_view( url= 'builds/')), |
32 | ) | 52 | ) |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 7cb9b42379..663e03dfd2 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -19,7 +19,7 @@ | |||
19 | import operator | 19 | import operator |
20 | 20 | ||
21 | from django.db.models import Q | 21 | from django.db.models import Q |
22 | from django.shortcuts import render | 22 | from django.shortcuts import render, redirect |
23 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable | 23 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable |
24 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency | 24 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency |
25 | from orm.models import Target_Installed_Package | 25 | from orm.models import Target_Installed_Package |
@@ -35,6 +35,7 @@ def _build_page_range(paginator, index = 1): | |||
35 | except EmptyPage: | 35 | except EmptyPage: |
36 | page = paginator.page(paginator.num_pages) | 36 | page = paginator.page(paginator.num_pages) |
37 | 37 | ||
38 | |||
38 | page.page_range = [page.number] | 39 | page.page_range = [page.number] |
39 | crt_range = 0 | 40 | crt_range = 0 |
40 | for i in range(1,5): | 41 | for i in range(1,5): |
@@ -48,22 +49,124 @@ def _build_page_range(paginator, index = 1): | |||
48 | break | 49 | break |
49 | return page | 50 | return page |
50 | 51 | ||
51 | @cache_control(no_store=True) | ||
52 | def build(request): | ||
53 | template = 'build.html' | ||
54 | logs = LogMessage.objects.all() | ||
55 | 52 | ||
56 | build_info = _build_page_range(Paginator(Build.objects.order_by("-id"), 10),request.GET.get('page', 1)) | 53 | def _verify_parameters(g, mandatory_parameters): |
54 | miss = [] | ||
55 | for mp in mandatory_parameters: | ||
56 | if not mp in g: | ||
57 | miss.append(mp) | ||
58 | if len(miss): | ||
59 | return miss | ||
60 | return None | ||
61 | |||
62 | def _redirect_parameters(view, g, mandatory_parameters): | ||
63 | import urllib | ||
64 | from django.core.urlresolvers import reverse | ||
65 | url = reverse(view) | ||
66 | params = {} | ||
67 | for i in g: | ||
68 | params[i] = g[i] | ||
69 | for i in mandatory_parameters: | ||
70 | if not i in params: | ||
71 | params[i] = mandatory_parameters[i] | ||
72 | |||
73 | return redirect(url + "?%s" % urllib.urlencode(params)) | ||
74 | |||
57 | 75 | ||
58 | context = {'objects': build_info, 'logs': logs , | 76 | # shows the "all builds" page |
59 | 'hideshowcols' : [ | 77 | def builds(request): |
60 | {'name': 'Output', 'order':10}, | 78 | template = 'build.html' |
61 | {'name': 'Log', 'order':11}, | 79 | # define here what parameters the view needs in the GET portion in order to |
80 | # be able to display something. 'count' and 'page' are mandatory for all views | ||
81 | # that use paginators. | ||
82 | mandatory_parameters = { 'count': 10, 'page' : 1}; | ||
83 | retval = _verify_parameters( request.GET, mandatory_parameters ) | ||
84 | if retval: | ||
85 | return _redirect_parameters( builds, request.GET, mandatory_parameters) | ||
86 | |||
87 | # retrieve the objects that will be displayed in the table | ||
88 | build_info = _build_page_range(Paginator(Build.objects.exclude(outcome = Build.IN_PROGRESS).order_by("-id"), request.GET.get('count', 10)),request.GET.get('page', 1)) | ||
89 | |||
90 | # build view-specific information; this is rendered specifically in the builds page | ||
91 | build_mru = Build.objects.order_by("-started_on")[:3] | ||
92 | for b in [ x for x in build_mru if x.outcome == Build.IN_PROGRESS ]: | ||
93 | tf = Task.objects.filter(build = b) | ||
94 | b.completeper = tf.exclude(order__isnull=True).count()*100/tf.count() | ||
95 | from django.utils import timezone | ||
96 | b.eta = timezone.now() + ((timezone.now() - b.started_on)*100/b.completeper) | ||
97 | |||
98 | # send the data to the template | ||
99 | context = { | ||
100 | # specific info for | ||
101 | 'mru' : build_mru, | ||
102 | # TODO: common objects for all table views, adapt as needed | ||
103 | 'objects' : build_info, | ||
104 | 'tablecols' : [ | ||
105 | {'name': 'Target ', 'clclass': 'target',}, | ||
106 | {'name': 'Machine ', 'clclass': 'machine'}, | ||
107 | {'name': 'Completed on ', 'clclass': 'completed_on'}, | ||
108 | {'name': 'Failed tasks ', 'clclass': 'failed_tasks'}, | ||
109 | {'name': 'Errors ', 'clclass': 'errors_no'}, | ||
110 | {'name': 'Warnings', 'clclass': 'warnings_no'}, | ||
111 | {'name': 'Output ', 'clclass': 'output'}, | ||
112 | {'name': 'Started on ', 'clclass': 'started_on', 'hidden' : 1}, | ||
113 | {'name': 'Time ', 'clclass': 'time', 'hidden' : 1}, | ||
114 | {'name': 'Output', 'clclass': 'output'}, | ||
115 | {'name': 'Log', 'clclass': 'log', 'hidden': 1}, | ||
62 | ]} | 116 | ]} |
63 | 117 | ||
64 | return render(request, template, context) | 118 | return render(request, template, context) |
65 | 119 | ||
66 | 120 | ||
121 | # build dashboard for a single build, coming in as argument | ||
122 | def builddashboard(request, build_id): | ||
123 | template = "builddashboard.html" | ||
124 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
125 | return redirect(builds) | ||
126 | context = { | ||
127 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
128 | } | ||
129 | return render(request, template, context) | ||
130 | |||
131 | def task(request, build_id, task_id): | ||
132 | template = "singletask.html" | ||
133 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
134 | return redirect(builds) | ||
135 | context = { | ||
136 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
137 | } | ||
138 | return render(request, template, context) | ||
139 | |||
140 | def recipe(request, build_id, recipe_id): | ||
141 | template = "recipe.html" | ||
142 | if Recipe.objects.filter(pk=recipe_id).count() == 0 : | ||
143 | return redirect(builds) | ||
144 | context = { | ||
145 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
146 | 'object' : Recipe.objects.filter(pk=recipe_id)[0], | ||
147 | } | ||
148 | return render(request, template, context) | ||
149 | |||
150 | def package(request, build_id, package_id): | ||
151 | template = "singlepackage.html" | ||
152 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
153 | return redirect(builds) | ||
154 | context = { | ||
155 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
156 | } | ||
157 | return render(request, template, context) | ||
158 | |||
159 | def target(request, build_id, target_id): | ||
160 | template = "target.html" | ||
161 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
162 | return redirect(builds) | ||
163 | context = { | ||
164 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
165 | } | ||
166 | return render(request, template, context) | ||
167 | |||
168 | |||
169 | |||
67 | def _find_task_revdep(task): | 170 | def _find_task_revdep(task): |
68 | tp = [] | 171 | tp = [] |
69 | for p in Task_Dependency.objects.filter(depends_on=task): | 172 | for p in Task_Dependency.objects.filter(depends_on=task): |
@@ -81,7 +184,7 @@ def _find_task_provider(task): | |||
81 | return trc | 184 | return trc |
82 | return None | 185 | return None |
83 | 186 | ||
84 | def task(request, build_id): | 187 | def tasks(request, build_id): |
85 | template = 'task.html' | 188 | template = 'task.html' |
86 | 189 | ||
87 | tasks = _build_page_range(Paginator(Task.objects.filter(build=build_id), 100),request.GET.get('page', 1)) | 190 | tasks = _build_page_range(Paginator(Task.objects.filter(build=build_id), 100),request.GET.get('page', 1)) |
@@ -94,12 +197,52 @@ def task(request, build_id): | |||
94 | 197 | ||
95 | return render(request, template, context) | 198 | return render(request, template, context) |
96 | 199 | ||
200 | def recipes(request, build_id): | ||
201 | template = 'recipe.html' | ||
202 | |||
203 | recipes = _build_page_range(Paginator(Recipe.objects.filter(build_recipe=build_id), 100),request.GET.get('page', 1)) | ||
204 | |||
205 | context = {'build': Build.objects.filter(pk=build_id)[0], 'objects': recipes} | ||
206 | |||
207 | return render(request, template, context) | ||
208 | |||
209 | |||
97 | def configuration(request, build_id): | 210 | def configuration(request, build_id): |
98 | template = 'configuration.html' | 211 | template = 'configuration.html' |
99 | variables = _build_page_range(Paginator(Variable.objects.filter(build=build_id), 50), request.GET.get('page', 1)) | 212 | variables = _build_page_range(Paginator(Variable.objects.filter(build=build_id), 50), request.GET.get('page', 1)) |
100 | context = {'build': Build.objects.filter(pk=build_id)[0], 'objects' : variables} | 213 | context = {'build': Build.objects.filter(pk=build_id)[0], 'objects' : variables} |
101 | return render(request, template, context) | 214 | return render(request, template, context) |
102 | 215 | ||
216 | def buildtime(request, build_id): | ||
217 | template = "buildtime.html" | ||
218 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
219 | return redirect(builds) | ||
220 | context = { | ||
221 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
222 | } | ||
223 | return render(request, template, context) | ||
224 | |||
225 | def cpuusage(request, build_id): | ||
226 | template = "cpuusage.html" | ||
227 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
228 | return redirect(builds) | ||
229 | context = { | ||
230 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
231 | } | ||
232 | return render(request, template, context) | ||
233 | |||
234 | def diskio(request, build_id): | ||
235 | template = "diskio.html" | ||
236 | if Build.objects.filter(pk=build_id).count() == 0 : | ||
237 | return redirect(builds) | ||
238 | context = { | ||
239 | 'build' : Build.objects.filter(pk=build_id)[0], | ||
240 | } | ||
241 | return render(request, template, context) | ||
242 | |||
243 | |||
244 | |||
245 | |||
103 | def bpackage(request, build_id): | 246 | def bpackage(request, build_id): |
104 | template = 'bpackage.html' | 247 | template = 'bpackage.html' |
105 | packages = Package.objects.filter(build = build_id) | 248 | packages = Package.objects.filter(build = build_id) |
@@ -227,8 +370,8 @@ def model_explorer(request, model_name): | |||
227 | response_data['count'] = queryset.count() | 370 | response_data['count'] = queryset.count() |
228 | else: | 371 | else: |
229 | response_data['count'] = 0 | 372 | response_data['count'] = 0 |
230 | |||
231 | response_data['list'] = serializers.serialize('json', queryset) | 373 | response_data['list'] = serializers.serialize('json', queryset) |
374 | # response_data = serializers.serialize('json', queryset) | ||
232 | 375 | ||
233 | return HttpResponse(json.dumps(response_data), | 376 | return HttpResponse(json.dumps(response_data), |
234 | content_type='application/json') | 377 | content_type='application/json') |
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index b76218b959..679035e887 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
@@ -133,6 +133,15 @@ TEMPLATE_DIRS = ( | |||
133 | # Don't forget to use absolute paths, not relative paths. | 133 | # Don't forget to use absolute paths, not relative paths. |
134 | ) | 134 | ) |
135 | 135 | ||
136 | TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth', | ||
137 | 'django.core.context_processors.debug', | ||
138 | 'django.core.context_processors.i18n', | ||
139 | 'django.core.context_processors.media', | ||
140 | 'django.core.context_processors.static', | ||
141 | 'django.core.context_processors.tz', | ||
142 | 'django.contrib.messages.context_processors.messages', | ||
143 | "django.core.context_processors.request") | ||
144 | |||
136 | INSTALLED_APPS = ( | 145 | INSTALLED_APPS = ( |
137 | #'django.contrib.auth', | 146 | #'django.contrib.auth', |
138 | #'django.contrib.contenttypes', | 147 | #'django.contrib.contenttypes', |
@@ -144,6 +153,7 @@ INSTALLED_APPS = ( | |||
144 | # 'django.contrib.admin', | 153 | # 'django.contrib.admin', |
145 | # Uncomment the next line to enable admin documentation: | 154 | # Uncomment the next line to enable admin documentation: |
146 | # 'django.contrib.admindocs', | 155 | # 'django.contrib.admindocs', |
156 | 'django.contrib.humanize', | ||
147 | 'orm', | 157 | 'orm', |
148 | 'toastermain', | 158 | 'toastermain', |
149 | 'toastergui', | 159 | 'toastergui', |