1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

bitbake: toastergui: improve data suggestion

We improve the data suggestions in the project page.

The machines suggestions now contain the layer name.

The targets and machine do not show the layer branch.

For targets, the layer name is searchable.
For machines, the description field is searchable.

[YOCTO #7153]
[YOCTO #7154]

(Bitbake rev: 02a4997807ee995817d741985eea13d38e548007)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2015-03-09 18:39:18 +00:00
committed by Richard Purdie
parent e5590bc381
commit 50c5ca5254
2 changed files with 9 additions and 7 deletions
@@ -355,7 +355,7 @@ vim: expandtab tabstop=2
You cannot really compare the builds for the new machine with the previous ones.
</div>
<form ng-submit="editProjectSettings('#select-machine')" class="input-append">
<input type="text" id="machine" autocomplete="off" ng-model="machineName" typeahead="m.name for m in getAutocompleteSuggestions('machines', $viewValue)"/>
<input type="text" id="machine" autocomplete="off" ng-model="machineName" typeahead="m.name for m in getAutocompleteSuggestions('machines', $viewValue)" typeahead-template-url="suggestion_details" />
<input type="submit" id="apply-change-machine" class="btn" type="button" ng-disabled="machineName == machine.name || machineName.length == 0" value="Save"></input>
<input type="reset" id="cancel-machine" class="btn btn-link" ng-click="toggle('#select-machine')" value="Cancel"></input>
{% csrf_token %}
+8 -6
View File
@@ -2353,7 +2353,8 @@ if toastermain.settings.MANAGED:
# returns targets provided by current project layers
if request.GET['type'] == "targets":
queryset_all = Recipe.objects.filter(name__icontains=request.GET.get('value',''))
search_token = request.GET.get('value','')
queryset_all = Recipe.objects.filter(Q(name__icontains=search_token) | Q(layer_version__layer__name__icontains=search_token) )
layer_equivalent_set = []
for i in prj.projectlayer_set.all():
layer_equivalent_set += i.layercommit.get_equivalents_wpriority(prj)
@@ -2361,11 +2362,11 @@ if toastermain.settings.MANAGED:
# if we have more than one hit here (for distinct name and version), max the id it out
queryset_all_maxids = queryset_all.values('name').distinct().annotate(max_id=Max('id')).values_list('max_id')
queryset_all = queryset_all.filter(id__in = queryset_all_maxids).order_by("name")
queryset_all = queryset_all.filter(id__in = queryset_all_maxids).order_by("name").select_related("layer_version__layer")
return HttpResponse(jsonfilter({ "error":"ok",
"list" : map ( lambda x: {"id": x.pk, "name": x.name, "detail":"[" + x.layer_version.layer.name + (" | " + x.layer_version.up_branch.name + "]" if x.layer_version.up_branch is not None else "]")},
"list" : map ( lambda x: {"id": x.pk, "name": x.name, "detail":"[" + x.layer_version.layer.name +"]"},
queryset_all[:8]),
}), content_type = "application/json")
@@ -2376,10 +2377,11 @@ if toastermain.settings.MANAGED:
if 'project_id' in request.session:
queryset_all = queryset_all.filter(layer_version__in = prj.projectlayer_equivalent_set()).order_by("name")
return HttpResponse(jsonfilter({ "error":"ok",
"list" : map ( lambda x: {"id": x.pk, "name": x.name, "detail":"[" + x.layer_version.layer.name+ (" | " + x.layer_version.up_branch.name + "]" if x.layer_version.up_branch is not None else "]")},
queryset_all.filter(name__icontains=request.GET.get('value',''))[:8]),
search_token = request.GET.get('value','')
querysetall = queryset_all.filter(Q(name__icontains=search_token) | Q(description__icontains=search_token))
return HttpResponse(jsonfilter({ "error":"ok",
"list" : map ( lambda x: {"id": x.pk, "name": x.name, "detail":"[" + x.layer_version.layer.name+ "]"}, queryset_all[:8])
}), content_type = "application/json")
# returns all projects