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
poky-deb3859820ef96fcf0a8eb2f1d6fce334988a329.tar.bz2
poky-deb3859820ef96fcf0a8eb2f1d6fce334988a329.zip
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):
task = models.ForeignKey(Task, related_name='task_dependencies_task')
depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends')
-
class Package(models.Model):
- search_allowed_fields = ['name', 'installed_name', 'section', 'summary']
+ 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']
build = models.ForeignKey('Build')
recipe = models.ForeignKey('Recipe', null=True)
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 @@
{% extends "basebuildpage.html" %}
+{% load projecttags %}
+
{% block localbreadcrumb %}
<li>Packages</li>
{% endblock %}
{% block buildinfomain %}
+<div class="span10">
+<div class="page-header" style="margin-top:40px;">
+<h1>
+ {% if request.GET.filter or request.GET.search and objects.count > 0 %}
+ {{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found
+ {%elif objects.paginator.count == 0%}
+ No Packages
+ {%else%}
+ Packages
+ {%endif%}
+ </h1>
+</div>
+
{% include "basetable_top.html" %}
- {% if not objects %}
- <p>No packages were recorded for this target!</p>
- {% else %}
-
- <tr>
- <th>Name</th>
- <th>Version</th>
- <th>Recipe</th>
- <th>Summary</th>
- <th>Section</th>
- <th>Description</th>
- <th>Size on host disk (Bytes)</th>
- <th>License</th>
- <th>Dependencies List (all)</th>
- </tr>
-
- {% for package in objects %}
-
- <tr class="data">
- <td><a name="#{{package.name}}" href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td>
- <td>{{package.version}}-{{package.revision}}</td>
- <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>
-
- <td>{{package.summary}}</td>
- <td>{{package.section}}</td>
- <td>{{package.description}}</td>
- <td>{{package.size}}</td>
- <td>{{package.license}}</td>
- <td>
- <div style="height: 3em; overflow:auto">
- {% for bpd in package.package_dependencies_source.all %}
- {{bpd.dep_type}}: {{bpd.depends_on.name}} <br/>
- {% endfor %}
- </div>
+ {% for package in objects %}
+
+ <tr class="data">
+
+ <!-- Package -->
+ <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
+ <!-- Package Version -->
+ <td>{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td>
+ <!-- Package Size -->
+ <td class="size">{{package.size|filtered_filesizeformat}}</td>
+ <!-- License -->
+ <td class="license">{{package.license}}</td>
+
+ {%if package.recipe%}
+ <!-- Recipe -->
+ <td class="recipe__name"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.name}}</a></td>
+ <!-- Recipe Version -->
+ <td class="recipe__version"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.version}}</a></td>
+
+ <!-- Layer -->
+ <td class="recipe__layer_version__layer__name">{{package.recipe.layer_version.layer.name}}</td>
+ <!-- Layer branch -->
+ <td class="recipe__layer_version__branch">{{package.recipe.layer_version.branch}}</td>
+ <!-- Layer commit -->
+ <td class="recipe__layer_version__layer__commit">
+ <a class="btn"
+ data-content="<ul class='unstyled'>
+ <li>{{package.recipe.layer_version.commit}}</li>
+ </ul>">
+ {{package.recipe.layer_version.commit|truncatechars:13}}
+ </a>
</td>
- {% endfor %}
+ <!-- Layer directory -->
+ <td class="recipe__layer_version__layer__local_path">{{package.recipe.layer_version.layer.local_path}}</td>
+ {%else%}
+ <td class="recipe__name"></td>
+ <td class="recipe__version"></td>
+ <td class="recipe__layer_version__layer__name"></td>
+ <td class="recipe__layer_version__branch"></td>
+ <td class="recipe__layer_version__layer__commit"></td>
+ <td class="recipe__layer_version__layer__local_path"></td>
+ {%endif%}
- {% endif %}
+ </tr>
+ {% endfor %}
{% include "basetable_bottom.html" %}
+</div>
{% 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):
def bpackage(request, build_id):
template = 'bpackage.html'
- mandatory_parameters = { 'count': 100, 'page' : 1};
+ mandatory_parameters = { 'count': 100, 'page' : 1, 'orderby':'name:+'};
retval = _verify_parameters( request.GET, mandatory_parameters )
if retval:
return _redirect_parameters( 'packages', request.GET, mandatory_parameters, build_id = build_id)
@@ -730,7 +730,76 @@ def bpackage(request, build_id):
packages = _build_page_range(Paginator(queryset, request.GET.get('count', 100)),request.GET.get('page', 1))
- context = {'build': Build.objects.filter(pk=build_id)[0], 'objects' : packages}
+ context = {
+ 'objectname': 'packages',
+ 'build': Build.objects.filter(pk=build_id)[0],
+ 'objects' : packages,
+ 'tablecols':[
+ {
+ 'name':'Package',
+ 'qhelp':'Packaged output resulting from building a recipe',
+ 'orderfield': _get_toggle_order(request, "name"),
+ 'ordericon':_get_toggle_order_icon(request, "name"),
+ },
+ {
+ 'name':'Package version',
+ 'qhelp':'The package version and revision',
+ },
+ {
+ 'name':'Size',
+ 'qhelp':'The size of the package',
+ 'orderfield': _get_toggle_order(request, "size"),
+ 'ordericon':_get_toggle_order_icon(request, "size"),
+ 'clclass': 'size', 'hidden': 0,
+ },
+ {
+ 'name':'License',
+ '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',
+ 'orderfield': _get_toggle_order(request, "license"),
+ 'ordericon':_get_toggle_order_icon(request, "license"),
+ 'clclass': 'license', 'hidden': 1,
+ },
+ {
+ 'name':'Recipe',
+ 'qhelp':'The name of the recipe building the package',
+ 'orderfield': _get_toggle_order(request, "recipe__name"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__name"),
+ 'clclass': 'recipe__name', 'hidden': 0,
+ },
+ {
+ 'name':'Recipe version',
+ 'qhelp':'Version and revision of the recipe building the package',
+ 'clclass': 'recipe__version', 'hidden': 1,
+ },
+ {
+ 'name':'Layer',
+ 'qhelp':'The name of the layer providing the recipe that builds the package',
+ 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"),
+ 'clclass': 'recipe__layer_version__layer__name', 'hidden': 1,
+ },
+ {
+ 'name':'Layer branch',
+ 'qhelp':'The Git branch of the layer providing the recipe that builds the package',
+ 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"),
+ 'clclass': 'recipe__layer_version__branch', 'hidden': 1,
+ },
+ {
+ 'name':'Layer commit',
+ 'qhelp':'The Git commit of the layer providing the recipe that builds the package',
+ 'clclass': 'recipe__layer_version__layer__commit', 'hidden': 1,
+ },
+ {
+ 'name':'Layer directory',
+ 'qhelp':'Location in disk of the layer providing the recipe that builds the package',
+ 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__local_path"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__local_path"),
+ 'clclass': 'recipe__layer_version__layer__local_path', 'hidden': 1,
+ },
+ ]
+ }
+
return render(request, template, context)
def bfile(request, build_id, package_id):