summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2014-02-06 21:21:58 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-17 15:38:53 +0000
commitdeb3859820ef96fcf0a8eb2f1d6fce334988a329 (patch)
treebfce2c6286f93f4b3b4fa065254b9d0adbb97ac1
parent77eeb4200efa28af080c8343333cd651aaeb3923 (diff)
downloadpoky-deb3859820ef96fcf0a8eb2f1d6fce334988a329.tar.gz
bitbake: toaster: implement package summary page
Implement the updated design for the package summay page, with pop-up boxes for the layer commit ids, column filtering, and column sorting support. [YOCTO #4318] (Bitbake rev: c39b99792547b642570ea5152070e7396e812390) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/orm/models.py3
-rw-r--r--bitbake/lib/toaster/toastergui/templates/bpackage.html95
-rw-r--r--bitbake/lib/toaster/toastergui/views.py73
3 files changed, 131 insertions, 40 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 1803de60e5..c77df2243e 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -143,9 +143,8 @@ class Task_Dependency(models.Model):
143 task = models.ForeignKey(Task, related_name='task_dependencies_task') 143 task = models.ForeignKey(Task, related_name='task_dependencies_task')
144 depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends') 144 depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends')
145 145
146
147class Package(models.Model): 146class Package(models.Model):
148 search_allowed_fields = ['name', 'installed_name', 'section', 'summary'] 147 search_allowed_fields = ['name', 'version', 'revision', 'recipe__name', 'recipe__version', 'recipe__license', 'recipe__layer_version__layer__name', 'recipe__layer_version__branch', 'recipe__layer_version__commit', 'recipe__layer_version__layer__local_path']
149 build = models.ForeignKey('Build') 148 build = models.ForeignKey('Build')
150 recipe = models.ForeignKey('Recipe', null=True) 149 recipe = models.ForeignKey('Recipe', null=True)
151 name = models.CharField(max_length=100) 150 name = models.CharField(max_length=100)
diff --git a/bitbake/lib/toaster/toastergui/templates/bpackage.html b/bitbake/lib/toaster/toastergui/templates/bpackage.html
index b78ae4644f..cc8ec90395 100644
--- a/bitbake/lib/toaster/toastergui/templates/bpackage.html
+++ b/bitbake/lib/toaster/toastergui/templates/bpackage.html
@@ -1,50 +1,73 @@
1{% extends "basebuildpage.html" %} 1{% extends "basebuildpage.html" %}
2 2
3{% load projecttags %}
4
3{% block localbreadcrumb %} 5{% block localbreadcrumb %}
4<li>Packages</li> 6<li>Packages</li>
5{% endblock %} 7{% endblock %}
6 8
7{% block buildinfomain %} 9{% block buildinfomain %}
10<div class="span10">
11<div class="page-header" style="margin-top:40px;">
12<h1>
13 {% if request.GET.filter or request.GET.search and objects.count > 0 %}
14 {{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found
15 {%elif objects.paginator.count == 0%}
16 No Packages
17 {%else%}
18 Packages
19 {%endif%}
20 </h1>
21</div>
22
8{% include "basetable_top.html" %} 23{% include "basetable_top.html" %}
9 24
10 {% if not objects %} 25 {% for package in objects %}
11 <p>No packages were recorded for this target!</p> 26
12 {% else %} 27 <tr class="data">
13 28
14 <tr> 29 <!-- Package -->
15 <th>Name</th> 30 <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
16 <th>Version</th> 31 <!-- Package Version -->
17 <th>Recipe</th> 32 <td>{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td>
18 <th>Summary</th> 33 <!-- Package Size -->
19 <th>Section</th> 34 <td class="size">{{package.size|filtered_filesizeformat}}</td>
20 <th>Description</th> 35 <!-- License -->
21 <th>Size on host disk (Bytes)</th> 36 <td class="license">{{package.license}}</td>
22 <th>License</th> 37
23 <th>Dependencies List (all)</th> 38 {%if package.recipe%}
24 </tr> 39 <!-- Recipe -->
25 40 <td class="recipe__name"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.name}}</a></td>
26 {% for package in objects %} 41 <!-- Recipe Version -->
27 42 <td class="recipe__version"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.version}}</a></td>
28 <tr class="data"> 43
29 <td><a name="#{{package.name}}" href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td> 44 <!-- Layer -->
30 <td>{{package.version}}-{{package.revision}}</td> 45 <td class="recipe__layer_version__layer__name">{{package.recipe.layer_version.layer.name}}</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> 46 <!-- Layer branch -->
32 47 <td class="recipe__layer_version__branch">{{package.recipe.layer_version.branch}}</td>
33 <td>{{package.summary}}</td> 48 <!-- Layer commit -->
34 <td>{{package.section}}</td> 49 <td class="recipe__layer_version__layer__commit">
35 <td>{{package.description}}</td> 50 <a class="btn"
36 <td>{{package.size}}</td> 51 data-content="<ul class='unstyled'>
37 <td>{{package.license}}</td> 52 <li>{{package.recipe.layer_version.commit}}</li>
38 <td> 53 </ul>">
39 <div style="height: 3em; overflow:auto"> 54 {{package.recipe.layer_version.commit|truncatechars:13}}
40 {% for bpd in package.package_dependencies_source.all %} 55 </a>
41 {{bpd.dep_type}}: {{bpd.depends_on.name}} <br/>
42 {% endfor %}
43 </div>
44 </td> 56 </td>
45 {% endfor %} 57 <!-- Layer directory -->
58 <td class="recipe__layer_version__layer__local_path">{{package.recipe.layer_version.layer.local_path}}</td>
59 {%else%}
60 <td class="recipe__name"></td>
61 <td class="recipe__version"></td>
62 <td class="recipe__layer_version__layer__name"></td>
63 <td class="recipe__layer_version__branch"></td>
64 <td class="recipe__layer_version__layer__commit"></td>
65 <td class="recipe__layer_version__layer__local_path"></td>
66 {%endif%}
46 67
47 {% endif %} 68 </tr>
69 {% endfor %}
48 70
49{% include "basetable_bottom.html" %} 71{% include "basetable_bottom.html" %}
72</div>
50{% endblock %} 73{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 1105829d96..2b06e2136b 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -720,7 +720,7 @@ def diskio(request, build_id):
720 720
721def bpackage(request, build_id): 721def bpackage(request, build_id):
722 template = 'bpackage.html' 722 template = 'bpackage.html'
723 mandatory_parameters = { 'count': 100, 'page' : 1}; 723 mandatory_parameters = { 'count': 100, 'page' : 1, 'orderby':'name:+'};
724 retval = _verify_parameters( request.GET, mandatory_parameters ) 724 retval = _verify_parameters( request.GET, mandatory_parameters )
725 if retval: 725 if retval:
726 return _redirect_parameters( 'packages', request.GET, mandatory_parameters, build_id = build_id) 726 return _redirect_parameters( 'packages', request.GET, mandatory_parameters, build_id = build_id)
@@ -730,7 +730,76 @@ def bpackage(request, build_id):
730 730
731 packages = _build_page_range(Paginator(queryset, request.GET.get('count', 100)),request.GET.get('page', 1)) 731 packages = _build_page_range(Paginator(queryset, request.GET.get('count', 100)),request.GET.get('page', 1))
732 732
733 context = {'build': Build.objects.filter(pk=build_id)[0], 'objects' : packages} 733 context = {
734 'objectname': 'packages',
735 'build': Build.objects.filter(pk=build_id)[0],
736 'objects' : packages,
737 'tablecols':[
738 {
739 'name':'Package',
740 'qhelp':'Packaged output resulting from building a recipe',
741 'orderfield': _get_toggle_order(request, "name"),
742 'ordericon':_get_toggle_order_icon(request, "name"),
743 },
744 {
745 'name':'Package version',
746 'qhelp':'The package version and revision',
747 },
748 {
749 'name':'Size',
750 'qhelp':'The size of the package',
751 'orderfield': _get_toggle_order(request, "size"),
752 'ordericon':_get_toggle_order_icon(request, "size"),
753 'clclass': 'size', 'hidden': 0,
754 },
755 {
756 'name':'License',
757 'qhelp':'The license under which the package is distributed. Separate license names using | (pipe) means there is a choice between licenses. Separate license names using & (ampersand) means multiple licenses exist that cover different parts of the source',
758 'orderfield': _get_toggle_order(request, "license"),
759 'ordericon':_get_toggle_order_icon(request, "license"),
760 'clclass': 'license', 'hidden': 1,
761 },
762 {
763 'name':'Recipe',
764 'qhelp':'The name of the recipe building the package',
765 'orderfield': _get_toggle_order(request, "recipe__name"),
766 'ordericon':_get_toggle_order_icon(request, "recipe__name"),
767 'clclass': 'recipe__name', 'hidden': 0,
768 },
769 {
770 'name':'Recipe version',
771 'qhelp':'Version and revision of the recipe building the package',
772 'clclass': 'recipe__version', 'hidden': 1,
773 },
774 {
775 'name':'Layer',
776 'qhelp':'The name of the layer providing the recipe that builds the package',
777 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"),
778 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"),
779 'clclass': 'recipe__layer_version__layer__name', 'hidden': 1,
780 },
781 {
782 'name':'Layer branch',
783 'qhelp':'The Git branch of the layer providing the recipe that builds the package',
784 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"),
785 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"),
786 'clclass': 'recipe__layer_version__branch', 'hidden': 1,
787 },
788 {
789 'name':'Layer commit',
790 'qhelp':'The Git commit of the layer providing the recipe that builds the package',
791 'clclass': 'recipe__layer_version__layer__commit', 'hidden': 1,
792 },
793 {
794 'name':'Layer directory',
795 'qhelp':'Location in disk of the layer providing the recipe that builds the package',
796 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__local_path"),
797 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__local_path"),
798 'clclass': 'recipe__layer_version__layer__local_path', 'hidden': 1,
799 },
800 ]
801 }
802
734 return render(request, template, context) 803 return render(request, template, context)
735 804
736def bfile(request, build_id, package_id): 805def bfile(request, build_id, package_id):