summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/orm/models.py7
-rw-r--r--bitbake/lib/toaster/toastergui/templates/machines.html1
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py5
3 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 454f3692be..ad7a8569f2 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -538,6 +538,11 @@ class Machine(models.Model):
538 name = models.CharField(max_length=255) 538 name = models.CharField(max_length=255)
539 description = models.CharField(max_length=255) 539 description = models.CharField(max_length=255)
540 540
541 def get_vcs_machine_file_link_url(self):
542 path = 'conf/machine/'+self.name+'.conf'
543
544 return self.layer_version.get_vcs_file_link_url(path)
545
541 def __unicode__(self): 546 def __unicode__(self):
542 return "Machine " + self.name + "(" + self.description + ")" 547 return "Machine " + self.name + "(" + self.description + ")"
543 548
@@ -901,7 +906,7 @@ class Layer_Version(models.Model):
901 906
902 # code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ 907 # code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
903 def _handle_url_path(self, base_url, path): 908 def _handle_url_path(self, base_url, path):
904 import re 909 import re, posixpath
905 if base_url: 910 if base_url:
906 if self.dirpath: 911 if self.dirpath:
907 if path: 912 if path:
diff --git a/bitbake/lib/toaster/toastergui/templates/machines.html b/bitbake/lib/toaster/toastergui/templates/machines.html
index c0d4c6cc33..e3329bf238 100644
--- a/bitbake/lib/toaster/toastergui/templates/machines.html
+++ b/bitbake/lib/toaster/toastergui/templates/machines.html
@@ -48,6 +48,7 @@
48 <td class="layer"><a href="{%url "layerdetails" o.layer_version.id %}">{{o.layer_version.layer.name}}</a></td> 48 <td class="layer"><a href="{%url "layerdetails" o.layer_version.id %}">{{o.layer_version.layer.name}}</a></td>
49 <td class="source">{{o.layer_source.name}}</td> 49 <td class="source">{{o.layer_source.name}}</td>
50 <td class="branch">{{o.layer_version.commit}}</td> 50 <td class="branch">{{o.layer_version.commit}}</td>
51 <td class="machinefile"><code>/machine/conf/{{o.name}}.conf</code><a href="{{o.get_vcs_machine_file_link_url}}" target="_blank"><i class="icon-share get-info"></i></a></td>
51 <td class="select-or-add"> 52 <td class="select-or-add">
52 <a href="#" class="btn btn-block select-machine-btn" data-machine-name="{{o.name}}" data-layer-version-id="{{o.layer_version.id}}" 53 <a href="#" class="btn btn-block select-machine-btn" data-machine-name="{{o.name}}" data-layer-version-id="{{o.layer_version.id}}"
53 {%if o.layer_version.id not in project_layers %}style="display:none" {%endif%} >Select machine</a> 54 {%if o.layer_version.id not in project_layers %}style="display:none" {%endif%} >Select machine</a>
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 9d85a93b7b..c89b67bcd1 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2797,7 +2797,6 @@ if toastermain.settings.MANAGED:
2797 # retrieve the objects that will be displayed in the table; machines a paginator and gets a page range to display 2797 # retrieve the objects that will be displayed in the table; machines a paginator and gets a page range to display
2798 machine_info = _build_page_range(Paginator(queryset, request.GET.get('count', 10)),request.GET.get('page', 1)) 2798 machine_info = _build_page_range(Paginator(queryset, request.GET.get('count', 10)),request.GET.get('page', 1))
2799 2799
2800
2801 context = { 2800 context = {
2802 'objects' : machine_info, 2801 'objects' : machine_info,
2803 'project_layers' : project_layers, 2802 'project_layers' : project_layers,
@@ -2834,6 +2833,10 @@ if toastermain.settings.MANAGED:
2834 'qhelp' : "The Git branch, tag or commit. For the layers from the OpenEmbedded layer source, the revision is always the branch compatible with the Yocto Project version you selected for this project", 2833 'qhelp' : "The Git branch, tag or commit. For the layers from the OpenEmbedded layer source, the revision is always the branch compatible with the Yocto Project version you selected for this project",
2835 'hidden': 1, 2834 'hidden': 1,
2836 }, 2835 },
2836 { 'name' : 'Machine file',
2837 'clclass' : 'machinefile',
2838 'hidden' : 1,
2839 },
2837 { 'name': 'Select', 2840 { 'name': 'Select',
2838 'dclass': 'span2', 2841 'dclass': 'span2',
2839 'qhelp': "Add or delete machines to / from your project ", 2842 'qhelp': "Add or delete machines to / from your project ",