diff options
| author | David Reyna <David.Reyna@windriver.com> | 2014-02-28 05:55:46 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-09 12:24:01 -0700 |
| commit | 4717749fd651e6983a31e3cefe3f210d2646ca87 (patch) | |
| tree | 5ba0090617b97f5d49b5c78ee84563a0cab6b7f5 /bitbake/lib/toaster/toastergui/views.py | |
| parent | 31d4bf8484ee42690386c6b7a6bd6c7a2be54464 (diff) | |
| download | poky-4717749fd651e6983a31e3cefe3f210d2646ca87.tar.gz | |
bitbake: toaster: implement the configuration pagedreyna/configure-detail-view
Update the configuration page with the file list pop-up, implement the file and description filters.
[YOCTO #4259]
(Bitbake rev: 54a767809960b66b2fe2d3bc46aa9c7e040c4ae3)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 101 |
1 files changed, 80 insertions, 21 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index b77be1a6e7..3a362e6fe6 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -733,59 +733,118 @@ def recipes(request, build_id): | |||
| 733 | 733 | ||
| 734 | def configuration(request, build_id): | 734 | def configuration(request, build_id): |
| 735 | template = 'configuration.html' | 735 | template = 'configuration.html' |
| 736 | context = {'build': Build.objects.filter(pk=build_id)[0]} | 736 | |
| 737 | variables = Variable.objects.filter(build=build_id) | ||
| 738 | BB_VERSION=variables.filter(variable_name='BB_VERSION')[0].variable_value | ||
| 739 | BUILD_SYS=variables.filter(variable_name='BUILD_SYS')[0].variable_value | ||
| 740 | NATIVELSBSTRING=variables.filter(variable_name='NATIVELSBSTRING')[0].variable_value | ||
| 741 | TARGET_SYS=variables.filter(variable_name='TARGET_SYS')[0].variable_value | ||
| 742 | MACHINE=variables.filter(variable_name='MACHINE')[0].variable_value | ||
| 743 | DISTRO=variables.filter(variable_name='DISTRO')[0].variable_value | ||
| 744 | DISTRO_VERSION=variables.filter(variable_name='DISTRO_VERSION')[0].variable_value | ||
| 745 | TUNE_FEATURES=variables.filter(variable_name='TUNE_FEATURES')[0].variable_value | ||
| 746 | TARGET_FPU=variables.filter(variable_name='TARGET_FPU')[0].variable_value | ||
| 747 | |||
| 748 | targets = Target.objects.filter(build=build_id) | ||
| 749 | |||
| 750 | context = { | ||
| 751 | 'objectname': 'configuration', | ||
| 752 | 'object_search_display':'variables', | ||
| 753 | 'filter_search_display':'variables', | ||
| 754 | 'build': Build.objects.filter(pk=build_id)[0], | ||
| 755 | 'BB_VERSION':BB_VERSION, | ||
| 756 | 'BUILD_SYS':BUILD_SYS, | ||
| 757 | 'NATIVELSBSTRING':NATIVELSBSTRING, | ||
| 758 | 'TARGET_SYS':TARGET_SYS, | ||
| 759 | 'MACHINE':MACHINE, | ||
| 760 | 'DISTRO':DISTRO, | ||
| 761 | 'DISTRO_VERSION':DISTRO_VERSION, | ||
| 762 | 'TUNE_FEATURES':TUNE_FEATURES, | ||
| 763 | 'TARGET_FPU':TARGET_FPU, | ||
| 764 | 'targets':targets, | ||
| 765 | } | ||
| 737 | return render(request, template, context) | 766 | return render(request, template, context) |
| 738 | 767 | ||
| 739 | 768 | ||
| 740 | def configvars(request, build_id): | 769 | def configvars(request, build_id): |
| 741 | template = 'configvars.html' | 770 | template = 'configvars.html' |
| 742 | mandatory_parameters = { 'count': 100, 'page' : 1}; | 771 | mandatory_parameters = { 'count': 100, 'page' : 1, 'orderby':'variable_name:+', 'filter':'description__regex:.+'}; |
| 743 | retval = _verify_parameters( request.GET, mandatory_parameters ) | 772 | retval = _verify_parameters( request.GET, mandatory_parameters ) |
| 744 | if retval: | 773 | if retval: |
| 745 | return _redirect_parameters( 'configvars', request.GET, mandatory_parameters, build_id = build_id) | 774 | return _redirect_parameters( 'configvars', request.GET, mandatory_parameters, build_id = build_id) |
| 746 | 775 | ||
| 747 | (filter_string, search_term, ordering_string) = _search_tuple(request, Variable) | 776 | (filter_string, search_term, ordering_string) = _search_tuple(request, Variable) |
| 748 | queryset = Variable.objects.filter(build=build_id) | 777 | queryset = Variable.objects.filter(build=build_id).exclude(variable_name__istartswith='B_').exclude(variable_name__istartswith='do_') |
| 749 | queryset = _get_queryset(Variable, queryset, filter_string, search_term, ordering_string) | 778 | queryset = _get_queryset(Variable, queryset, filter_string, search_term, ordering_string) |
| 779 | # remove duplicate records from multiple search hits in the VariableHistory table | ||
| 780 | queryset = queryset.distinct() | ||
| 781 | # remove records where the value is empty AND there are no history files | ||
| 782 | queryset = queryset.exclude(variable_value='',vhistory__file_name__isnull=True) | ||
| 750 | 783 | ||
| 751 | variables = _build_page_range(Paginator(queryset, request.GET.get('count', 50)), request.GET.get('page', 1)) | 784 | variables = _build_page_range(Paginator(queryset, request.GET.get('count', 50)), request.GET.get('page', 1)) |
| 752 | 785 | ||
| 786 | file_filter= search_term + ":" | ||
| 787 | if filter_string.find('conf/local.conf') > 0: | ||
| 788 | file_filter += 'conf/local.conf' | ||
| 789 | if filter_string.find('conf/machine/') > 0: | ||
| 790 | file_filter += 'conf/machine/' | ||
| 791 | if filter_string.find('conf/distro/') > 0: | ||
| 792 | file_filter += 'conf/distro/' | ||
| 793 | if filter_string.find('/bitbake.conf') > 0: | ||
| 794 | file_filter += '/bitbake.conf' | ||
| 795 | |||
| 753 | context = { | 796 | context = { |
| 797 | 'objectname': 'configvars', | ||
| 798 | 'object_search_display':'variables', | ||
| 799 | 'filter_search_display':'variables', | ||
| 800 | 'file_filter': file_filter, | ||
| 754 | 'build': Build.objects.filter(pk=build_id)[0], | 801 | 'build': Build.objects.filter(pk=build_id)[0], |
| 755 | 'objects' : variables, | 802 | 'objects' : variables, |
| 756 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns | 803 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns |
| 757 | 'tablecols' : [ | 804 | 'tablecols' : [ |
| 758 | {'name': 'Variable ', | 805 | {'name': 'Variable ', |
| 759 | 'qhelp': "Base variable expanded name", | 806 | 'qhelp': "BitBake is a generic task executor that considers a list of tasks with dependencies and handles metadata that consists of variables in a certain format that get passed to the tasks", |
| 760 | 'clclass' : 'variable', | ||
| 761 | 'dclass' : "span3", | 807 | 'dclass' : "span3", |
| 762 | 'orderfield': _get_toggle_order(request, "variable_name"), | 808 | 'orderfield': _get_toggle_order(request, "variable_name"), |
| 809 | 'ordericon':_get_toggle_order_icon(request, "variable_name"), | ||
| 763 | }, | 810 | }, |
| 764 | {'name': 'Value ', | 811 | {'name': 'Value ', |
| 765 | 'qhelp': "The value assigned to the variable", | 812 | 'qhelp': "The value assigned to the variable", |
| 766 | 'clclass': 'variable_value', | ||
| 767 | 'dclass': "span4", | 813 | 'dclass': "span4", |
| 768 | 'orderfield': _get_toggle_order(request, "variable_value"), | 814 | 'orderfield': _get_toggle_order(request, "variable_value"), |
| 815 | 'ordericon':_get_toggle_order_icon(request, "variable_value"), | ||
| 769 | }, | 816 | }, |
| 770 | {'name': 'Configuration file(s) ', | 817 | {'name': 'Set in file', |
| 771 | 'qhelp': "The configuration file(s) that touched the variable value", | 818 | 'qhelp': "The last configuration file that touched the variable value", |
| 772 | 'clclass': 'file', | 819 | 'clclass': 'file', 'hidden' : 0, |
| 773 | 'dclass': "span6", | 820 | 'dclass': "span6", |
| 774 | 'orderfield': _get_toggle_order(request, "variable_vhistory__file_name"), | 821 | 'orderfield': _get_toggle_order(request, "vhistory__file_name"), |
| 775 | 'filter' : { 'class': 'file', 'label' : 'Show only', 'options' : { | 822 | 'ordericon':_get_toggle_order_icon(request, "vhistory__file_name"), |
| 776 | } | 823 | 'filter' : { |
| 777 | } | 824 | 'class' : 'vhistory__file_name', |
| 825 | 'label': 'Show:', | ||
| 826 | 'options' : [ | ||
| 827 | ('Local configuration variables', 'vhistory__file_name__contains:conf/local.conf'), | ||
| 828 | ('Machine configuration variables', 'vhistory__file_name__contains:conf/machine/'), | ||
| 829 | ('Distro configuration variables', 'vhistory__file_name__contains:conf/distro/'), | ||
| 830 | ('Layer configuration variables', 'vhistory__file_name__contains:conf/layer.conf'), | ||
| 831 | ('bitbake.conf variables', 'vhistory__file_name__contains:/bitbake.conf'), | ||
| 832 | ] | ||
| 833 | }, | ||
| 778 | }, | 834 | }, |
| 779 | {'name': 'Description ', | 835 | {'name': 'Description ', |
| 780 | 'qhelp': "A brief explanation of a variable", | 836 | 'qhelp': "A brief explanation of the variable", |
| 781 | 'clclass': 'description', | 837 | 'clclass': 'description', 'hidden' : 0, |
| 782 | 'dclass': "span5", | 838 | 'dclass': "span5", |
| 783 | 'orderfield': _get_toggle_order(request, "description"), | 839 | 'filter' : { |
| 784 | 'filter' : { 'class' : 'description', 'label' : 'No', 'options' : { | 840 | 'class' : 'description', |
| 785 | } | 841 | 'label': 'Show:', |
| 786 | }, | 842 | 'options' : [ |
| 787 | } | 843 | ('Variables with description', 'description__regex:.+'), |
| 788 | ] | 844 | ] |
| 845 | }, | ||
| 846 | }, | ||
| 847 | ], | ||
| 789 | } | 848 | } |
| 790 | 849 | ||
| 791 | return render(request, template, context) | 850 | return render(request, template, context) |
