diff options
author | Dave Lerner <dave.lerner@windriver.com> | 2014-04-08 16:32:21 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-09 17:00:02 +0100 |
commit | d3e5632efb1f10143c748c169f6439f39eb3cf21 (patch) | |
tree | 8e6709581e91d2d8f46856656560d18ea78063fd /bitbake | |
parent | dc7d3d29108d63eb5ecf276769f0099a5bc3ab86 (diff) | |
download | poky-d3e5632efb1f10143c748c169f6439f39eb3cf21.tar.gz |
bitbake: toaster: sort on size in detail pages
[YOCTO 5778]
Implements the features described in the attachment to bugzilla 5778
- new global changes to the format of size data, and
- adding sorts by selected columns to specific detail pages.
Although new pagination and row search capabilities are shown on the
screen shots for the 5778 attachment, those features are specified in
a different bugzilla entry 5777 and are not implemented in this commit.
Also, the 5778 spec includes table sorting for the recipe package
detail page, but sorting for that page was not implemented in this
commit due to complications with sorting then returning to a page that
is only one URL fragment in a template.
The scope of file changes are described below.
Changes to support new 'size' field column formats...
default.css - added sizecol class style (right justified)
projecttags.py - changed filtered_filesizeformat to allow
".0" suffixes
Changes that add class 'sizecol, span2(as spec'd) ' to <th> and/or
<td> size columns were made to...
dirinfo.py,
package_built_dependencies.html,
package_included_dependencies.html,
recipe.html,
bpackage.html, and
target.html
More significant changes to support detail page table sorting
are:
- tablesort.html: New created to implement the sort icons,
directions, and table headings, and
suppress sort handling if 'disable_sort' in context,
without search or pagination elements ingrained
in basetable_top. Confining the changes to this small file
reduces the impact (testing and risk) on the larger set of
files that arleady include basetable_top/bottom files.
- view.py: Modified the following view functions with
- trivial changes for size formatting to the views: target,
- changes to package_built_detail, package_included_detail,
package_included_reverse_dependencies to handle the sorting
implementation as well as moving headings and size
formatting for size columns from templates to the views.
- Implementation of the detail sorting using above in:
package_built_detail.html,
package_included_detail.html, and
package_included_reverse_dependencies.html
to include the tablesort heading setup, format the size column,
and iterate over the new sorted objects, suppressing sorts if
table row count less than 2.
(Bitbake rev: d16126e9abfffde66ab70865a81997322847d44e)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
13 files changed, 161 insertions, 73 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index e33f177e95..2c283feccf 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css | |||
@@ -62,6 +62,9 @@ td a:hover { color: #000000; text-decoration: underline; } | |||
62 | .table tbody tr.error > td { background-color: #FFFFFF; } /* override default Bootstrap behaviour */ | 62 | .table tbody tr.error > td { background-color: #FFFFFF; } /* override default Bootstrap behaviour */ |
63 | .table-hover tbody tr.error:hover > td { background-color: #F5F5F5;} /* override default Bootstrap behaviour */ | 63 | .table-hover tbody tr.error:hover > td { background-color: #F5F5F5;} /* override default Bootstrap behaviour */ |
64 | 64 | ||
65 | /* Right justify Bootstrap table columns for size fields */ | ||
66 | .table .sizecol { text-align: right; } | ||
67 | |||
65 | /* Set error, warning, success and muted styles */ | 68 | /* Set error, warning, success and muted styles */ |
66 | .error, .red, td.error a, tr.error a { color: #b94a48; } | 69 | .error, .red, td.error a, tr.error a { color: #b94a48; } |
67 | a.error:hover, a.error:focus, tr.error a:hover { color: #943A38; text-decoration: underline; } | 70 | a.error:hover, a.error:focus, tr.error a:hover { color: #943A38; text-decoration: underline; } |
@@ -127,4 +130,3 @@ select { width: auto; } | |||
127 | 130 | ||
128 | 131 | ||
129 | 132 | ||
130 | |||
diff --git a/bitbake/lib/toaster/toastergui/templates/bpackage.html b/bitbake/lib/toaster/toastergui/templates/bpackage.html index c6ec634f83..2d4948be4b 100644 --- a/bitbake/lib/toaster/toastergui/templates/bpackage.html +++ b/bitbake/lib/toaster/toastergui/templates/bpackage.html | |||
@@ -64,7 +64,7 @@ | |||
64 | <!-- Package Version --> | 64 | <!-- Package Version --> |
65 | <td>{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td> | 65 | <td>{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td> |
66 | <!-- Package Size --> | 66 | <!-- Package Size --> |
67 | <td class="size">{{package.size|filtered_filesizeformat}}</td> | 67 | <td class="size sizecol">{{package.size|filtered_filesizeformat}}</td> |
68 | <!-- License --> | 68 | <!-- License --> |
69 | <td class="license">{{package.license}}</td> | 69 | <td class="license">{{package.license}}</td> |
70 | 70 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/dirinfo.html b/bitbake/lib/toaster/toastergui/templates/dirinfo.html index 9b76a1cb8c..749ae242ea 100644 --- a/bitbake/lib/toaster/toastergui/templates/dirinfo.html +++ b/bitbake/lib/toaster/toastergui/templates/dirinfo.html | |||
@@ -76,7 +76,7 @@ | |||
76 | 76 | ||
77 | /* setup td specific formatting */ | 77 | /* setup td specific formatting */ |
78 | var link_to = td(o.link_to); | 78 | var link_to = td(o.link_to); |
79 | var size = td(o.size); | 79 | var size = '<td class = "sizecol">' + o.size + '</td>' |
80 | var permission = td(o.permission); | 80 | var permission = td(o.permission); |
81 | var owner = td(o.owner); | 81 | var owner = td(o.owner); |
82 | var group = td(o.group); | 82 | var group = td(o.group); |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html b/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html index 4e86da519d..a0c5a1e4f0 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html +++ b/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html | |||
@@ -31,7 +31,7 @@ | |||
31 | <tr> | 31 | <tr> |
32 | <th>Package</th> | 32 | <th>Package</th> |
33 | <th>Version</th> | 33 | <th>Version</th> |
34 | <th>Size</th> | 34 | <th class="sizecol span2">Size</th> |
35 | </tr> | 35 | </tr> |
36 | </thead> | 36 | </thead> |
37 | <tbody> | 37 | <tbody> |
@@ -49,7 +49,7 @@ | |||
49 | </td> | 49 | </td> |
50 | {% endif %} | 50 | {% endif %} |
51 | <td>{{runtime_dep.version}}</td> | 51 | <td>{{runtime_dep.version}}</td> |
52 | <td>{{runtime_dep.size|filtered_filesizeformat}}</td> | 52 | <td class="sizecol">{{runtime_dep.size|filtered_filesizeformat}}</td> |
53 | </tr> | 53 | </tr> |
54 | {% endfor %} | 54 | {% endfor %} |
55 | </tbody> | 55 | </tbody> |
@@ -62,7 +62,7 @@ | |||
62 | <tr> | 62 | <tr> |
63 | <th>Package</th> | 63 | <th>Package</th> |
64 | <th>Version</th> | 64 | <th>Version</th> |
65 | <th>Size</th> | 65 | <th class="sizecol span2">Size</th> |
66 | <th> | 66 | <th> |
67 | <i class="icon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></i> | 67 | <i class="icon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></i> |
68 | Relationship type | 68 | Relationship type |
@@ -84,7 +84,7 @@ | |||
84 | </td> | 84 | </td> |
85 | {% endif %} | 85 | {% endif %} |
86 | <td>{{other_dep.version}}</td> | 86 | <td>{{other_dep.version}}</td> |
87 | <td>{{other_dep.size|filtered_filesizeformat}}</td> | 87 | <td class="sizecol">{{other_dep.size|filtered_filesizeformat}}</td> |
88 | <td> | 88 | <td> |
89 | {{other_dep.dep_type_display}} | 89 | {{other_dep.dep_type_display}} |
90 | <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i> | 90 | <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i> |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_built_detail.html b/bitbake/lib/toaster/toastergui/templates/package_built_detail.html index 3aa1b2a8a7..0fe01165da 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_built_detail.html +++ b/bitbake/lib/toaster/toastergui/templates/package_built_detail.html | |||
@@ -23,18 +23,12 @@ | |||
23 | <div class="alert alert-info"> | 23 | <div class="alert alert-info"> |
24 | <strong>{{package.fullpackagespec}}</strong> is <strong>not included</strong> in any image. This page shows you the files added to an image root file system if you include <strong>{{package.fullpackagespec}}</strong> in future builds. | 24 | <strong>{{package.fullpackagespec}}</strong> is <strong>not included</strong> in any image. This page shows you the files added to an image root file system if you include <strong>{{package.fullpackagespec}}</strong> in future builds. |
25 | </div> | 25 | </div> |
26 | <table class="table table-bordered table-hover"> | 26 | {% include "tablesort.html" %} |
27 | <thead> | ||
28 | <tr> | ||
29 | <th>File</th> | ||
30 | <th>Size</th> | ||
31 | </tr> | ||
32 | </thead> | ||
33 | <tbody> | 27 | <tbody> |
34 | {% for file in package.buildfilelist_package.all|dictsort:"path" %} | 28 | {% for file in objects %} |
35 | <tr> | 29 | <tr> |
36 | <td>{{file.path}}</td> | 30 | <td class="path">{{file.path}}</td> |
37 | <td>{{file.size|filtered_filesizeformat}}</td> | 31 | <td class="filesize sizecol">{{file.size|filtered_filesizeformat}}</td> |
38 | </tr> | 32 | </tr> |
39 | {% endfor %} | 33 | {% endfor %} |
40 | </tbody> | 34 | </tbody> |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html b/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html index 9169ee95d4..642ca69568 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html +++ b/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html | |||
@@ -20,7 +20,7 @@ | |||
20 | <tr> | 20 | <tr> |
21 | <th>Package</th> | 21 | <th>Package</th> |
22 | <th>Version</th> | 22 | <th>Version</th> |
23 | <th>Size</th> | 23 | <th class='sizecol span2'>Size</th> |
24 | </tr> | 24 | </tr> |
25 | </thead> | 25 | </thead> |
26 | <tbody> | 26 | <tbody> |
@@ -39,7 +39,7 @@ | |||
39 | </td> | 39 | </td> |
40 | {% endif %} | 40 | {% endif %} |
41 | <td>{{runtime_dep.version}} </td> | 41 | <td>{{runtime_dep.version}} </td> |
42 | <td>{{runtime_dep.size|filtered_filesizeformat}} </td> | 42 | <td class='sizecol'>{{runtime_dep.size|filtered_filesizeformat}} </td> |
43 | </tr> | 43 | </tr> |
44 | {% endfor %} | 44 | {% endfor %} |
45 | </tbody> | 45 | </tbody> |
@@ -57,7 +57,7 @@ | |||
57 | <tr> | 57 | <tr> |
58 | <th>Package</th> | 58 | <th>Package</th> |
59 | <th>Version</th> | 59 | <th>Version</th> |
60 | <th>Size</th> | 60 | <th class='sizecol span2'>Size</th> |
61 | <th> | 61 | <th> |
62 | <i class="icon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></i> | 62 | <i class="icon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></i> |
63 | Relationship type | 63 | Relationship type |
@@ -83,7 +83,7 @@ | |||
83 | </td> | 83 | </td> |
84 | {% endif %} | 84 | {% endif %} |
85 | <td>{{other_dep.version}} </td> | 85 | <td>{{other_dep.version}} </td> |
86 | <td>{{other_dep.size|filtered_filesizeformat}} </td> | 86 | <td class='sizecol'>{{other_dep.size|filtered_filesizeformat}} </td> |
87 | <td> | 87 | <td> |
88 | {{other_dep.dep_type_display}} | 88 | {{other_dep.dep_type_display}} |
89 | <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i> | 89 | <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i> |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_included_detail.html b/bitbake/lib/toaster/toastergui/templates/package_included_detail.html index e89ebdf58c..d2aa26eefa 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_included_detail.html +++ b/bitbake/lib/toaster/toastergui/templates/package_included_detail.html | |||
@@ -17,22 +17,16 @@ | |||
17 | <div class="tab-content"> | 17 | <div class="tab-content"> |
18 | <div class="tab-pane active" id="files"> | 18 | <div class="tab-pane active" id="files"> |
19 | {% if packageFileCount > 0 %} | 19 | {% if packageFileCount > 0 %} |
20 | <table class="table table-bordered table-hover"> | 20 | {% include "tablesort.html" %} |
21 | <thead> | ||
22 | <tr> | ||
23 | <th>File</th> | ||
24 | <th>Size</th> | ||
25 | </tr> | ||
26 | </thead> | ||
27 | <tbody> | 21 | <tbody> |
28 | {% for file in package.buildfilelist_package.all|dictsort:"path" %} | 22 | {% for file in objects %} |
29 | <tr> | 23 | <tr> |
30 | <td> | 24 | <td class="path"> |
31 | <a href="{% url 'dirinfo_filepath' build.id target.id file.path %}"> | 25 | <a href="{% url 'dirinfo_filepath' build.id target.id file.path %}"> |
32 | {{file.path}} | 26 | {{file.path}} |
33 | </a> | 27 | </a> |
34 | </td> | 28 | </td> |
35 | <td>{{file.size|filtered_filesizeformat}}</td> | 29 | <td class="filesize sizecol" >{{file.size|filtered_filesizeformat}}</td> |
36 | </tr> | 30 | </tr> |
37 | {% endfor %} | 31 | {% endfor %} |
38 | </tbody> | 32 | </tbody> |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html b/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html index 1efcb1a610..a36464cad5 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html +++ b/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html | |||
@@ -20,21 +20,14 @@ | |||
20 | <strong>{{package.fullpackagespec}}</strong> has no reverse runtime dependencies. | 20 | <strong>{{package.fullpackagespec}}</strong> has no reverse runtime dependencies. |
21 | </div> | 21 | </div> |
22 | {% else %} | 22 | {% else %} |
23 | <table class="table table-bordered table-hover"> | 23 | {% include "tablesort.html" %} |
24 | <thead> | ||
25 | <tr> | ||
26 | <th>Package</th> | ||
27 | <th>Version</th> | ||
28 | <th>Size</th> | ||
29 | </tr> | ||
30 | </thead> | ||
31 | <tbody> | 24 | <tbody> |
32 | {% for reverse_dep in reverse_deps|dictsort:"name" %} | 25 | {% for reverse_dep in objects %} |
33 | <tr {{reverse_dep.size|format_vpackage_rowclass}} > | 26 | <tr {{reverse_dep.size|format_vpackage_rowclass}} > |
34 | {% if reverse_dep.size != -1 %} | 27 | {% if reverse_dep.size != -1 %} |
35 | <td> | 28 | <td> |
36 | <a href="{% url 'package_included_detail' build.id target.id reverse_dep.dependent_id %}"> | 29 | <a href="{% url 'package_included_detail' build.id target.id reverse_dep.package_id %}"> |
37 | {{reverse_dep.name}} | 30 | {{reverse_dep.package.name}} |
38 | </a> | 31 | </a> |
39 | <script>fmtAliasHelp("{{reverse_dep.name}}", "{{reverse_dep.alias}}", true)</script> | 32 | <script>fmtAliasHelp("{{reverse_dep.name}}", "{{reverse_dep.alias}}", true)</script> |
40 | </td> | 33 | </td> |
@@ -44,8 +37,8 @@ | |||
44 | </td> | 37 | </td> |
45 | {% endif %} | 38 | {% endif %} |
46 | 39 | ||
47 | <td>{{reverse_dep.version}} </td> | 40 | <td>{{reverse_dep.package.version}} </td> |
48 | <td>{{reverse_dep.size|filtered_filesizeformat}} </td> | 41 | <td class='sizecol'>{{reverse_dep.package.size|filtered_filesizeformat}} </td> |
49 | </tr> | 42 | </tr> |
50 | {% endfor %} | 43 | {% endfor %} |
51 | </tbody> | 44 | </tbody> |
diff --git a/bitbake/lib/toaster/toastergui/templates/recipe.html b/bitbake/lib/toaster/toastergui/templates/recipe.html index c846aa9340..6e9cd23424 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipe.html +++ b/bitbake/lib/toaster/toastergui/templates/recipe.html | |||
@@ -149,7 +149,7 @@ | |||
149 | <th> | 149 | <th> |
150 | Version | 150 | Version |
151 | </th> | 151 | </th> |
152 | <th> | 152 | <th class="sizecol span2"> |
153 | Size | 153 | Size |
154 | </th> | 154 | </th> |
155 | </tr> | 155 | </tr> |
@@ -161,7 +161,7 @@ | |||
161 | <tr> | 161 | <tr> |
162 | <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td> | 162 | <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td> |
163 | <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}_{{package.revision}}</a></td> | 163 | <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}_{{package.revision}}</a></td> |
164 | <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.size|filtered_filesizeformat}}</a></td> | 164 | <td class="sizecol"><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.size|filtered_filesizeformat}}</a></td> |
165 | </tr> | 165 | </tr> |
166 | 166 | ||
167 | {% endfor %} | 167 | {% endfor %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/tablesort.html b/bitbake/lib/toaster/toastergui/templates/tablesort.html new file mode 100644 index 0000000000..bf311b6edd --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/tablesort.html | |||
@@ -0,0 +1,38 @@ | |||
1 | {% load projecttags %} | ||
2 | <!-- component to display a generic table --> | ||
3 | {% if disable_sort %} | ||
4 | <table class="table table-bordered table-hover" id="detail_table"> | ||
5 | <thead> | ||
6 | <tr> | ||
7 | {% for tc in tablecols %} | ||
8 | <th class="{{tc.dclass}} {{tc.clclass}}"> | ||
9 | {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%} | ||
10 | {{tc.name}} | ||
11 | </th> | ||
12 | {% endfor %} | ||
13 | </tr> | ||
14 | </thead> | ||
15 | {% else %} | ||
16 | <table class="table table-bordered table-hover tablesorter" id="otable"> | ||
17 | <thead> | ||
18 | <!-- Table header row; generated from "tablecols" entry in the context dict --> | ||
19 | <tr> | ||
20 | {% for tc in tablecols %} | ||
21 | <th class="{{tc.dclass}} {{tc.clclass}}"> | ||
22 | {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%} | ||
23 | {%if tc.orderfield%} | ||
24 | <a {%if tc.ordericon%} class="sorted" {%endif%} | ||
25 | href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })" > | ||
26 | {{tc.name}} | ||
27 | </a> | ||
28 | {%else%} | ||
29 | <span class="muted"> | ||
30 | {{tc.name}} | ||
31 | </span> | ||
32 | {%endif%} | ||
33 | {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%} | ||
34 | </th> | ||
35 | {% endfor %} | ||
36 | </tr> | ||
37 | </thead> | ||
38 | {% endif %} | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/target.html b/bitbake/lib/toaster/toastergui/templates/target.html index 5db0c0ccb5..3a0c4d7998 100644 --- a/bitbake/lib/toaster/toastergui/templates/target.html +++ b/bitbake/lib/toaster/toastergui/templates/target.html | |||
@@ -79,10 +79,10 @@ | |||
79 | {{package.version|filtered_packageversion:package.revision}} | 79 | {{package.version|filtered_packageversion:package.revision}} |
80 | </a> | 80 | </a> |
81 | </td> | 81 | </td> |
82 | <td class="package_size"> | 82 | <td class="package-size sizecol"> |
83 | {{package.size|filtered_installedsize:package.installed_size|filtered_filesizeformat}} | 83 | {{package.size|filtered_installedsize:package.installed_size|filtered_filesizeformat}} |
84 | </td> | 84 | </td> |
85 | <td class="size_over_total"> | 85 | <td class="size_over_total sizecol"> |
86 | {{package|filter_sizeovertotal:packages_sum}} | 86 | {{package|filter_sizeovertotal:packages_sum}} |
87 | </td> | 87 | </td> |
88 | <td class="license"> | 88 | <td class="license"> |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index e8634574c0..be75b214ac 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -118,7 +118,7 @@ def filtered_filesizeformat(value): | |||
118 | if value == -1: | 118 | if value == -1: |
119 | return '' | 119 | return '' |
120 | 120 | ||
121 | return filesizeformat(value).replace("bytes", "B").replace(".0", "") | 121 | return filesizeformat(value).replace("bytes", "B") |
122 | 122 | ||
123 | @register.filter | 123 | @register.filter |
124 | def filtered_packagespec(value): | 124 | def filtered_packagespec(value): |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index f5fa72e610..36eb0bf97e 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -563,13 +563,13 @@ def target(request, build_id, target_id): | |||
563 | 'qhelp':'The size of the package', | 563 | 'qhelp':'The size of the package', |
564 | 'orderfield': _get_toggle_order(request, "size", True), | 564 | 'orderfield': _get_toggle_order(request, "size", True), |
565 | 'ordericon':_get_toggle_order_icon(request, "size"), | 565 | 'ordericon':_get_toggle_order_icon(request, "size"), |
566 | 'clclass': 'package_size', | 566 | 'clclass': 'package_size span2', |
567 | 'hidden' : 0, | 567 | 'hidden' : 0, |
568 | }, | 568 | }, |
569 | { | 569 | { |
570 | 'name':'Size over total (%)', | 570 | 'name':'Size over total (%)', |
571 | 'qhelp':'Proportion of the overall included package size represented by this package', | 571 | 'qhelp':'Proportion of the overall included package size represented by this package', |
572 | 'clclass': 'size_over_total', | 572 | 'clclass': 'size_over_total span2', |
573 | 'hidden' : 1, | 573 | 'hidden' : 1, |
574 | }, | 574 | }, |
575 | { | 575 | { |
@@ -1254,7 +1254,7 @@ def bpackage(request, build_id): | |||
1254 | 'qhelp':'The size of the package', | 1254 | 'qhelp':'The size of the package', |
1255 | 'orderfield': _get_toggle_order(request, "size", True), | 1255 | 'orderfield': _get_toggle_order(request, "size", True), |
1256 | 'ordericon':_get_toggle_order_icon(request, "size"), | 1256 | 'ordericon':_get_toggle_order_icon(request, "size"), |
1257 | 'clclass': 'size', 'hidden': 0, | 1257 | 'clclass': 'size span2', 'hidden': 0, |
1258 | }, | 1258 | }, |
1259 | { | 1259 | { |
1260 | 'name':'License', | 1260 | 'name':'License', |
@@ -1456,13 +1456,40 @@ def package_built_detail(request, build_id, package_id): | |||
1456 | template = "package_built_detail.html" | 1456 | template = "package_built_detail.html" |
1457 | if Build.objects.filter(pk=build_id).count() == 0 : | 1457 | if Build.objects.filter(pk=build_id).count() == 0 : |
1458 | return redirect(builds) | 1458 | return redirect(builds) |
1459 | |||
1460 | # follow convention for pagination w/ search although not used for this view | ||
1461 | queryset = Package_File.objects.filter(package_id__exact=package_id) | ||
1462 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'path:+'}; | ||
1463 | retval = _verify_parameters( request.GET, mandatory_parameters ) | ||
1464 | if retval: | ||
1465 | return _redirect_parameters( 'package_built_detail', request.GET, mandatory_parameters, build_id = build_id, package_id = package_id) | ||
1466 | |||
1467 | (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File) | ||
1468 | paths = _get_queryset(Package_File, queryset, filter_string, search_term, ordering_string, 'path') | ||
1469 | |||
1459 | package = Package.objects.filter(pk=package_id)[0] | 1470 | package = Package.objects.filter(pk=package_id)[0] |
1460 | package.fullpackagespec = _get_fullpackagespec(package) | 1471 | package.fullpackagespec = _get_fullpackagespec(package) |
1461 | context = { | 1472 | context = { |
1462 | 'build' : Build.objects.filter(pk=build_id)[0], | 1473 | 'build' : Build.objects.filter(pk=build_id)[0], |
1463 | 'package' : package, | 1474 | 'package' : package, |
1464 | 'dependency_count' : _get_package_dependency_count(package, -1, False), | 1475 | 'dependency_count' : _get_package_dependency_count(package, -1, False), |
1476 | 'objects' : paths, | ||
1477 | 'tablecols':[ | ||
1478 | { | ||
1479 | 'name':'File', | ||
1480 | 'orderfield': _get_toggle_order(request, "path"), | ||
1481 | 'ordericon':_get_toggle_order_icon(request, "path"), | ||
1482 | }, | ||
1483 | { | ||
1484 | 'name':'Size', | ||
1485 | 'orderfield': _get_toggle_order(request, "size", True), | ||
1486 | 'ordericon':_get_toggle_order_icon(request, "size"), | ||
1487 | 'dclass': 'sizecol span2', | ||
1488 | }, | ||
1489 | ] | ||
1465 | } | 1490 | } |
1491 | if paths.all().count() < 2: | ||
1492 | context['disable_sort'] = True; | ||
1466 | return render(request, template, context) | 1493 | return render(request, template, context) |
1467 | 1494 | ||
1468 | def package_built_dependencies(request, build_id, package_id): | 1495 | def package_built_dependencies(request, build_id, package_id): |
@@ -1488,6 +1515,17 @@ def package_included_detail(request, build_id, target_id, package_id): | |||
1488 | if Build.objects.filter(pk=build_id).count() == 0 : | 1515 | if Build.objects.filter(pk=build_id).count() == 0 : |
1489 | return redirect(builds) | 1516 | return redirect(builds) |
1490 | 1517 | ||
1518 | |||
1519 | # follow convention for pagination w/ search although not used for this view | ||
1520 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'path:+'}; | ||
1521 | retval = _verify_parameters( request.GET, mandatory_parameters ) | ||
1522 | if retval: | ||
1523 | return _redirect_parameters( 'package_included_detail', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id) | ||
1524 | (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File) | ||
1525 | |||
1526 | queryset = Package_File.objects.filter(package_id__exact=package_id) | ||
1527 | paths = _get_queryset(Package_File, queryset, filter_string, search_term, ordering_string, 'path') | ||
1528 | |||
1491 | package = Package.objects.filter(pk=package_id)[0] | 1529 | package = Package.objects.filter(pk=package_id)[0] |
1492 | package.fullpackagespec = _get_fullpackagespec(package) | 1530 | package.fullpackagespec = _get_fullpackagespec(package) |
1493 | package.alias = _get_package_alias(package) | 1531 | package.alias = _get_package_alias(package) |
@@ -1497,8 +1535,24 @@ def package_included_detail(request, build_id, target_id, package_id): | |||
1497 | 'target' : target, | 1535 | 'target' : target, |
1498 | 'package' : package, | 1536 | 'package' : package, |
1499 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), | 1537 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), |
1500 | 'dependency_count' : _get_package_dependency_count(package, target_id, True) | 1538 | 'dependency_count' : _get_package_dependency_count(package, target_id, True), |
1539 | 'objects': paths, | ||
1540 | 'tablecols':[ | ||
1541 | { | ||
1542 | 'name':'File', | ||
1543 | 'orderfield': _get_toggle_order(request, "path"), | ||
1544 | 'ordericon':_get_toggle_order_icon(request, "path"), | ||
1545 | }, | ||
1546 | { | ||
1547 | 'name':'Size', | ||
1548 | 'orderfield': _get_toggle_order(request, "size", True), | ||
1549 | 'ordericon':_get_toggle_order_icon(request, "size"), | ||
1550 | 'dclass': 'sizecol span2', | ||
1551 | }, | ||
1552 | ] | ||
1501 | } | 1553 | } |
1554 | if paths.all().count() < 2: | ||
1555 | context['disable_sort'] = True; | ||
1502 | return render(request, template, context) | 1556 | return render(request, template, context) |
1503 | 1557 | ||
1504 | def package_included_dependencies(request, build_id, target_id, package_id): | 1558 | def package_included_dependencies(request, build_id, target_id, package_id): |
@@ -1528,36 +1582,49 @@ def package_included_reverse_dependencies(request, build_id, target_id, package_ | |||
1528 | if Build.objects.filter(pk=build_id).count() == 0 : | 1582 | if Build.objects.filter(pk=build_id).count() == 0 : |
1529 | return redirect(builds) | 1583 | return redirect(builds) |
1530 | 1584 | ||
1585 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'package__name:+'}; | ||
1586 | retval = _verify_parameters( request.GET, mandatory_parameters ) | ||
1587 | if retval: | ||
1588 | return _redirect_parameters( 'package_included_reverse_dependencies', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id) | ||
1589 | (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File) | ||
1590 | |||
1591 | queryset = Package_Dependency.objects.select_related('depends_on__name', 'depends_on__size').filter(depends_on=package_id, target_id=target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS) | ||
1592 | objects = _get_queryset(Package_Dependency, queryset, filter_string, search_term, ordering_string, 'package__name') | ||
1593 | |||
1531 | package = Package.objects.filter(pk=package_id)[0] | 1594 | package = Package.objects.filter(pk=package_id)[0] |
1532 | package.fullpackagespec = _get_fullpackagespec(package) | 1595 | package.fullpackagespec = _get_fullpackagespec(package) |
1533 | package.alias = _get_package_alias(package) | 1596 | package.alias = _get_package_alias(package) |
1534 | target = Target.objects.filter(pk=target_id)[0] | 1597 | target = Target.objects.filter(pk=target_id)[0] |
1535 | 1598 | for o in objects: | |
1536 | reverse_deps = [] | 1599 | if o.package.version != '': |
1537 | alldeps = package.package_dependencies_target.filter(target_id__exact=target_id) | 1600 | o.package.version += '-' + o.package.revision |
1538 | for idep in alldeps: | 1601 | o.alias = _get_package_alias(o.package) |
1539 | dep_package = Package.objects.get(pk=idep.package_id) | ||
1540 | version = dep_package.version | ||
1541 | if version != '' : | ||
1542 | version += '-' + dep_package.revision | ||
1543 | dep = { | ||
1544 | 'name' : dep_package.name, | ||
1545 | 'alias' : _get_package_alias(dep_package), | ||
1546 | 'dependent_id' : dep_package.id, | ||
1547 | 'version' : version, | ||
1548 | 'size' : dep_package.size | ||
1549 | } | ||
1550 | if idep.dep_type == Package_Dependency.TYPE_TRDEPENDS : | ||
1551 | reverse_deps.append(dep) | ||
1552 | |||
1553 | context = { | 1602 | context = { |
1554 | 'build' : Build.objects.filter(pk=build_id)[0], | 1603 | 'build' : Build.objects.filter(pk=build_id)[0], |
1555 | 'package' : package, | 1604 | 'package' : package, |
1556 | 'target' : target, | 1605 | 'target' : target, |
1557 | 'reverse_deps' : reverse_deps, | 1606 | 'objects' : objects, |
1558 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), | 1607 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), |
1559 | 'dependency_count' : _get_package_dependency_count(package, target_id, True) | 1608 | 'dependency_count' : _get_package_dependency_count(package, target_id, True), |
1609 | 'tablecols':[ | ||
1610 | { | ||
1611 | 'name':'Package', | ||
1612 | 'orderfield': _get_toggle_order(request, "package__name"), | ||
1613 | 'ordericon': _get_toggle_order_icon(request, "package__name"), | ||
1614 | }, | ||
1615 | { | ||
1616 | 'name':'Version', | ||
1617 | }, | ||
1618 | { | ||
1619 | 'name':'Size', | ||
1620 | 'orderfield': _get_toggle_order(request, "package__size", True), | ||
1621 | 'ordericon': _get_toggle_order_icon(request, "package__size"), | ||
1622 | 'dclass': 'sizecol span2', | ||
1623 | }, | ||
1624 | ] | ||
1560 | } | 1625 | } |
1626 | if objects.all().count() < 2: | ||
1627 | context['disable_sort'] = True; | ||
1561 | return render(request, template, context) | 1628 | return render(request, template, context) |
1562 | 1629 | ||
1563 | def image_information_dir(request, build_id, target_id, packagefile_id): | 1630 | def image_information_dir(request, build_id, target_id, packagefile_id): |