]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: All machines add a column to link back to machine conf
authorMichael Wood <michael.g.wood@intel.com>
Tue, 3 Feb 2015 15:40:41 +0000 (15:40 +0000)
committerAlexandru DAMIAN <alexandru.damian@intel.com>
Mon, 9 Feb 2015 17:54:34 +0000 (17:54 +0000)
Add a column with the "path" to the machine file and add a link back to
the vcs web to view the machine configuration file.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
lib/toaster/orm/models.py
lib/toaster/toastergui/templates/machines.html
lib/toaster/toastergui/views.py

index 454f3692bea8462f7c3c944b7bc92b23369ef7e3..ad7a8569f25897565fd7a8fc9572c7bdb1432cc9 100644 (file)
@@ -538,6 +538,11 @@ class Machine(models.Model):
     name = models.CharField(max_length=255)
     description = models.CharField(max_length=255)
 
+    def get_vcs_machine_file_link_url(self):
+        path = 'conf/machine/'+self.name+'.conf'
+
+        return self.layer_version.get_vcs_file_link_url(path)
+
     def __unicode__(self):
         return "Machine " + self.name + "(" + self.description + ")"
 
@@ -901,7 +906,7 @@ class Layer_Version(models.Model):
 
     # code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
     def _handle_url_path(self, base_url, path):
-        import re
+        import re, posixpath
         if base_url:
             if self.dirpath:
                 if path:
index c0d4c6cc3302e9089977444fbb9f5282d640c62c..e3329bf238a1c6b95e071a0a2146941af6e60158 100644 (file)
@@ -48,6 +48,7 @@
   <td class="layer"><a href="{%url "layerdetails" o.layer_version.id %}">{{o.layer_version.layer.name}}</a></td>
   <td class="source">{{o.layer_source.name}}</td>
   <td class="branch">{{o.layer_version.commit}}</td>
+  <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>
   <td class="select-or-add">
     <a href="#" class="btn btn-block select-machine-btn" data-machine-name="{{o.name}}" data-layer-version-id="{{o.layer_version.id}}"
         {%if o.layer_version.id not in project_layers %}style="display:none" {%endif%}  >Select machine</a>
index 9d85a93b7bd4da3e3d6a070bf910a81435b7e548..c89b67bcd1187daf4608dc430bbceff0646feac2 100755 (executable)
@@ -2797,7 +2797,6 @@ if toastermain.settings.MANAGED:
         # retrieve the objects that will be displayed in the table; machines a paginator and gets a page range to display
         machine_info = _build_page_range(Paginator(queryset, request.GET.get('count', 10)),request.GET.get('page', 1))
 
-
         context = {
             'objects' : machine_info,
             'project_layers' : project_layers,
@@ -2834,6 +2833,10 @@ if toastermain.settings.MANAGED:
                     '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",
                     'hidden': 1,
                 },
+                {   'name' : 'Machine file',
+                    'clclass' : 'machinefile',
+                    'hidden' : 1,
+                },
                 {   'name': 'Select',
                     'dclass': 'span2',
                     'qhelp': "Add or delete machines to / from your project ",