summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-04-19 17:28:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-19 21:11:25 +0100
commit040dbf6988bebf755e60f6102bbc2b9854ce0608 (patch)
tree2e31ee935fc24db744f6381c5aa9a5c6bb7e7eaf /bitbake/lib/toaster/toastergui/views.py
parent1b11b79f505d3535ad49c415c66117b55d8f14e0 (diff)
downloadpoky-040dbf6988bebf755e60f6102bbc2b9854ce0608.tar.gz
bitbake: toaster: fix sorting after hiding a column in build tables
When hiding a column in the build tasks or build packages included table, if the column is set as the current order by for the table, the order by is not reset to the default. The result is that the table stays sorted by the hidden column. Set the default_orderby for these two tables correctly to ensure the corresponding table is re-sorted when a column is hidden, if that column was being used as the order by. [YOCTO #9011] (Bitbake rev: b99e1012f0ad1dc82a769df15a232280c8e57b9e) Signed-off-by: Elliot Smith <elliot.smith@intel.com> 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/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 30295a7260..a11c9da5f5 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -663,7 +663,9 @@ def recipe_packages(request, build_id, recipe_id):
663 663
664def target_common( request, build_id, target_id, variant ): 664def target_common( request, build_id, target_id, variant ):
665 template = "target.html" 665 template = "target.html"
666 (pagesize, orderby) = _get_parameters_values(request, 25, 'name:+') 666 default_orderby = 'name:+'
667
668 (pagesize, orderby) = _get_parameters_values(request, 25, default_orderby)
667 mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby } 669 mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby }
668 retval = _verify_parameters( request.GET, mandatory_parameters ) 670 retval = _verify_parameters( request.GET, mandatory_parameters )
669 if retval: 671 if retval:
@@ -683,8 +685,6 @@ def target_common( request, build_id, target_id, variant ):
683 queryset = queryset.select_related("recipe", "recipe__layer_version", "recipe__layer_version__layer") 685 queryset = queryset.select_related("recipe", "recipe__layer_version", "recipe__layer_version__layer")
684 packages = _build_page_range( Paginator(queryset, pagesize), request.GET.get( 'page', 1 )) 686 packages = _build_page_range( Paginator(queryset, pagesize), request.GET.get( 'page', 1 ))
685 687
686
687
688 build = Build.objects.get( pk = build_id ) 688 build = Build.objects.get( pk = build_id )
689 689
690 # bring in package dependencies 690 # bring in package dependencies
@@ -801,7 +801,7 @@ eans multiple licenses exist that cover different parts of the source',
801 'objects' : packages, 801 'objects' : packages,
802 'packages_sum' : packages_sum[ 'installed_size__sum' ], 802 'packages_sum' : packages_sum[ 'installed_size__sum' ],
803 'object_search_display': "packages included", 803 'object_search_display': "packages included",
804 'default_orderby' : orderby, 804 'default_orderby' : default_orderby,
805 'tablecols' : [ 805 'tablecols' : [
806 tc_package, 806 tc_package,
807 tc_packageVersion, 807 tc_packageVersion,
@@ -996,29 +996,29 @@ def tasks_common(request, build_id, variant, task_anchor):
996 anchor=task_anchor 996 anchor=task_anchor
997 997
998 # default ordering depends on variant 998 # default ordering depends on variant
999 if 'buildtime' == variant: 999 default_orderby = None
1000 title_variant='Time' 1000 filter_search_display = 'tasks'
1001 object_search_display="time data" 1001
1002 filter_search_display="tasks" 1002 if 'buildtime' == variant:
1003 (pagesize, orderby) = _get_parameters_values(request, 25, 'elapsed_time:-') 1003 default_orderby = 'elapsed_time:-'
1004 elif 'diskio' == variant: 1004 title_variant = 'Time'
1005 title_variant='Disk I/O' 1005 object_search_display = 'time data'
1006 object_search_display="disk I/O data" 1006 elif 'diskio' == variant:
1007 filter_search_display="tasks" 1007 default_orderby = 'disk_io:-'
1008 (pagesize, orderby) = _get_parameters_values(request, 25, 'disk_io:-') 1008 title_variant = 'Disk I/O'
1009 elif 'cputime' == variant: 1009 object_search_display = 'disk I/O data'
1010 elif 'cputime' == variant:
1011 default_orderby = 'cpu_time_system:-'
1010 title_variant='CPU time' 1012 title_variant='CPU time'
1011 object_search_display="CPU time data" 1013 object_search_display = 'CPU time data'
1012 filter_search_display="tasks" 1014 else:
1013 (pagesize, orderby) = _get_parameters_values(request, 25, 'cpu_time_system:-') 1015 default_orderby = 'order:+'
1014 else : 1016 title_variant = 'Tasks'
1015 title_variant='Tasks' 1017 object_search_display = 'tasks'
1016 object_search_display="tasks"
1017 filter_search_display="tasks"
1018 (pagesize, orderby) = _get_parameters_values(request, 25, 'order:+')
1019 1018
1019 (pagesize, orderby) = _get_parameters_values(request, 25, default_orderby)
1020 1020
1021 mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby } 1021 mandatory_parameters = {'count': pagesize, 'page' : 1, 'orderby': orderby}
1022 1022
1023 template = 'tasks.html' 1023 template = 'tasks.html'
1024 retval = _verify_parameters( request.GET, mandatory_parameters ) 1024 retval = _verify_parameters( request.GET, mandatory_parameters )
@@ -1212,7 +1212,7 @@ def tasks_common(request, build_id, variant, task_anchor):
1212 'mainheading': title_variant, 1212 'mainheading': title_variant,
1213 'build': build, 1213 'build': build,
1214 'objects': task_objects, 1214 'objects': task_objects,
1215 'default_orderby' : orderby, 1215 'default_orderby' : default_orderby,
1216 'search_term': search_term, 1216 'search_term': search_term,
1217 'total_count': queryset_with_search.count(), 1217 'total_count': queryset_with_search.count(),
1218 'tablecols':[ 1218 'tablecols':[