diff options
author | Farrell Wymore <farrell.wymore@windriver.com> | 2014-05-21 15:15:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-21 16:47:01 +0100 |
commit | defe2271350c36605704129f4a6b9332446a1319 (patch) | |
tree | 36fc9a72b47733f542ed90e47f80a0b692bc44ab /bitbake/lib/toaster/toastergui | |
parent | 8a8d7176fc830ec48248929e2ab79501dd2a2422 (diff) | |
download | poky-defe2271350c36605704129f4a6b9332446a1319.tar.gz |
bitbake: toaster: sort columns properly after edit columns
If a sorted column is made invisible through the edit columns function,
resort the table the its default order.
[YOCTO 5919]
(Bitbake rev: 64618f7489eb9eb13a97d03cd2d353384f5faa70)
Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/basetable_top.html | 172 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 46 |
2 files changed, 204 insertions, 14 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/bitbake/lib/toaster/toastergui/templates/basetable_top.html index 22c389799a..1231e1f924 100644 --- a/bitbake/lib/toaster/toastergui/templates/basetable_top.html +++ b/bitbake/lib/toaster/toastergui/templates/basetable_top.html | |||
@@ -1,17 +1,42 @@ | |||
1 | {% load projecttags %} | 1 | {% load projecttags %} |
2 | <!-- component to display a generic table --> | 2 | <!-- component to display a generic table --> |
3 | <script> | 3 | <script> |
4 | function showhideTableColumn(clname, sh) { | ||
5 | if (sh) $('.' + clname).show(100); | ||
6 | else $('.' + clname).hide(100); | ||
7 | 4 | ||
8 | // save cookie for all checkboxes | 5 | // |
9 | save = ''; | 6 | // most of the following javascript is for managing the 'Edit Columns' |
10 | $('.chbxtoggle').each(function() { if ($(this).attr('id') != undefined) { save += ';' + $(this).attr('id') +':'+ $(this).is(':checked')} }) | 7 | // pop-up dialog and actions. the idea is that there are 2 types |
11 | $.cookie('_displaycols_{{objectname}}', save); | 8 | // of actions: immediate - performed while the dialog is still |
12 | save = ''; | 9 | // visible - hide/show columns, and delayed - performed when the |
13 | } | 10 | // dialog becomes invisible - any resorting if necessary. |
11 | // | ||
12 | // When the dialog is open, an interval timer is set up to | ||
13 | // determine if the dialog is still visible. when the dialog | ||
14 | // closes - goes invisible, the delayed actions are performed. | ||
15 | // | ||
16 | // the interval timer and interrupt handler is a way of simulating | ||
17 | // an onclose event. there is probably a simpler way to do this | ||
18 | // however the pop-up window id was elusive. | ||
19 | // | ||
20 | |||
21 | var editColTimer; | ||
22 | var editColAction; | ||
14 | 23 | ||
24 | // | ||
25 | // this is the target function of the interval timeout. | ||
26 | // check to see if the dialog is visible. if the dialog | ||
27 | // has gone invisible since the last check, take any delayed | ||
28 | // actions indicated in the action list and clear the timer. | ||
29 | // | ||
30 | |||
31 | function checkVisible( ) { | ||
32 | editcol = document.getElementById( 'editcol' ); | ||
33 | if ( editcol.offsetWidth <= 0 ) { | ||
34 | clearInterval( editColTimer ); | ||
35 | editColTimer = false; | ||
36 | hideshowColumns( ); | ||
37 | editColAction = [ ]; | ||
38 | } | ||
39 | } | ||
15 | 40 | ||
16 | function filterTableRows(test) { | 41 | function filterTableRows(test) { |
17 | if (test.length > 0) { | 42 | if (test.length > 0) { |
@@ -24,6 +49,113 @@ | |||
24 | $('tr.data').show(); | 49 | $('tr.data').show(); |
25 | } | 50 | } |
26 | } | 51 | } |
52 | |||
53 | // | ||
54 | // determine the value of the indicated url arg. | ||
55 | // this is needed to determine whether a resort | ||
56 | // is necessary. it looks like a lot of gorp stuff | ||
57 | // but its actually pretty simple. | ||
58 | // | ||
59 | |||
60 | function getURLParameter( name ) { | ||
61 | return decodeURIComponent((new RegExp('[?|&]' + name + '=' + | ||
62 | '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, | ||
63 | '%20'))||null | ||
64 | } | ||
65 | |||
66 | // | ||
67 | // when the dialog box goes invisible | ||
68 | // this function is called to interpret | ||
69 | // the action list and take any delayed actions necessary. | ||
70 | // the editColAction list is a hash table with | ||
71 | // the column name as the hash key, the hash value | ||
72 | // is a 2 element list. the first element is a flag | ||
73 | // indicating whether the column is on or off. the | ||
74 | // 2nd element is the sort order indicator for the column. | ||
75 | // | ||
76 | |||
77 | function hideshowColumns( ) { | ||
78 | for( var k in editColAction ) { | ||
79 | showhideDelayedTableAction( k, editColAction[ k ][ 0 ], editColAction[ k ][ 1 ]); | ||
80 | } | ||
81 | } | ||
82 | |||
83 | // | ||
84 | // this function actually performs the delayed table actions | ||
85 | // namely any resorting if necessary | ||
86 | // | ||
87 | |||
88 | function showhideDelayedTableAction( clname, sh, orderkey ) { | ||
89 | if ( !sh ) { | ||
90 | p = getURLParameter( "orderby" ).split( ":" )[ 0 ]; | ||
91 | if ( p == orderkey ) { | ||
92 | reload_params({ 'orderby' : '{{default_orderby}}'}); | ||
93 | } | ||
94 | } | ||
95 | } | ||
96 | |||
97 | // | ||
98 | // this function actually performs the immediate table actions | ||
99 | // namely any colums that need to be hidden/shown | ||
100 | // | ||
101 | |||
102 | function showhideImmediateTableAction( clname, sh, orderkey ) { | ||
103 | if ( sh ) { | ||
104 | $( '.' + clname ).show( 100 ); | ||
105 | } | ||
106 | else { | ||
107 | $( '.' + clname ).hide( 100 ); | ||
108 | } | ||
109 | |||
110 | // save cookie for all checkboxes | ||
111 | save = ''; | ||
112 | $( '.chbxtoggle' ).each(function( ) { | ||
113 | if ( $( this ).attr( 'id' ) != undefined ) { | ||
114 | save += ';' + $( this ).attr( 'id' ) +':'+ $( this ).is( ':checked' ) | ||
115 | } | ||
116 | }); | ||
117 | $.cookie( '_displaycols_{{objectname}}', save ); | ||
118 | save = ''; | ||
119 | } | ||
120 | |||
121 | // | ||
122 | // this is the onclick handler for all of the check box | ||
123 | // items in edit columns dialog | ||
124 | // | ||
125 | |||
126 | function showhideTableColumn( clname, sh, orderkey ) { | ||
127 | editcol = document.getElementById( 'editcol' ); | ||
128 | if ( editcol.offsetWidth <= 0 ) { | ||
129 | |||
130 | // | ||
131 | // this path is taken when the page is first | ||
132 | // getting initialized - no dialog visible, | ||
133 | // perform both the immediate and delayed actions | ||
134 | // | ||
135 | |||
136 | showhideImmediateTableAction( clname, sh, orderkey ); | ||
137 | showhideDelayedTableAction( clname, sh, orderkey ); | ||
138 | return; | ||
139 | } | ||
140 | if ( !editColTimer ) { | ||
141 | |||
142 | // | ||
143 | // we don't have a timer active so set one up | ||
144 | // and clear the action list | ||
145 | // | ||
146 | |||
147 | editColTimer = setInterval( checkVisible, 250 ); | ||
148 | editColAction = [ ]; | ||
149 | } | ||
150 | |||
151 | // | ||
152 | // save the action to be taken when the dialog closes | ||
153 | // | ||
154 | |||
155 | editColAction[ clname ] = [ sh, orderkey ]; | ||
156 | showhideImmediateTableAction( clname, sh, orderkey ); | ||
157 | } | ||
158 | |||
27 | </script> | 159 | </script> |
28 | 160 | ||
29 | <!-- control header --> | 161 | <!-- control header --> |
@@ -33,7 +165,6 @@ | |||
33 | <input class="input-xxlarge" id="search" name="search" type="text" placeholder="Search {%if object_search_display %}{{object_search_display}}{%else%}{{objectname}}{%endif%}" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{%endif%} | 165 | <input class="input-xxlarge" id="search" name="search" type="text" placeholder="Search {%if object_search_display %}{{object_search_display}}{%else%}{{objectname}}{%endif%}" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{%endif%} |
34 | <input type="hidden" name="orderby" value="{{request.GET.orderby}}"> | 166 | <input type="hidden" name="orderby" value="{{request.GET.orderby}}"> |
35 | <input type="hidden" name="page" value="1"> | 167 | <input type="hidden" name="page" value="1"> |
36 | <input type="hidden" name="count" value="{{request.GET.count}}"> | ||
37 | <button class="btn" type="submit" value="Search">Search</button> | 168 | <button class="btn" type="submit" value="Search">Search</button> |
38 | </form> | 169 | </form> |
39 | <div class="pull-right"> | 170 | <div class="pull-right"> |
@@ -45,12 +176,27 @@ | |||
45 | <!-- | 176 | <!-- |
46 | {{tablecols|sortcols}} | 177 | {{tablecols|sortcols}} |
47 | --> | 178 | --> |
48 | <ul class="dropdown-menu">{% for i in tablecols|sortcols %} | 179 | <ul id='editcol' class="dropdown-menu"> |
180 | {% for i in tablecols|sortcols %} | ||
49 | <li> | 181 | <li> |
50 | <label {% if not i.clclass %} class="checkbox muted" {%else%} class="checkbox" {%endif%}> | 182 | <label {% if not i.clclass %} class="checkbox muted" {%else%} class="checkbox" {%endif%}> |
51 | <input type="checkbox" class="chbxtoggle" {% if i.clclass %}id="{{i.clclass}}" value="ct{{i.name}}" {% if not i.hidden %}checked="checked"{%endif%} onchange="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))" {%else%} checked disabled {% endif %}/> {{i.name}} | 183 | <input type="checkbox" class="chbxtoggle" |
184 | {% if i.clclass %} | ||
185 | id="{{i.clclass}}" | ||
186 | value="ct{{i.name}}" | ||
187 | {% if not i.hidden %} | ||
188 | checked="checked" | ||
189 | {%endif%} | ||
190 | onclick="showhideTableColumn( | ||
191 | $(this).attr('id'), | ||
192 | $(this).is(':checked'), | ||
193 | '{{i.orderkey}}' )" | ||
194 | {%else%} | ||
195 | checked disabled | ||
196 | {% endif %}/> {{i.name}} | ||
52 | </label> | 197 | </label> |
53 | </li>{% endfor %} | 198 | </li> |
199 | {% endfor %} | ||
54 | </ul> | 200 | </ul> |
55 | </div> | 201 | </div> |
56 | {% endif %} | 202 | {% endif %} |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index e3b24bace3..4622810cf9 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -262,6 +262,7 @@ def builds(request): | |||
262 | # TODO: common objects for all table views, adapt as needed | 262 | # TODO: common objects for all table views, adapt as needed |
263 | 'objects' : build_info, | 263 | 'objects' : build_info, |
264 | 'objectname' : "builds", | 264 | 'objectname' : "builds", |
265 | 'default_orderby' : 'completed_on:-', | ||
265 | 'fstypes' : fstypes_map, | 266 | 'fstypes' : fstypes_map, |
266 | 'search_term' : search_term, | 267 | 'search_term' : search_term, |
267 | 'total_count' : queryset_with_search.count(), | 268 | 'total_count' : queryset_with_search.count(), |
@@ -311,6 +312,7 @@ def builds(request): | |||
311 | 'qhelp': "The date and time the build finished", | 312 | 'qhelp': "The date and time the build finished", |
312 | 'orderfield': _get_toggle_order(request, "completed_on", True), | 313 | 'orderfield': _get_toggle_order(request, "completed_on", True), |
313 | 'ordericon':_get_toggle_order_icon(request, "completed_on"), | 314 | 'ordericon':_get_toggle_order_icon(request, "completed_on"), |
315 | 'orderkey' : 'completed_on', | ||
314 | 'filter' : {'class' : 'completed_on', | 316 | 'filter' : {'class' : 'completed_on', |
315 | 'label': 'Show:', | 317 | 'label': 'Show:', |
316 | 'options' : [ | 318 | 'options' : [ |
@@ -334,6 +336,7 @@ def builds(request): | |||
334 | 'qhelp': "How many errors were encountered during the build (if any)", | 336 | 'qhelp': "How many errors were encountered during the build (if any)", |
335 | 'orderfield': _get_toggle_order(request, "errors_no", True), | 337 | 'orderfield': _get_toggle_order(request, "errors_no", True), |
336 | 'ordericon':_get_toggle_order_icon(request, "errors_no"), | 338 | 'ordericon':_get_toggle_order_icon(request, "errors_no"), |
339 | 'orderkey' : 'errors_no', | ||
337 | 'filter' : {'class' : 'errors_no', | 340 | 'filter' : {'class' : 'errors_no', |
338 | 'label': 'Show:', | 341 | 'label': 'Show:', |
339 | 'options' : [ | 342 | 'options' : [ |
@@ -346,6 +349,7 @@ def builds(request): | |||
346 | 'qhelp': "How many warnings were encountered during the build (if any)", | 349 | 'qhelp': "How many warnings were encountered during the build (if any)", |
347 | 'orderfield': _get_toggle_order(request, "warnings_no", True), | 350 | 'orderfield': _get_toggle_order(request, "warnings_no", True), |
348 | 'ordericon':_get_toggle_order_icon(request, "warnings_no"), | 351 | 'ordericon':_get_toggle_order_icon(request, "warnings_no"), |
352 | 'orderkey' : 'warnings_no', | ||
349 | 'filter' : {'class' : 'warnings_no', | 353 | 'filter' : {'class' : 'warnings_no', |
350 | 'label': 'Show:', | 354 | 'label': 'Show:', |
351 | 'options' : [ | 355 | 'options' : [ |
@@ -358,6 +362,7 @@ def builds(request): | |||
358 | 'qhelp': "How long it took the build to finish", | 362 | 'qhelp': "How long it took the build to finish", |
359 | 'orderfield': _get_toggle_order(request, "timespent", True), | 363 | 'orderfield': _get_toggle_order(request, "timespent", True), |
360 | 'ordericon':_get_toggle_order_icon(request, "timespent"), | 364 | 'ordericon':_get_toggle_order_icon(request, "timespent"), |
365 | 'orderkey' : 'timespent', | ||
361 | }, | 366 | }, |
362 | {'name': 'Log', | 367 | {'name': 'Log', |
363 | 'dclass': "span4", | 368 | 'dclass': "span4", |
@@ -365,6 +370,7 @@ def builds(request): | |||
365 | 'clclass': 'log', 'hidden': 1, | 370 | 'clclass': 'log', 'hidden': 1, |
366 | 'orderfield': _get_toggle_order(request, "cooker_log_path"), | 371 | 'orderfield': _get_toggle_order(request, "cooker_log_path"), |
367 | 'ordericon':_get_toggle_order_icon(request, "cooker_log_path"), | 372 | 'ordericon':_get_toggle_order_icon(request, "cooker_log_path"), |
373 | 'orderkey' : 'cooker_log_path', | ||
368 | }, | 374 | }, |
369 | {'name': 'Output', 'clclass': 'output', | 375 | {'name': 'Output', 'clclass': 'output', |
370 | 'qhelp': "The root file system types produced by the build. You can find them in your <code>/build/tmp/deploy/images/</code> directory", | 376 | 'qhelp': "The root file system types produced by the build. You can find them in your <code>/build/tmp/deploy/images/</code> directory", |
@@ -502,7 +508,7 @@ def task( request, build_id, task_id ): | |||
502 | 'log_head' : log_head, | 508 | 'log_head' : log_head, |
503 | 'log_body' : log_body, | 509 | 'log_body' : log_body, |
504 | 'showing_matches' : False, | 510 | 'showing_matches' : False, |
505 | 'uri_list' : uri_list, | 511 | 'uri_list' : uri_list, |
506 | } | 512 | } |
507 | if request.GET.get( 'show_matches', "" ): | 513 | if request.GET.get( 'show_matches', "" ): |
508 | context[ 'showing_matches' ] = True | 514 | context[ 'showing_matches' ] = True |
@@ -559,6 +565,7 @@ def target(request, build_id, target_id): | |||
559 | 'objects': packages, | 565 | 'objects': packages, |
560 | 'packages_sum' : packages_sum['installed_size__sum'], | 566 | 'packages_sum' : packages_sum['installed_size__sum'], |
561 | 'object_search_display': "packages included", | 567 | 'object_search_display': "packages included", |
568 | 'default_orderby' : 'name:+', | ||
562 | 'tablecols':[ | 569 | 'tablecols':[ |
563 | { | 570 | { |
564 | 'name':'Package', | 571 | 'name':'Package', |
@@ -575,6 +582,7 @@ def target(request, build_id, target_id): | |||
575 | 'qhelp':'The size of the package', | 582 | 'qhelp':'The size of the package', |
576 | 'orderfield': _get_toggle_order(request, "size", True), | 583 | 'orderfield': _get_toggle_order(request, "size", True), |
577 | 'ordericon':_get_toggle_order_icon(request, "size"), | 584 | 'ordericon':_get_toggle_order_icon(request, "size"), |
585 | 'orderkey' : 'size', | ||
578 | 'clclass': 'size', | 586 | 'clclass': 'size', |
579 | 'dclass' : 'span2', | 587 | 'dclass' : 'span2', |
580 | 'hidden' : 0, | 588 | 'hidden' : 0, |
@@ -582,6 +590,7 @@ def target(request, build_id, target_id): | |||
582 | { | 590 | { |
583 | 'name':'Size over total (%)', | 591 | 'name':'Size over total (%)', |
584 | 'qhelp':'Proportion of the overall included package size represented by this package', | 592 | 'qhelp':'Proportion of the overall included package size represented by this package', |
593 | 'orderkey' : 'size', | ||
585 | 'clclass': 'size_over_total', | 594 | 'clclass': 'size_over_total', |
586 | 'dclass' : 'span2', | 595 | 'dclass' : 'span2', |
587 | 'hidden' : 1, | 596 | 'hidden' : 1, |
@@ -591,6 +600,7 @@ def target(request, build_id, target_id): | |||
591 | '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', | 600 | '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', |
592 | 'orderfield': _get_toggle_order(request, "license"), | 601 | 'orderfield': _get_toggle_order(request, "license"), |
593 | 'ordericon':_get_toggle_order_icon(request, "license"), | 602 | 'ordericon':_get_toggle_order_icon(request, "license"), |
603 | 'orderkey' : 'license', | ||
594 | 'clclass': 'license', | 604 | 'clclass': 'license', |
595 | 'hidden' : 1, | 605 | 'hidden' : 1, |
596 | }, | 606 | }, |
@@ -611,6 +621,7 @@ def target(request, build_id, target_id): | |||
611 | 'qhelp':'The name of the recipe building the package', | 621 | 'qhelp':'The name of the recipe building the package', |
612 | 'orderfield': _get_toggle_order(request, "recipe__name"), | 622 | 'orderfield': _get_toggle_order(request, "recipe__name"), |
613 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), | 623 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), |
624 | 'orderkey' : 'recipe__name', | ||
614 | 'clclass': 'recipe_name', | 625 | 'clclass': 'recipe_name', |
615 | 'hidden' : 0, | 626 | 'hidden' : 0, |
616 | }, | 627 | }, |
@@ -625,6 +636,7 @@ def target(request, build_id, target_id): | |||
625 | 'qhelp':'The name of the layer providing the recipe that builds the package', | 636 | 'qhelp':'The name of the layer providing the recipe that builds the package', |
626 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"), | 637 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"), |
627 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"), | 638 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"), |
639 | 'orderkey' : 'recipe__layer_version__layer__name', | ||
628 | 'clclass': 'layer_name', | 640 | 'clclass': 'layer_name', |
629 | 'hidden' : 1, | 641 | 'hidden' : 1, |
630 | }, | 642 | }, |
@@ -633,6 +645,7 @@ def target(request, build_id, target_id): | |||
633 | 'qhelp':'The Git branch of the layer providing the recipe that builds the package', | 645 | 'qhelp':'The Git branch of the layer providing the recipe that builds the package', |
634 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"), | 646 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"), |
635 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"), | 647 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"), |
648 | 'orderkey' : 'recipe__layer_version__branch', | ||
636 | 'clclass': 'layer_branch', | 649 | 'clclass': 'layer_branch', |
637 | 'hidden' : 1, | 650 | 'hidden' : 1, |
638 | }, | 651 | }, |
@@ -830,21 +843,25 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
830 | object_search_display="time data" | 843 | object_search_display="time data" |
831 | filter_search_display="tasks" | 844 | filter_search_display="tasks" |
832 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'elapsed_time:-'}; | 845 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'elapsed_time:-'}; |
846 | default_orderby = 'elapsed_time:-'; | ||
833 | elif 'diskio' == variant: | 847 | elif 'diskio' == variant: |
834 | title_variant='Disk I/O' | 848 | title_variant='Disk I/O' |
835 | object_search_display="disk I/O data" | 849 | object_search_display="disk I/O data" |
836 | filter_search_display="tasks" | 850 | filter_search_display="tasks" |
837 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'disk_io:-'}; | 851 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'disk_io:-'}; |
852 | default_orderby = 'disk_io:-'; | ||
838 | elif 'cpuusage' == variant: | 853 | elif 'cpuusage' == variant: |
839 | title_variant='CPU usage' | 854 | title_variant='CPU usage' |
840 | object_search_display="CPU usage data" | 855 | object_search_display="CPU usage data" |
841 | filter_search_display="tasks" | 856 | filter_search_display="tasks" |
842 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'cpu_usage:-'}; | 857 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'cpu_usage:-'}; |
858 | default_orderby = 'cpu_usage:-'; | ||
843 | else : | 859 | else : |
844 | title_variant='Tasks' | 860 | title_variant='Tasks' |
845 | object_search_display="tasks" | 861 | object_search_display="tasks" |
846 | filter_search_display="tasks" | 862 | filter_search_display="tasks" |
847 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'order:+'}; | 863 | mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'order:+'}; |
864 | default_orderby = 'order:+'; | ||
848 | 865 | ||
849 | template = 'tasks.html' | 866 | template = 'tasks.html' |
850 | retval = _verify_parameters( request.GET, mandatory_parameters ) | 867 | retval = _verify_parameters( request.GET, mandatory_parameters ) |
@@ -886,12 +903,14 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
886 | 'name':'Order', | 903 | 'name':'Order', |
887 | 'qhelp':'The running sequence of each task in the build', | 904 | 'qhelp':'The running sequence of each task in the build', |
888 | 'clclass': 'order', 'hidden' : 1, | 905 | 'clclass': 'order', 'hidden' : 1, |
906 | 'orderkey' : 'order', | ||
889 | 'orderfield':_get_toggle_order(request, "order"), | 907 | 'orderfield':_get_toggle_order(request, "order"), |
890 | 'ordericon':_get_toggle_order_icon(request, "order")} | 908 | 'ordericon':_get_toggle_order_icon(request, "order")} |
891 | if 'tasks' == variant: tc_order['hidden']='0'; del tc_order['clclass'] | 909 | if 'tasks' == variant: tc_order['hidden']='0'; del tc_order['clclass'] |
892 | tc_recipe={ | 910 | tc_recipe={ |
893 | 'name':'Recipe', | 911 | 'name':'Recipe', |
894 | 'qhelp':'The name of the recipe to which each task applies', | 912 | 'qhelp':'The name of the recipe to which each task applies', |
913 | 'orderkey' : 'recipe__name', | ||
895 | 'orderfield': _get_toggle_order(request, "recipe__name"), | 914 | 'orderfield': _get_toggle_order(request, "recipe__name"), |
896 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), | 915 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), |
897 | } | 916 | } |
@@ -905,6 +924,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
905 | 'qhelp':'The name of the task', | 924 | 'qhelp':'The name of the task', |
906 | 'orderfield': _get_toggle_order(request, "task_name"), | 925 | 'orderfield': _get_toggle_order(request, "task_name"), |
907 | 'ordericon':_get_toggle_order_icon(request, "task_name"), | 926 | 'ordericon':_get_toggle_order_icon(request, "task_name"), |
927 | 'orderkey' : 'task_name', | ||
908 | } | 928 | } |
909 | tc_executed={ | 929 | tc_executed={ |
910 | 'name':'Executed', | 930 | 'name':'Executed', |
@@ -912,6 +932,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
912 | 'clclass': 'executed', 'hidden' : 0, | 932 | 'clclass': 'executed', 'hidden' : 0, |
913 | 'orderfield': _get_toggle_order(request, "task_executed"), | 933 | 'orderfield': _get_toggle_order(request, "task_executed"), |
914 | 'ordericon':_get_toggle_order_icon(request, "task_executed"), | 934 | 'ordericon':_get_toggle_order_icon(request, "task_executed"), |
935 | 'orderkey' : 'task_executed', | ||
915 | 'filter' : { | 936 | 'filter' : { |
916 | 'class' : 'executed', | 937 | 'class' : 'executed', |
917 | 'label': 'Show:', | 938 | 'label': 'Show:', |
@@ -928,6 +949,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
928 | 'clclass': 'outcome', 'hidden' : 0, | 949 | 'clclass': 'outcome', 'hidden' : 0, |
929 | 'orderfield': _get_toggle_order(request, "outcome"), | 950 | 'orderfield': _get_toggle_order(request, "outcome"), |
930 | 'ordericon':_get_toggle_order_icon(request, "outcome"), | 951 | 'ordericon':_get_toggle_order_icon(request, "outcome"), |
952 | 'orderkey' : 'outcome', | ||
931 | 'filter' : { | 953 | 'filter' : { |
932 | 'class' : 'outcome', | 954 | 'class' : 'outcome', |
933 | 'label': 'Show:', | 955 | 'label': 'Show:', |
@@ -947,6 +969,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
947 | 'qhelp':'Path to the task log file', | 969 | 'qhelp':'Path to the task log file', |
948 | 'orderfield': _get_toggle_order(request, "logfile"), | 970 | 'orderfield': _get_toggle_order(request, "logfile"), |
949 | 'ordericon':_get_toggle_order_icon(request, "logfile"), | 971 | 'ordericon':_get_toggle_order_icon(request, "logfile"), |
972 | 'orderkey' : 'logfile', | ||
950 | 'clclass': 'task_log', 'hidden' : 1, | 973 | 'clclass': 'task_log', 'hidden' : 1, |
951 | } | 974 | } |
952 | tc_cache={ | 975 | tc_cache={ |
@@ -955,6 +978,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
955 | 'clclass': 'cache_attempt', 'hidden' : 0, | 978 | 'clclass': 'cache_attempt', 'hidden' : 0, |
956 | 'orderfield': _get_toggle_order(request, "sstate_result"), | 979 | 'orderfield': _get_toggle_order(request, "sstate_result"), |
957 | 'ordericon':_get_toggle_order_icon(request, "sstate_result"), | 980 | 'ordericon':_get_toggle_order_icon(request, "sstate_result"), |
981 | 'orderkey' : 'sstate_result', | ||
958 | 'filter' : { | 982 | 'filter' : { |
959 | 'class' : 'cache_attempt', | 983 | 'class' : 'cache_attempt', |
960 | 'label': 'Show:', | 984 | 'label': 'Show:', |
@@ -973,6 +997,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
973 | 'qhelp':'How long it took the task to finish in seconds', | 997 | 'qhelp':'How long it took the task to finish in seconds', |
974 | 'orderfield': _get_toggle_order(request, "elapsed_time", True), | 998 | 'orderfield': _get_toggle_order(request, "elapsed_time", True), |
975 | 'ordericon':_get_toggle_order_icon(request, "elapsed_time"), | 999 | 'ordericon':_get_toggle_order_icon(request, "elapsed_time"), |
1000 | 'orderkey' : 'elapsed_time', | ||
976 | 'clclass': 'time_taken', 'hidden' : 1, | 1001 | 'clclass': 'time_taken', 'hidden' : 1, |
977 | } | 1002 | } |
978 | if 'buildtime' == variant: tc_time['hidden']='0'; del tc_time['clclass']; tc_cache['hidden']='1'; | 1003 | if 'buildtime' == variant: tc_time['hidden']='0'; del tc_time['clclass']; tc_cache['hidden']='1'; |
@@ -981,6 +1006,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
981 | 'qhelp':'The percentage of task CPU utilization', | 1006 | 'qhelp':'The percentage of task CPU utilization', |
982 | 'orderfield': _get_toggle_order(request, "cpu_usage", True), | 1007 | 'orderfield': _get_toggle_order(request, "cpu_usage", True), |
983 | 'ordericon':_get_toggle_order_icon(request, "cpu_usage"), | 1008 | 'ordericon':_get_toggle_order_icon(request, "cpu_usage"), |
1009 | 'orderkey' : 'cpu_usage', | ||
984 | 'clclass': 'cpu_used', 'hidden' : 1, | 1010 | 'clclass': 'cpu_used', 'hidden' : 1, |
985 | } | 1011 | } |
986 | if 'cpuusage' == variant: tc_cpu['hidden']='0'; del tc_cpu['clclass']; tc_cache['hidden']='1'; | 1012 | if 'cpuusage' == variant: tc_cpu['hidden']='0'; del tc_cpu['clclass']; tc_cache['hidden']='1'; |
@@ -989,6 +1015,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
989 | 'qhelp':'Number of miliseconds the task spent doing disk input and output', | 1015 | 'qhelp':'Number of miliseconds the task spent doing disk input and output', |
990 | 'orderfield': _get_toggle_order(request, "disk_io", True), | 1016 | 'orderfield': _get_toggle_order(request, "disk_io", True), |
991 | 'ordericon':_get_toggle_order_icon(request, "disk_io"), | 1017 | 'ordericon':_get_toggle_order_icon(request, "disk_io"), |
1018 | 'orderkey' : 'disk_io', | ||
992 | 'clclass': 'disk_io', 'hidden' : 1, | 1019 | 'clclass': 'disk_io', 'hidden' : 1, |
993 | } | 1020 | } |
994 | if 'diskio' == variant: tc_diskio['hidden']='0'; del tc_diskio['clclass']; tc_cache['hidden']='1'; | 1021 | if 'diskio' == variant: tc_diskio['hidden']='0'; del tc_diskio['clclass']; tc_cache['hidden']='1'; |
@@ -1000,6 +1027,7 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
1000 | 'title': title_variant, | 1027 | 'title': title_variant, |
1001 | 'build': Build.objects.filter(pk=build_id)[0], | 1028 | 'build': Build.objects.filter(pk=build_id)[0], |
1002 | 'objects': tasks, | 1029 | 'objects': tasks, |
1030 | 'default_orderby' : default_orderby, | ||
1003 | 'search_term': search_term, | 1031 | 'search_term': search_term, |
1004 | 'total_count': queryset_with_search.count(), | 1032 | 'total_count': queryset_with_search.count(), |
1005 | 'tablecols':[ | 1033 | 'tablecols':[ |
@@ -1050,6 +1078,7 @@ def recipes(request, build_id): | |||
1050 | 'objectname': 'recipes', | 1078 | 'objectname': 'recipes', |
1051 | 'build': Build.objects.filter(pk=build_id)[0], | 1079 | 'build': Build.objects.filter(pk=build_id)[0], |
1052 | 'objects': recipes, | 1080 | 'objects': recipes, |
1081 | 'default_orderby' : 'name:+', | ||
1053 | 'tablecols':[ | 1082 | 'tablecols':[ |
1054 | { | 1083 | { |
1055 | 'name':'Recipe', | 1084 | 'name':'Recipe', |
@@ -1076,6 +1105,7 @@ def recipes(request, build_id): | |||
1076 | 'qhelp':'Path to the recipe .bb file', | 1105 | 'qhelp':'Path to the recipe .bb file', |
1077 | 'orderfield': _get_toggle_order(request, "file_path"), | 1106 | 'orderfield': _get_toggle_order(request, "file_path"), |
1078 | 'ordericon':_get_toggle_order_icon(request, "file_path"), | 1107 | 'ordericon':_get_toggle_order_icon(request, "file_path"), |
1108 | 'orderkey' : 'file_path', | ||
1079 | 'clclass': 'recipe_file', 'hidden': 0, | 1109 | 'clclass': 'recipe_file', 'hidden': 0, |
1080 | }, | 1110 | }, |
1081 | { | 1111 | { |
@@ -1083,6 +1113,7 @@ def recipes(request, build_id): | |||
1083 | 'qhelp':'The section in which recipes should be categorized', | 1113 | 'qhelp':'The section in which recipes should be categorized', |
1084 | 'orderfield': _get_toggle_order(request, "section"), | 1114 | 'orderfield': _get_toggle_order(request, "section"), |
1085 | 'ordericon':_get_toggle_order_icon(request, "section"), | 1115 | 'ordericon':_get_toggle_order_icon(request, "section"), |
1116 | 'orderkey' : 'section', | ||
1086 | 'clclass': 'recipe_section', 'hidden': 0, | 1117 | 'clclass': 'recipe_section', 'hidden': 0, |
1087 | }, | 1118 | }, |
1088 | { | 1119 | { |
@@ -1090,6 +1121,7 @@ def recipes(request, build_id): | |||
1090 | 'qhelp':'The list of source licenses for the recipe. 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', | 1121 | 'qhelp':'The list of source licenses for the recipe. 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', |
1091 | 'orderfield': _get_toggle_order(request, "license"), | 1122 | 'orderfield': _get_toggle_order(request, "license"), |
1092 | 'ordericon':_get_toggle_order_icon(request, "license"), | 1123 | 'ordericon':_get_toggle_order_icon(request, "license"), |
1124 | 'orderkey' : 'license', | ||
1093 | 'clclass': 'recipe_license', 'hidden': 0, | 1125 | 'clclass': 'recipe_license', 'hidden': 0, |
1094 | }, | 1126 | }, |
1095 | { | 1127 | { |
@@ -1097,6 +1129,7 @@ def recipes(request, build_id): | |||
1097 | 'qhelp':'The name of the layer providing the recipe', | 1129 | 'qhelp':'The name of the layer providing the recipe', |
1098 | 'orderfield': _get_toggle_order(request, "layer_version__layer__name"), | 1130 | 'orderfield': _get_toggle_order(request, "layer_version__layer__name"), |
1099 | 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__name"), | 1131 | 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__name"), |
1132 | 'orderkey' : 'layer_version__layer__name', | ||
1100 | 'clclass': 'layer_version__layer__name', 'hidden': 0, | 1133 | 'clclass': 'layer_version__layer__name', 'hidden': 0, |
1101 | }, | 1134 | }, |
1102 | { | 1135 | { |
@@ -1104,6 +1137,7 @@ def recipes(request, build_id): | |||
1104 | 'qhelp':'The Git branch of the layer providing the recipe', | 1137 | 'qhelp':'The Git branch of the layer providing the recipe', |
1105 | 'orderfield': _get_toggle_order(request, "layer_version__branch"), | 1138 | 'orderfield': _get_toggle_order(request, "layer_version__branch"), |
1106 | 'ordericon':_get_toggle_order_icon(request, "layer_version__branch"), | 1139 | 'ordericon':_get_toggle_order_icon(request, "layer_version__branch"), |
1140 | 'orderkey' : 'layer_version__branch', | ||
1107 | 'clclass': 'layer_version__branch', 'hidden': 1, | 1141 | 'clclass': 'layer_version__branch', 'hidden': 1, |
1108 | }, | 1142 | }, |
1109 | { | 1143 | { |
@@ -1116,6 +1150,7 @@ def recipes(request, build_id): | |||
1116 | 'qhelp':'Path to the layer prodiving the recipe', | 1150 | 'qhelp':'Path to the layer prodiving the recipe', |
1117 | 'orderfield': _get_toggle_order(request, "layer_version__layer__local_path"), | 1151 | 'orderfield': _get_toggle_order(request, "layer_version__layer__local_path"), |
1118 | 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__local_path"), | 1152 | 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__local_path"), |
1153 | 'orderkey' : 'layer_version__layer__local_path', | ||
1119 | 'clclass': 'layer_version__layer__local_path', 'hidden': 1, | 1154 | 'clclass': 'layer_version__layer__local_path', 'hidden': 1, |
1120 | }, | 1155 | }, |
1121 | ] | 1156 | ] |
@@ -1198,6 +1233,7 @@ def configvars(request, build_id): | |||
1198 | 'build': Build.objects.filter(pk=build_id)[0], | 1233 | 'build': Build.objects.filter(pk=build_id)[0], |
1199 | 'objects' : variables, | 1234 | 'objects' : variables, |
1200 | 'total_count':queryset_with_search.count(), | 1235 | 'total_count':queryset_with_search.count(), |
1236 | 'default_orderby' : 'variable_name:+', | ||
1201 | 'search_term':search_term, | 1237 | 'search_term':search_term, |
1202 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns | 1238 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns |
1203 | 'tablecols' : [ | 1239 | 'tablecols' : [ |
@@ -1213,6 +1249,7 @@ def configvars(request, build_id): | |||
1213 | {'name': 'Set in file', | 1249 | {'name': 'Set in file', |
1214 | 'qhelp': "The last configuration file that touched the variable value", | 1250 | 'qhelp': "The last configuration file that touched the variable value", |
1215 | 'clclass': 'file', 'hidden' : 0, | 1251 | 'clclass': 'file', 'hidden' : 0, |
1252 | 'orderkey' : 'vhistory__file_name', | ||
1216 | 'filter' : { | 1253 | 'filter' : { |
1217 | 'class' : 'vhistory__file_name', | 1254 | 'class' : 'vhistory__file_name', |
1218 | 'label': 'Show:', | 1255 | 'label': 'Show:', |
@@ -1259,6 +1296,7 @@ def bpackage(request, build_id): | |||
1259 | 'objectname': 'packages built', | 1296 | 'objectname': 'packages built', |
1260 | 'build': Build.objects.filter(pk=build_id)[0], | 1297 | 'build': Build.objects.filter(pk=build_id)[0], |
1261 | 'objects' : packages, | 1298 | 'objects' : packages, |
1299 | 'default_orderby' : 'name:+', | ||
1262 | 'tablecols':[ | 1300 | 'tablecols':[ |
1263 | { | 1301 | { |
1264 | 'name':'Package', | 1302 | 'name':'Package', |
@@ -1275,6 +1313,7 @@ def bpackage(request, build_id): | |||
1275 | 'qhelp':'The size of the package', | 1313 | 'qhelp':'The size of the package', |
1276 | 'orderfield': _get_toggle_order(request, "size", True), | 1314 | 'orderfield': _get_toggle_order(request, "size", True), |
1277 | 'ordericon':_get_toggle_order_icon(request, "size"), | 1315 | 'ordericon':_get_toggle_order_icon(request, "size"), |
1316 | 'orderkey' : 'size', | ||
1278 | 'clclass': 'size', 'hidden': 0, | 1317 | 'clclass': 'size', 'hidden': 0, |
1279 | 'dclass' : 'span2', | 1318 | 'dclass' : 'span2', |
1280 | }, | 1319 | }, |
@@ -1283,6 +1322,7 @@ def bpackage(request, build_id): | |||
1283 | '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', | 1322 | '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', |
1284 | 'orderfield': _get_toggle_order(request, "license"), | 1323 | 'orderfield': _get_toggle_order(request, "license"), |
1285 | 'ordericon':_get_toggle_order_icon(request, "license"), | 1324 | 'ordericon':_get_toggle_order_icon(request, "license"), |
1325 | 'orderkey' : 'license', | ||
1286 | 'clclass': 'license', 'hidden': 1, | 1326 | 'clclass': 'license', 'hidden': 1, |
1287 | }, | 1327 | }, |
1288 | { | 1328 | { |
@@ -1290,6 +1330,7 @@ def bpackage(request, build_id): | |||
1290 | 'qhelp':'The name of the recipe building the package', | 1330 | 'qhelp':'The name of the recipe building the package', |
1291 | 'orderfield': _get_toggle_order(request, "recipe__name"), | 1331 | 'orderfield': _get_toggle_order(request, "recipe__name"), |
1292 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), | 1332 | 'ordericon':_get_toggle_order_icon(request, "recipe__name"), |
1333 | 'orderkey' : 'recipe__name', | ||
1293 | 'clclass': 'recipe__name', 'hidden': 0, | 1334 | 'clclass': 'recipe__name', 'hidden': 0, |
1294 | }, | 1335 | }, |
1295 | { | 1336 | { |
@@ -1302,6 +1343,7 @@ def bpackage(request, build_id): | |||
1302 | 'qhelp':'The name of the layer providing the recipe that builds the package', | 1343 | 'qhelp':'The name of the layer providing the recipe that builds the package', |
1303 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"), | 1344 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"), |
1304 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"), | 1345 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"), |
1346 | 'orderkey' : 'recipe__layer_version__layer__name', | ||
1305 | 'clclass': 'recipe__layer_version__layer__name', 'hidden': 1, | 1347 | 'clclass': 'recipe__layer_version__layer__name', 'hidden': 1, |
1306 | }, | 1348 | }, |
1307 | { | 1349 | { |
@@ -1309,6 +1351,7 @@ def bpackage(request, build_id): | |||
1309 | 'qhelp':'The Git branch of the layer providing the recipe that builds the package', | 1351 | 'qhelp':'The Git branch of the layer providing the recipe that builds the package', |
1310 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"), | 1352 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"), |
1311 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"), | 1353 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"), |
1354 | 'orderkey' : 'recipe__layer_version__layer__branch', | ||
1312 | 'clclass': 'recipe__layer_version__branch', 'hidden': 1, | 1355 | 'clclass': 'recipe__layer_version__branch', 'hidden': 1, |
1313 | }, | 1356 | }, |
1314 | { | 1357 | { |
@@ -1321,6 +1364,7 @@ def bpackage(request, build_id): | |||
1321 | 'qhelp':'Path to the layer providing the recipe that builds the package', | 1364 | 'qhelp':'Path to the layer providing the recipe that builds the package', |
1322 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__local_path"), | 1365 | 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__local_path"), |
1323 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__local_path"), | 1366 | 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__local_path"), |
1367 | 'orderkey' : 'recipe__layer_version__layer__local_path', | ||
1324 | 'clclass': 'recipe__layer_version__layer__local_path', 'hidden': 1, | 1368 | 'clclass': 'recipe__layer_version__layer__local_path', 'hidden': 1, |
1325 | }, | 1369 | }, |
1326 | ] | 1370 | ] |