diff options
| author | Michael Wood <michael.g.wood@intel.com> | 2016-05-26 16:12:20 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-15 08:35:04 +0100 |
| commit | a786ac14f1c6c02c38dc141125035445413f1250 (patch) | |
| tree | 0e591f980a70afecbbde39c77e62b7f12ec4a889 /bitbake/lib/toaster | |
| parent | b63f9518e718db09e14c8287fadf0bebcdf5ec9e (diff) | |
| download | poky-a786ac14f1c6c02c38dc141125035445413f1250.tar.gz | |
bitbake: toaster: port table for Built packages to ToasterTable
This is the table that displays all the packages built in the build.
Build -> Packages. Adds a template snippet for the git revision popover.
(Bitbake rev: df62f38ff4e634544c9b1e97c5f6ca45e84a4f1e)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/buildtables.py | 152 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 10 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/basebuildpage.html | 26 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/bpackage.html | 106 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html | 23 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html | 8 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 7 | ||||
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 90 |
8 files changed, 203 insertions, 219 deletions
diff --git a/bitbake/lib/toaster/toastergui/buildtables.py b/bitbake/lib/toaster/toastergui/buildtables.py new file mode 100644 index 0000000000..cf07ea8789 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/buildtables.py | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | # | ||
| 2 | # ex:ts=4:sw=4:sts=4:et | ||
| 3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
| 4 | # | ||
| 5 | # BitBake Toaster Implementation | ||
| 6 | # | ||
| 7 | # Copyright (C) 2016 Intel Corporation | ||
| 8 | # | ||
| 9 | # This program is free software; you can redistribute it and/or modify | ||
| 10 | # it under the terms of the GNU General Public License version 2 as | ||
| 11 | # published by the Free Software Foundation. | ||
| 12 | # | ||
| 13 | # This program is distributed in the hope that it will be useful, | ||
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | # GNU General Public License for more details. | ||
| 17 | # | ||
| 18 | # You should have received a copy of the GNU General Public License along | ||
| 19 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
| 20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 21 | |||
| 22 | from orm.models import Build | ||
| 23 | import toastergui.tables as tables | ||
| 24 | |||
| 25 | from toastergui.widgets import ToasterTable | ||
| 26 | |||
| 27 | |||
| 28 | class BuildTablesMixin(ToasterTable): | ||
| 29 | def get_context_data(self, **kwargs): | ||
| 30 | # We need to be explicit about which superclass we're calling here | ||
| 31 | # Otherwise the MRO gets in a right mess | ||
| 32 | context = ToasterTable.get_context_data(self, **kwargs) | ||
| 33 | context['build'] = Build.objects.get(pk=kwargs['build_id']) | ||
| 34 | return context | ||
| 35 | |||
| 36 | |||
| 37 | class BuiltPackagesTableBase(tables.PackagesTable): | ||
| 38 | """ Table to display all the packages built in a build """ | ||
| 39 | def __init__(self, *args, **kwargs): | ||
| 40 | super(BuiltPackagesTableBase, self).__init__(*args, **kwargs) | ||
| 41 | self.title = "Packages built" | ||
| 42 | self.default_orderby = "name" | ||
| 43 | |||
| 44 | def setup_queryset(self, *args, **kwargs): | ||
| 45 | build = Build.objects.get(pk=kwargs['build_id']) | ||
| 46 | self.static_context_extra['build'] = build | ||
| 47 | self.queryset = build.package_set.all().exclude(recipe=None) | ||
| 48 | self.queryset = self.queryset.order_by(self.default_orderby) | ||
| 49 | |||
| 50 | def setup_columns(self, *args, **kwargs): | ||
| 51 | super(BuiltPackagesTableBase, self).setup_columns(*args, **kwargs) | ||
| 52 | |||
| 53 | def pkg_link_template(val): | ||
| 54 | """ return the template used for the link with the val as the | ||
| 55 | element value i.e. inside the <a></a>""" | ||
| 56 | |||
| 57 | return (''' | ||
| 58 | <a href=" | ||
| 59 | {%% url "package_built_detail" extra.build.pk data.pk %%} | ||
| 60 | ">%s</a> | ||
| 61 | ''' % val) | ||
| 62 | |||
| 63 | def recipe_link_template(val): | ||
| 64 | return (''' | ||
| 65 | {%% if data.recipe %%} | ||
| 66 | <a href=" | ||
| 67 | {%% url "recipe" extra.build.pk data.recipe.pk %%} | ||
| 68 | ">%(value)s</a> | ||
| 69 | {%% else %%} | ||
| 70 | %(value)s | ||
| 71 | {%% endif %%} | ||
| 72 | ''' % {'value': val}) | ||
| 73 | |||
| 74 | add_pkg_link_to = ['name', 'version', 'size', 'license'] | ||
| 75 | add_recipe_link_to = ['recipe__name', 'recipe__version'] | ||
| 76 | |||
| 77 | # Add the recipe and pkg build links to the required columns | ||
| 78 | for column in self.columns: | ||
| 79 | # Convert to template field style accessors | ||
| 80 | tmplv = column['field_name'].replace('__', '.') | ||
| 81 | tmplv = "{{data.%s}}" % tmplv | ||
| 82 | |||
| 83 | if column['field_name'] in add_pkg_link_to: | ||
| 84 | # Don't overwrite an existing template | ||
| 85 | if column['static_data_template']: | ||
| 86 | column['static_data_template'] =\ | ||
| 87 | pkg_link_template(column['static_data_template']) | ||
| 88 | else: | ||
| 89 | column['static_data_template'] = pkg_link_template(tmplv) | ||
| 90 | |||
| 91 | column['static_data_name'] = column['field_name'] | ||
| 92 | |||
| 93 | elif column['field_name'] in add_recipe_link_to: | ||
| 94 | # Don't overwrite an existing template | ||
| 95 | if column['static_data_template']: | ||
| 96 | column['static_data_template'] =\ | ||
| 97 | recipe_link_template(column['static_data_template']) | ||
| 98 | else: | ||
| 99 | column['static_data_template'] =\ | ||
| 100 | recipe_link_template(tmplv) | ||
| 101 | column['static_data_name'] = column['field_name'] | ||
| 102 | |||
| 103 | self.add_column(title="Layer", | ||
| 104 | field_name="recipe__layer_version__layer__name", | ||
| 105 | hidden=True, | ||
| 106 | orderable=True) | ||
| 107 | |||
| 108 | self.add_column(title="Layer branch", | ||
| 109 | field_name="recipe__layer_version__branch", | ||
| 110 | hidden=True, | ||
| 111 | orderable=True) | ||
| 112 | |||
| 113 | git_rev_template = ''' | ||
| 114 | {% with vcs_ref=data.recipe.layer_version.commit %} | ||
| 115 | {% include 'snippets/gitrev_popover.html' %} | ||
| 116 | {% endwith %} | ||
| 117 | ''' | ||
| 118 | |||
| 119 | self.add_column(title="Layer commit", | ||
| 120 | static_data_name='vcs_ref', | ||
| 121 | static_data_template=git_rev_template, | ||
| 122 | hidden=True) | ||
| 123 | |||
| 124 | |||
| 125 | class BuiltPackagesTable(BuildTablesMixin, BuiltPackagesTableBase): | ||
| 126 | """ Show all the packages built for the selected build """ | ||
| 127 | def __init__(self, *args, **kwargs): | ||
| 128 | super(BuiltPackagesTable, self).__init__(*args, **kwargs) | ||
| 129 | self.title = "Packages built" | ||
| 130 | self.default_orderby = "name" | ||
| 131 | |||
| 132 | self.empty_state =\ | ||
| 133 | ('<strong>No packages were built.</strong> How did this happen?' | ||
| 134 | 'Well, BitBake reuses as much stuff as possible.' | ||
| 135 | 'If all of the packages needed were already built and available' | ||
| 136 | 'in your build infrastructure, BitBake' | ||
| 137 | 'will not rebuild any of them. This might be slightly confusing,' | ||
| 138 | 'but it does make everything faster.') | ||
| 139 | |||
| 140 | def setup_columns(self, *args, **kwargs): | ||
| 141 | super(BuiltPackagesTable, self).setup_columns(*args, **kwargs) | ||
| 142 | |||
| 143 | def remove_dep_cols(columns): | ||
| 144 | for column in columns: | ||
| 145 | # We don't need these fields | ||
| 146 | if column['static_data_name'] in ['reverse_dependencies', | ||
| 147 | 'dependencies']: | ||
| 148 | continue | ||
| 149 | |||
| 150 | yield column | ||
| 151 | |||
| 152 | self.columns = list(remove_dep_cols(self.columns)) | ||
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 0cf96a0ef3..902f62f708 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
| @@ -146,15 +146,8 @@ class LayersTable(ToasterTable): | |||
| 146 | static_data_template=git_dir_template) | 146 | static_data_template=git_dir_template) |
| 147 | 147 | ||
| 148 | revision_template = ''' | 148 | revision_template = ''' |
| 149 | {% load projecttags %} | ||
| 150 | {% with vcs_ref=data.get_vcs_reference %} | 149 | {% with vcs_ref=data.get_vcs_reference %} |
| 151 | {% if vcs_ref|is_shaid %} | 150 | {% include 'snippets/gitrev_popover.html' %} |
| 152 | <a class="btn" data-content="<ul class='unstyled'> <li>{{vcs_ref}}</li> </ul>"> | ||
| 153 | {{vcs_ref|truncatechars:10}} | ||
| 154 | </a> | ||
| 155 | {% else %} | ||
| 156 | {{vcs_ref}} | ||
| 157 | {% endif %} | ||
| 158 | {% endwith %} | 151 | {% endwith %} |
| 159 | ''' | 152 | ''' |
| 160 | 153 | ||
| @@ -718,6 +711,7 @@ class PackagesTable(ToasterTable): | |||
| 718 | 711 | ||
| 719 | self.add_column(title="Approx Size", | 712 | self.add_column(title="Approx Size", |
| 720 | orderable=True, | 713 | orderable=True, |
| 714 | field_name="size", | ||
| 721 | static_data_name="size", | 715 | static_data_name="size", |
| 722 | static_data_template="{% load projecttags %} \ | 716 | static_data_template="{% load projecttags %} \ |
| 723 | {{data.size|filtered_filesizeformat}}") | 717 | {{data.size|filtered_filesizeformat}}") |
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html index 76a602bf07..c002e42b7d 100644 --- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html +++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html | |||
| @@ -23,10 +23,19 @@ | |||
| 23 | {% block localbreadcrumb %}{% endblock %} | 23 | {% block localbreadcrumb %}{% endblock %} |
| 24 | </ul> | 24 | </ul> |
| 25 | <script> | 25 | <script> |
| 26 | $( function () { | 26 | $(document).ready(function(){ |
| 27 | $('#breadcrumb > li').append('<span class="divider">→</span>'); | 27 | $('#breadcrumb > li').append('<span class="divider">→</span>'); |
| 28 | $('#breadcrumb > li:last').addClass("active"); | 28 | $('#breadcrumb > li:last').addClass("active"); |
| 29 | $('#breadcrumb > li:last > span').remove(); | 29 | $('#breadcrumb > li:last > span').remove(); |
| 30 | |||
| 31 | $("#build-menu li a").each(function(){ | ||
| 32 | /* Set the page active state in the Build menu */ | ||
| 33 | if (window.location.href.split('?')[0] === $(this).prop("href")){ | ||
| 34 | $(this).parent().addClass("active"); | ||
| 35 | } else { | ||
| 36 | $(this).parent().removeClass("active"); | ||
| 37 | } | ||
| 38 | }); | ||
| 30 | }); | 39 | }); |
| 31 | </script> | 40 | </script> |
| 32 | </div> | 41 | </div> |
| @@ -35,7 +44,7 @@ | |||
| 35 | <div class="row"> | 44 | <div class="row"> |
| 36 | <!-- begin left sidebar container --> | 45 | <!-- begin left sidebar container --> |
| 37 | <div id="nav" class="col-md-2"> | 46 | <div id="nav" class="col-md-2"> |
| 38 | <ul class="nav nav-list well"> | 47 | <ul class="nav nav-list well" id="build-menu"> |
| 39 | <li | 48 | <li |
| 40 | {% if request.resolver_match.url_name == 'builddashboard' %} | 49 | {% if request.resolver_match.url_name == 'builddashboard' %} |
| 41 | class="active" | 50 | class="active" |
| @@ -54,25 +63,14 @@ | |||
| 54 | {% block nav-configuration %} | 63 | {% block nav-configuration %} |
| 55 | <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li> | 64 | <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li> |
| 56 | {% endblock %} | 65 | {% endblock %} |
| 57 | {% block nav-tasks %} | 66 | |
| 58 | <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li> | 67 | <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li> |
| 59 | {% endblock %} | ||
| 60 | {% block nav-recipes %} | ||
| 61 | <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li> | 68 | <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li> |
| 62 | {% endblock %} | ||
| 63 | {% block nav-packages %} | ||
| 64 | <li><a href="{% url 'packages' build.pk %}">Packages</a></li> | 69 | <li><a href="{% url 'packages' build.pk %}">Packages</a></li> |
| 65 | {% endblock %} | ||
| 66 | <li class="nav-header">Performance</li> | 70 | <li class="nav-header">Performance</li> |
| 67 | {% block nav-buildtime %} | ||
| 68 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> | 71 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> |
| 69 | {% endblock %} | ||
| 70 | {% block nav-cputime %} | ||
| 71 | <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li> | 72 | <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li> |
| 72 | {% endblock %} | ||
| 73 | {% block nav-diskio %} | ||
| 74 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> | 73 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> |
| 75 | {% endblock %} | ||
| 76 | 74 | ||
| 77 | <li class="divider"></li> | 75 | <li class="divider"></li> |
| 78 | 76 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/bpackage.html b/bitbake/lib/toaster/toastergui/templates/bpackage.html deleted file mode 100644 index 575c27b3b5..0000000000 --- a/bitbake/lib/toaster/toastergui/templates/bpackage.html +++ /dev/null | |||
| @@ -1,106 +0,0 @@ | |||
| 1 | {% extends "basebuildpage.html" %} | ||
| 2 | |||
| 3 | {% load projecttags %} | ||
| 4 | |||
| 5 | {% block title %} Packages built - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %} | ||
| 6 | {% block localbreadcrumb %} | ||
| 7 | <li>Packages</li> | ||
| 8 | {% endblock %} | ||
| 9 | |||
| 10 | {% block nav-packages %} | ||
| 11 | <li class="active"><a href="{% url 'packages' build.pk %}">Packages</a></li> | ||
| 12 | {% endblock %} | ||
| 13 | |||
| 14 | {% block buildinfomain %} | ||
| 15 | <div class="col-md-10"> | ||
| 16 | |||
| 17 | {% if not request.GET.filter and not request.GET.search and not objects.paginator.count %} | ||
| 18 | |||
| 19 | <!-- Empty - no data in database --> | ||
| 20 | <div class="page-header"> | ||
| 21 | <h1> | ||
| 22 | Packages | ||
| 23 | </h1> | ||
| 24 | </div> | ||
| 25 | <div class="alert alert-info lead"> | ||
| 26 | <strong>No packages were built.</strong> How did this happen? Well, BitBake reuses as much stuff as possible. | ||
| 27 | If all of the packages needed were already built and available in your build infrastructure, BitBake | ||
| 28 | will not rebuild any of them. This might be slightly confusing, but it does make everything faster. | ||
| 29 | </div> | ||
| 30 | |||
| 31 | {% else %} | ||
| 32 | |||
| 33 | <div class="page-header"> | ||
| 34 | <h1> | ||
| 35 | {% if request.GET.search and objects.paginator.count > 0 %} | ||
| 36 | {{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found | ||
| 37 | {%elif request.GET.search and objects.paginator.count == 0%} | ||
| 38 | No packages found | ||
| 39 | {%else%} | ||
| 40 | Packages | ||
| 41 | {%endif%} | ||
| 42 | </h1> | ||
| 43 | </div> | ||
| 44 | |||
| 45 | {% if objects.paginator.count == 0 %} | ||
| 46 | <div class="alert"> | ||
| 47 | <form class="no-results input-append" id="searchform"> | ||
| 48 | <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="input-append-addon btn" tabindex="-1"><i class="glyphicon glyphicon-remove"></i></a>{% endif %} | ||
| 49 | <button class="btn" type="submit" value="Search">Search</button> | ||
| 50 | <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all packages</button> | ||
| 51 | </form> | ||
| 52 | </div> | ||
| 53 | |||
| 54 | {% else %} | ||
| 55 | {% include "basetable_top.html" %} | ||
| 56 | |||
| 57 | {% for package in objects %} | ||
| 58 | |||
| 59 | <tr class="data"> | ||
| 60 | |||
| 61 | <!-- Package --> | ||
| 62 | <td class="package_name"><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td> | ||
| 63 | <!-- Package Version --> | ||
| 64 | <td class="package_version">{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td> | ||
| 65 | <!-- Package Size --> | ||
| 66 | <td class="size sizecol">{{package.size|filtered_filesizeformat}}</td> | ||
| 67 | <!-- License --> | ||
| 68 | <td class="license">{{package.license}}</td> | ||
| 69 | |||
| 70 | {%if package.recipe%} | ||
| 71 | <!-- Recipe --> | ||
| 72 | <td class="recipe__name"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.name}}</a></td> | ||
| 73 | <!-- Recipe Version --> | ||
| 74 | <td class="recipe__version"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.version}}</a></td> | ||
| 75 | |||
| 76 | <!-- Layer --> | ||
| 77 | <td class="recipe__layer_version__layer__name">{{package.recipe.layer_version.layer.name}}</td> | ||
| 78 | <!-- Layer branch --> | ||
| 79 | <td class="recipe__layer_version__branch">{{package.recipe.layer_version.branch}}</td> | ||
| 80 | <!-- Layer commit --> | ||
| 81 | <td class="recipe__layer_version__layer__commit"> | ||
| 82 | <a class="btn" | ||
| 83 | data-content="<ul class='list-unstyled'> | ||
| 84 | <li>{{package.recipe.layer_version.commit}}</li> | ||
| 85 | </ul>"> | ||
| 86 | {{package.recipe.layer_version.commit|truncatechars:13}} | ||
| 87 | </a> | ||
| 88 | </td> | ||
| 89 | <!-- Layer directory --> | ||
| 90 | {%else%} | ||
| 91 | <td class="recipe__name"></td> | ||
| 92 | <td class="recipe__version"></td> | ||
| 93 | <td class="recipe__layer_version__layer__name"></td> | ||
| 94 | <td class="recipe__layer_version__branch"></td> | ||
| 95 | <td class="recipe__layer_version__layer__commit"></td> | ||
| 96 | <td class="recipe__layer_version__local_path"></td> | ||
| 97 | {%endif%} | ||
| 98 | |||
| 99 | </tr> | ||
| 100 | {% endfor %} | ||
| 101 | |||
| 102 | {% include "basetable_bottom.html" %} | ||
| 103 | {% endif %} {# objects.paginator.count #} | ||
| 104 | {% endif %} {# Empty #} | ||
| 105 | </div> | ||
| 106 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html b/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html new file mode 100644 index 0000000000..4ce5c4a8a5 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | {% extends "basebuildpage.html" %} | ||
| 2 | |||
| 3 | {% load projecttags %} | ||
| 4 | |||
| 5 | {% block title %} {{title}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %} | ||
| 6 | {% block localbreadcrumb %} | ||
| 7 | <li>{{title}}</li> | ||
| 8 | {% endblock %} | ||
| 9 | |||
| 10 | {% block nav-packages %} | ||
| 11 | {% endblock %} | ||
| 12 | |||
| 13 | {% block buildinfomain %} | ||
| 14 | <div class="span10"> | ||
| 15 | {% url 'builtpackagestable' build.id as xhr_table_url %} | ||
| 16 | <div class="page-header"> | ||
| 17 | <h1> | ||
| 18 | {{title}} (<span class="table-count-{{table_name}}">0</span>) </h2> | ||
| 19 | </h1> | ||
| 20 | </div> | ||
| 21 | {% include "toastertable.html" %} | ||
| 22 | </div> | ||
| 23 | {% endblock %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html new file mode 100644 index 0000000000..281a3bd765 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | {% load projecttags %} | ||
| 2 | {% if vcs_ref|is_shaid %} | ||
| 3 | <a class="btn" data-content="<ul class='unstyled'> <li>{{vcs_ref}}</li> </ul>"> | ||
| 4 | {{vcs_ref|truncatechars:10}} | ||
| 5 | </a> | ||
| 6 | {% else %} | ||
| 7 | {{vcs_ref}} | ||
| 8 | {% endif %} | ||
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index 27b0baabfb..3ce0d51011 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
| @@ -21,6 +21,7 @@ from django.views.generic import RedirectView, TemplateView | |||
| 21 | 21 | ||
| 22 | from django.http import HttpResponseBadRequest | 22 | from django.http import HttpResponseBadRequest |
| 23 | from toastergui import tables | 23 | from toastergui import tables |
| 24 | from toastergui import buildtables | ||
| 24 | from toastergui import typeaheads | 25 | from toastergui import typeaheads |
| 25 | from toastergui import api | 26 | from toastergui import api |
| 26 | 27 | ||
| @@ -44,7 +45,11 @@ urlpatterns = patterns('toastergui.views', | |||
| 44 | url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'), | 45 | url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'), |
| 45 | url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', 'recipe_packages', name='recipe_packages'), | 46 | url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', 'recipe_packages', name='recipe_packages'), |
| 46 | 47 | ||
| 47 | url(r'^build/(?P<build_id>\d+)/packages/$', 'bpackage', name='packages'), | 48 | url(r'^build/(?P<build_id>\d+)/packages/$', |
| 49 | buildtables.BuiltPackagesTable.as_view( | ||
| 50 | template_name="buildinfo-toastertable.html"), | ||
| 51 | name='packages'), | ||
| 52 | |||
| 48 | url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'package_built_detail', | 53 | url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'package_built_detail', |
| 49 | name='package_built_detail'), | 54 | name='package_built_detail'), |
| 50 | url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$', | 55 | url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$', |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 05108975ae..de1e4139a1 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -1493,96 +1493,6 @@ def configvars(request, build_id): | |||
| 1493 | _set_parameters_values(pagesize, orderby, request) | 1493 | _set_parameters_values(pagesize, orderby, request) |
| 1494 | return response | 1494 | return response |
| 1495 | 1495 | ||
| 1496 | def bpackage(request, build_id): | ||
| 1497 | template = 'bpackage.html' | ||
| 1498 | (pagesize, orderby) = _get_parameters_values(request, 100, 'name:+') | ||
| 1499 | mandatory_parameters = { 'count' : pagesize, 'page' : 1, 'orderby' : orderby } | ||
| 1500 | retval = _verify_parameters( request.GET, mandatory_parameters ) | ||
| 1501 | if retval: | ||
| 1502 | return _redirect_parameters( 'packages', request.GET, mandatory_parameters, build_id = build_id) | ||
| 1503 | (filter_string, search_term, ordering_string) = _search_tuple(request, Package) | ||
| 1504 | queryset = Package.objects.filter(build = build_id).filter(size__gte=0) | ||
| 1505 | queryset = _get_queryset(Package, queryset, filter_string, search_term, ordering_string, 'name') | ||
| 1506 | |||
| 1507 | packages = _build_page_range(Paginator(queryset, pagesize),request.GET.get('page', 1)) | ||
| 1508 | |||
| 1509 | build = Build.objects.get( pk = build_id ) | ||
| 1510 | |||
| 1511 | context = { | ||
| 1512 | 'objectname': 'packages built', | ||
| 1513 | 'build': build, | ||
| 1514 | 'project': build.project, | ||
| 1515 | 'objects' : packages, | ||
| 1516 | 'default_orderby' : 'name:+', | ||
| 1517 | 'tablecols':[ | ||
| 1518 | { | ||
| 1519 | 'name':'Package', | ||
| 1520 | 'qhelp':'Packaged output resulting from building a recipe', | ||
| 1521 | 'orderfield': _get_toggle_order(request, "name"), | ||
| 1522 | 'ordericon':_get_toggle_order_icon(request, "name"), | ||
| 1523 | }, | ||
| 1524 | { | ||
| 1525 | 'name':'Package version', | ||
| 1526 | 'qhelp':'The package version and revision', | ||
| 1527 | }, | ||
| 1528 | { | ||
| 1529 | 'name':'Size', | ||
| 1530 | 'qhelp':'The size of the package', | ||
| 1531 | 'orderfield': _get_toggle_order(request, "size", True), | ||
| 1532 | 'ordericon':_get_toggle_order_icon(request, "size"), | ||
| 1533 | 'orderkey' : 'size', | ||
| 1534 | 'clclass': 'size', 'hidden': 0, | ||
| 1535 | 'dclass' : 'span2', | ||
| 1536 | }, | ||
| 1537 | { | ||
| 1538 | 'name':'License', | ||
| 1539 | 'qhelp':'The license under which the package is distributed. Multiple license names separated by the pipe character indicates a choice between licenses. Multiple license names separated by the ampersand character indicates multiple licenses exist that cover different parts of the source', | ||
| 1540 | 'orderfield': _get_toggle_order(request, "license"), | ||
| 1541 | 'ordericon':_get_toggle_order_icon(request, "license"), | ||
| 1542 | 'orderkey' : 'license', | ||
| 1543 | 'clclass': 'license', 'hidden': 1, | ||
| 1544 | }, | ||
| 1545 | { | ||
| 1546 | 'name':'Recipe', | ||
| 1547 | 'qhelp':'The name of the recipe building the package', | ||
| 1548 | 'orderfield': _get_toggle_order(request, "recipe__name"), | ||
| 1549 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), | ||
| 1550 | 'orderkey' : 'recipe__name', | ||
| 1551 | 'clclass': 'recipe__name', 'hidden': 0, | ||
| 1552 | }, | ||
| 1553 | { | ||
| 1554 | 'name':'Recipe version', | ||
| 1555 | 'qhelp':'Version and revision of the recipe building the package', | ||
| 1556 | 'clclass': 'recipe__version', 'hidden': 1, | ||
| 1557 | }, | ||
| 1558 | { | ||
| 1559 | 'name':'Layer', | ||
| 1560 | 'qhelp':'The name of the layer providing the recipe that builds the package', | ||
| 1561 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"), | ||
| 1562 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"), | ||
| 1563 | 'orderkey' : 'recipe__layer_version__layer__name', | ||
| 1564 | 'clclass': 'recipe__layer_version__layer__name', 'hidden': 1, | ||
| 1565 | }, | ||
| 1566 | { | ||
| 1567 | 'name':'Layer branch', | ||
| 1568 | 'qhelp':'The Git branch of the layer providing the recipe that builds the package', | ||
| 1569 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"), | ||
| 1570 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"), | ||
| 1571 | 'orderkey' : 'recipe__layer_version__branch', | ||
| 1572 | 'clclass': 'recipe__layer_version__branch', 'hidden': 1, | ||
| 1573 | }, | ||
| 1574 | { | ||
| 1575 | 'name':'Layer commit', | ||
| 1576 | 'qhelp':'The Git commit of the layer providing the recipe that builds the package', | ||
| 1577 | 'clclass': 'recipe__layer_version__layer__commit', 'hidden': 1, | ||
| 1578 | }, | ||
| 1579 | ] | ||
| 1580 | } | ||
| 1581 | |||
| 1582 | response = render(request, template, context) | ||
| 1583 | _set_parameters_values(pagesize, orderby, request) | ||
| 1584 | return response | ||
| 1585 | |||
| 1586 | def bfile(request, build_id, package_id): | 1496 | def bfile(request, build_id, package_id): |
| 1587 | template = 'bfile.html' | 1497 | template = 'bfile.html' |
| 1588 | files = Package_File.objects.filter(package = package_id) | 1498 | files = Package_File.objects.filter(package = package_id) |
