blob: 923ca3bfe4d310c0c6c3ed09a9b39e227a930c7e [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001{% extends project_specific|yesno:"baseprojectspecificpage.html,base.html" %}
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002{% load projecttags %}
3{% load humanize %}
4{% load static %}
5
Patrick Williamsf1e5d692016-03-30 15:21:19 -05006{% block title %} {{layerversion.layer.name}} - {{project.name}} - Toaster {% endblock %}
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007{% block pagecontent %}
8
Patrick Williamsc0f7c042017-02-23 20:41:17 -06009<div id="delete-layer-modal" class="modal fade" tabindex="-1" role="dialog"
10 data-keyboard="false" data-backdrop="static">
11 <div class="modal-dialog" role="document">
12 <div class="modal-content">
13 <div class="modal-body">
14 Are you sure you want to delete the <strong>{{layerversion.layer.name}}</strong> layer?
15 </div>
16 <div class="modal-footer">
17 <button type="button" id="layer-delete-confirmed" class="btn
18 btn-primary">Delete layer</button>
19 <button type="button" class="btn btn-default btn-link" data-dismiss="modal">Cancel</button>
20 </div>
21 </div>
22 </div>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023</div>
24
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025<div class="row">
26 <div class="col-md-12">
27 <ul class="breadcrumb">
28 <li>
29 <a href="{% url 'project' project.id %}">{{project.name}}</a>
30 <span class="divider">&rarr;</span>
31 </li>
32 <li><a href="{% url 'projectlayers' project.id %}">Compatible layers</a>
33 <span class="divider">&rarr;</span>
34 </li>
35 <li class="active">
36 {{layerversion.layer.name}} ({{layerversion.get_vcs_reference|truncatechars:13}})
37 </li>
38 </ul>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
Patrick Williamsc0f7c042017-02-23 20:41:17 -060040 {# If this is not an imported layer then hide the edit ui #}
41 {% if layerversion.layer_source != layer_source.TYPE_IMPORTED %}
42 <style scoped>
43 .glyphicon-edit {
44 display:none;
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 }
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 .delete-current-value{
47 display: none;
48 }
49 li .glyphicon-trash {
50 display:none;
51 }
52 .add-deps {
53 display:none;
54 }
55 </style>
56 {% endif %}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057
Patrick Williamsc0f7c042017-02-23 20:41:17 -060058 <script src="{% static 'js/layerdetails.js' %}"></script>
59 <script>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060
Patrick Williamsc0f7c042017-02-23 20:41:17 -060061 $(document).ready(function(){
62 var ctx = {
63 xhrUpdateLayerUrl : "{% url 'xhr_layer' project.id layerversion.pk %}",
64 layerVersion : {
65 name : "{{layerversion.layer.name}}",
66 id : {{layerversion.id}},
67 commit: "{{layerversion.get_vcs_reference}}",
68 {%if layerversion.id in projectlayers %}
69 inCurrentPrj : true,
70 {% else %}
71 inCurrentPrj : false,
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 {% endif %}
Patrick Williamsc0f7c042017-02-23 20:41:17 -060073 layerdetailurl : "{% url 'layerdetails' project.id layerversion.id %}",
Brad Bishop6e60e8b2018-02-01 10:27:11 -050074 xhrLayerUrl: "{% url 'xhr_layer' project.id layerversion.id %}",
Patrick Williamsc0f7c042017-02-23 20:41:17 -060075 layer_source: {{layerversion.layer_source|json}},
76 },
77 layerSourceTypes: {{layer_source|json}},
78 };
79
80 try {
81 layerDetailsPageInit(ctx);
82 } catch (e) {
83 document.write("Sorry, An error has occurred loading this page");
84 console.warn(e);
85 }
86 });
87 </script>
88
89 <div class="page-header">
90 {% if layerversion.layer.local_source_dir %}
91 <h1>{{layerversion.layer.name}} <small class="commit" style="display:none;"></small>
92 </h1>
93 {% else %}
94 <h1>{{layerversion.layer.name}} <small class="commit"
95 {% if layerversion.get_vcs_reference|length > 13 %}
96 data-toggle="tooltip" title="{{layerversion.get_vcs_reference}}"
97 {% endif %}>({{layerversion.get_vcs_reference|truncatechars:13}})</small>
98 </h1>
99 {% endif %}
100 </div>
101 <div class="row">
102 <!-- container for tabs -->
103 <div class="col-md-8 tabbable">
104 <div class="alert alert-info lead" id="alert-area" style="display:none">
105 <button type="button" class="close" id="dismiss-alert">&times;</button>
106 <span id="alert-msg"></span>
107 </div>
108
109 {% if layerversion.id not in projectlayers %}
110 <button id="add-remove-layer-btn" data-directive="add" class="btn btn-default btn-lg btn-block">
111 <span class="glyphicon glyphicon-plus"></span>
112 Add the {{layerversion.layer.name}} layer to your project
113 </button>
114 {% else %}
115 <button id="add-remove-layer-btn" data-directive="remove" class="btn btn-default btn-block btn-lg btn-danger">
116 <span class="glyphicon glyphicon-trash"></span>
117 Remove the {{layerversion.layer.name}} layer from your project
118 </button>
119 {% endif %}
120
121 <ul class="nav nav-tabs">
122 <li class="active">
123 <a data-toggle="tab" href="#information" id="details-tab">Layer details</a>
124 </li>
125 <li>
126 <a data-toggle="tab" href="#recipes" class="text-muted" id="targets-tab">Recipes (<span class="table-count-recipestable"></span>)</a>
127 </li>
128 <li>
129 <a data-toggle="tab" href="#machines" class="text-muted" id="machines-tab">Machines (<span class="table-count-machinestable"></span>)</a>
130 </li>
131 </ul>
132 <div class="tab-content">
133
134 <!-- layer details pane -->
135 <div id="information" class="tab-pane active">
136 <h3>Layer source code location</h3>
137 {% if layerversion.layer.local_source_dir %}
138 <dl class="dl-horizontal" id="directory-info">
139 <dt>
140 Path to the layer directory
141 </dt>
142 <dd>
143 <code>{{layerversion.layer.local_source_dir}}</code>
144 </dd>
145 </dl>
146 {% else %}
147 <dl class="dl-horizontal" id="git-repo-info">
148 <dt class="">
149 <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository"></span>
150 Repository URL
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500151 </dt>
152 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600153 <span class="current-value">{{layerversion.layer.vcs_url}}</span>
154 {% if layerversion.get_vcs_link_url %}
155 <a href="{{layerversion.get_vcs_link_url}}/" class="glyphicon glyphicon-new-window" target="_blank"></a>
156 {% endif %}
157 <form id="change-repo-form" class="form-inline" style="display:none">
158 <div class="form-group">
159 <input type="text" class="form-control" value="{{layerversion.layer.vcs_url}}">
160 </div>
161 </form>
162 </dd>
163 {% if layerversion.dirpath %}
164 <dt>
165 <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
166 Repository subdirectory
167 </dt>
168 <dd>
169 <span class="text-muted" style="display:none">Not set</span>
170 <span class="current-value">{{layerversion.dirpath}}</span>
171 {% if layerversion.get_vcs_dirpath_link_url %}
172 <a href="{{layerversion.get_vcs_dirpath_link_url}}" class="glyphicon glyphicon-new-window" target="_blank"></a>
173 {% endif %}
174 <form id="change-subdir-form" class="form-inline" style="display:none;">
175 <div class="form-group">
176 <input type="text" class="form-control" value="{{layerversion.dirpath}}">
177 </div>
178 </form>
179 </dd>
180 {% endif %}
181 <dt>
182 <span class="glyphicon glyphicon-question-sign get-help" title="The Git branch, tag or commit"></span>
183 Git revision
184 </dt>
185 <dd>
186 <span class="current-value">{{layerversion.get_vcs_reference}}</span>
187 <form style="display:none;" class="form-inline">
188 <div class="form-group">
189 <input type="text" class="form-control" value="{{layerversion.get_vcs_reference}}">
190 </div>
191 </form>
192 </dd>
193 </dl>
194 {% endif %}
195 {% if layerversion.layer_source == layer_source.TYPE_IMPORTED %}
196 <button class="btn btn-default btn-lg" id="edit-layer-source" style="margin-left:220px;">Edit layer source code location</button>
197 {% endif %}
198 <form id="edit-layer-source-form" style="display:none;">
199 <fieldset>
200 <legend class="radioLegend">Where is the layer source code?</legend>
201 <div class="radio">
202 <label>
203 <input type="radio" name="source-location" id="repo" value="repo">
204 In a <strong>Git repository</strong>
205 </label>
206 <p class="help-block" style="margin-left:20px;width:70%;">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will fetch and checkout your chosen Git revision every time you start a build.</p>
207 </div>
208 <div class="radio" style="margin-top:15px;">
209 <label>
210 <input type="radio" name="source-location" id="dir" value="dir" checked>
211 In a <strong>directory</strong>
212 </label>
213 <p class="help-block" style="margin-left:20px;width:70%;">Use this option for quick layer development, by simply providing the path to the layer source code.</p>
214 </div>
215 </fieldset>
216
217 <fieldset id="layer-git">
218 <legend>Git repository information</legend>
219 <div class="form-group">
220 <label for="layer-git-repo-url">
221 Git repository URL
222 <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span>
223 </label>
224 <input type="text" id="layer-git-repo-url" class="form-control" value="{{layerversion.layer.vcs_url|default_if_none:''}}">
225 </div>
226 <div class="form-group">
227 <label for="layer-subdir">
228 Repository subdirectory
229 <span class="text-muted">(optional)</span>
230 <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
231 </label>
232 <input type="text" class="form-control" id="layer-subdir" value="{{layerversion.dirpath|default_if_none:''}}">
233 </div>
234 <div class="form-group" id="layer-revision-ctrl">
235 <label for="layer-git-ref">Git revision
236 <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
237 </label>
238 <input type="text" class="form-control" id="layer-git-ref" value="{{layerversion.get_vcs_reference|default_if_none:''}}">
239 <span class="help-inline" style="display:none;" id="invalid-layer-revision-hint"></span>
240 </div>
241 </fieldset>
242
243 <fieldset id="layer-dir">
244 <legend>Layer directory information</legend>
245 <div class="form-group">
246 <label for="layer-dir-path">
247 Enter the absolute path to the layer directory
248 </label>
249 <input type="text" id="layer-dir-path-in-details" class="form-control" value="{{layerversion.layer.local_source_dir}}" required>
250 </div>
251 </fieldset>
252
253 <div style="margin-top:25px;">
254 <a href="#" class="btn btn-primary btn-lg" id="save-changes-for-switch">Save changes</a>
255 <a href="#" class="btn btn-link btn-lg" id="cancel-changes-for-switch">Cancel</a>
256 </div>
257 </form>
258
259 <h3 class="top-air">Layer dependencies
260 <span class="glyphicon glyphicon-question-sign get-help" title="Other layers this layer depends upon"></span>
261 </h3>
262
263 <ul class="list-unstyled current-value lead" id="layer-deps-list">
264 {% for ld in layerversion.dependencies.all %}
265 <li data-layer-id="{{ld.depends_on.id}}">
266 <a data-toggle="tooltip" title="{{ld.depends_on.layer.vcs_url}} | {{ld.depends_on.get_vcs_reference}}" href="{% url 'layerdetails' project.id ld.depends_on.id %}">{{ld.depends_on.layer.name}}</a>
267 <span class="glyphicon glyphicon-trash " data-toggle="tooltip" title="Delete"></span>
268 </li>
269 {% endfor %}
270 </ul>
271 <form class="form-inline add-deps">
272 <div class="form-group">
273 <input class="form-control" type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" placeholder="Type a layer name" id="layer-dep-input">
274 </div>
275 <a class="btn btn-default" id="add-layer-dependency-btn" disabled="disabled">
276 Add layer
277 </a>
278 <span class="help-block add-deps">You can only add layers Toaster knows about</span>
279 </form>
280 </div>
281 <!-- end layerdetails tab -->
282 <!-- targets tab -->
283 <div id="recipes" class="tab-pane">
284 <!-- Recipe table -->
285 <div id="no-recipes-yet" class="alert alert-info" style="display:none">
286 <p>Toaster does not have recipe information for the <strong> {{layerversion.layer.name}} </strong> layer.</p>
287 <p>Toaster learns about layers when you build them. If this layer provides any recipes, they will be listed here after you build the <strong> {{layerversion.layer.name}} </strong> layer.</p>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500288 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600289 {% url 'layerrecipestable' project.id layerversion.id as xhr_table_url %}
290 {% with "recipestable" as table_name %}
291 {% with "Recipes" as title %}
292 {% include 'toastertable-simple.html' %}
293 {% endwith %}
294 {% endwith %}
295 </div>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500296
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600297 <div id="machines" class="tab-pane">
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500298
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600299 <div id="no-machines-yet" class="alert alert-info" style="display:none">
300 <p>Toaster does not have machine information for the <strong> {{layerversion.layer.name}} </strong> layer.</p>
301 <p>Sadly, machine information cannot be obtained from builds, so this page will remain empty.</p>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500302 </div>
303
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500304
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600305 <!-- Machines table -->
306 {% url 'layermachinestable' project.id layerversion.id as xhr_table_url %}
307 {% with "machinestable" as table_name %}
308 {% with "Machines" as title %}
309 {% include 'toastertable-simple.html' %}
310 {% endwith %}
311 {% endwith %}
312 </div>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800313
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600314 </div> <!-- end tab content -->
315 </div> <!-- end tabable -->
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500316
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600317 <div class="col-md-4"> <!-- info side panel -->
318 <div class="well">
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500319 <h2>About {{layerversion.layer.name}}</h2>
320 <dl class="item-info">
321
322 <dt>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600323 Summary
324 <span class="glyphicon glyphicon-question-sign get-help" title="One-line description of the layer"></span>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500325 </dt>
326 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600327 <span class="text-muted" style="display:none">Not set</span>
328 <span class="current-value">{{layerversion.layer.summary|default_if_none:''}}</span>
329 <form style="display:none; margin-bottom:20px; margin-top:5px;">
330 <div class="form-group">
331 <textarea class="form-control" rows="2">{% if layerversion.layer.summary %}{{layerversion.layer.summary}}{% endif %}</textarea>
332 </div>
333 <button class="btn btn-default change-btn" data-layer-prop="summary" type="button">Save</button>
334 <a href="#" class="btn btn-link cancel">Cancel</a>
335 </form>
336 <span class="glyphicon glyphicon-edit"></span>
337 <span class="glyphicon glyphicon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500338 </dd>
339 <dt>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600340 Description
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500341 </dt>
342 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600343 <span class="text-muted" style="display:none">Not set</span>
344 <span class="current-value">{{layerversion.layer.description|default_if_none:''}}</span>
345 <form style="display:none; margin-bottom:20px; margin-top:5px;">
346 <div class="form-group">
347 <textarea class="form-control" rows="6">{% if layerversion.layer.description %}{{layerversion.layer.description}}{% endif %}</textarea>
348 </div>
349 <button class="btn btn-default change-btn" data-layer-prop="description" type="button" >Save</button>
350 <a href="#" class="btn btn-link cancel">Cancel</a>
351 </form>
352 <span class="glyphicon glyphicon-edit"></span>
353 <span class="glyphicon glyphicon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500354 </dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600355 {% if layerversion.layer_source == layer_source.TYPE_LAYERINDEX %}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500356 <dt>Layer index</dt>
357 <dd>
Andrew Geisslereff27472021-10-29 15:35:00 -0500358 <a href="https://layers.openembedded.org/layerindex/branch/{{layerversion.release.name}}/layer/{{layerversion.layer.name}}">Layer index {{layerversion.layer.name}}</a>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600359 </dd>
360 {% endif %}
361 </dl>
362 {# Only show delete link for imported layers #}
363 {% if layerversion.layer_source == layer_source.TYPE_IMPORTED %}
364 <i class="icon-trash text-danger"></i>
365 <a href="#delete-layer-modal" role="button" class="text-danger"
366 data-toggle="modal" data-target="#delete-layer-modal">Delete layer</a>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500367 {% endif %}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600368 </div>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500369 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600370 </div>
371 </div> <!-- close column 12 div -->
372</div> <!-- close top row div -->
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500373
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600374{% endblock %}