summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2014-01-17 16:58:08 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-27 21:01:06 +0000
commit84b239086dbd53c59d51f4e0779767a72af02d2b (patch)
tree62ff436a8710f4d3d80913bcb0c02dab7a514859
parentb45defd88821bb712d5f5d56835600732b05025c (diff)
downloadpoky-84b239086dbd53c59d51f4e0779767a72af02d2b.tar.gz
bitbake: toaster: Implementation of recipe detail views
Add the new recipe detail page and update the view context accordingly. Rename the recipe summary page to 'recipes.html' and add the respective links to the recipe details page. The views are based on specifications found in attachments to https://bugzilla.yoctoproject.org/show_bug.cgi?id=4299 [YOCTO #4299] (Bitbake rev: d561000b6c4927ef6ec269e9ab7c70249b3c344a) Signed-off-by: David Reyna <david.reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/templates/recipe.html308
-rwxr-xr-xbitbake/lib/toaster/toastergui/templates/recipes.html52
-rw-r--r--bitbake/lib/toaster/toastergui/views.py17
3 files changed, 332 insertions, 45 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/recipe.html b/bitbake/lib/toaster/toastergui/templates/recipe.html
index 87c69b8d3c..5dea75382f 100644
--- a/bitbake/lib/toaster/toastergui/templates/recipe.html
+++ b/bitbake/lib/toaster/toastergui/templates/recipe.html
@@ -1,51 +1,275 @@
1{% extends "basebuildpage.html" %} 1{% extends "basebuilddetailpage.html" %}
2
3{% load projecttags %}
2 4
3{% block localbreadcrumb %} 5{% block localbreadcrumb %}
4<li>Recipes</li> 6<li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
7<li>{{object.name}}_{{object.version}} </li>
5{% endblock %} 8{% endblock %}
6 9
7{% block buildinfomain %} 10{% block pagedetailinfomain %}
8{% include "basetable_top.html" %} 11
9 12<!-- Begin container -->
10 <tr> 13
11 </tr> 14<div class="row span11">
12 <th>Name</th> 15 <div class="page-header">
13 <th>Version</th> 16 <h1>{{object.name}}_{{object.version}}</h1>
14 <th>Summary</th> 17 </div>
15 <th>Description</th> 18</div>
16 <th>Section</th> 19
17 <th>License</th> 20<div class="row span7 tabbable">
18 <th>License file</th> 21 <ul class="nav nav-pills">
19 <th>Homepage</th> 22 <li class="active">
20 <th>Bugtracker</th> 23 <a href="#information" data-toggle="tab">
21 <th>File_path</th> 24 <i class="icon-question-sign get-help" data-toggle="tooltip" title="Build-related information about the recipe"></i>
22 <th style="width: 30em">Recipe Dependency</th> 25 Recipe details
23 26 </a>
24 27 </li>
25 {% for recipe in objects %} 28 <li>
26 29 <a href="#packages-built" data-toggle="tab">
27 <tr class="data"> 30 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The packaged output resulting from building the recipe"></i>
28 <td><a name="{{recipe.name}}">{{recipe.name}}</a></td> 31 Packages ({{packages.count}})
29 <td>{{recipe.version}}</td> 32 </a>
30 <td>{{recipe.summary}}</td> 33 </li>
31 <td>{{recipe.description}}</td> 34 <li>
32 <td>{{recipe.section}}</td> 35 <a href="#dependencies" data-toggle="tab">
33 <td>{{recipe.license}}</td> 36 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The recipe build-time dependencies (other recipes)"></i>
34 <td>{{recipe.licensing_info}}</td> 37 Build dependencies ({{object.r_dependencies_recipe.all.count}})
35 <td>{{recipe.homepage}}</td> 38 </a>
36 <td>{{recipe.bugtracker}}</td> 39 </li>
37 <td>{{recipe.file_path}}</td> 40 <li>
38 <td> 41 <a href="#brought-in-by" data-toggle="tab">
39 <div style="height: 5em; overflow:auto"> 42 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The recipe build-time reverse dependencies (i.e. which other recipes depend on this recipe)"></i>
40 {% for rr in recipe.r_dependencies_recipe.all %} 43 Reverse build dependencies ({{object.r_dependencies_depends.all.count}})
41 <a href="#{{rr.depends_on.name}}">{{rr.depends_on.name}}</a><br/> 44 </a>
42 {% endfor %} 45 </li>
46 </ul>
47 <div class="tab-content">
48 <div class="tab-pane active" id="information" name="information">
49 <dl class="dl-horizontal">
50 <dt>
51 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The name of the layer providing the recipe"></i>
52 Layer
53 </dt>
54 <dd>{{layer.name}}</dd>
55 <dt>
56 <i class="icon-question-sign get-help" data-toggle="tooltip" title="Location in disk of the layer providing the recipe"></i>
57 Layer directory
58 </dt>
59 <dd><code>{{layer.local_path}}</code></dd>
60 <dt>
61 <i class="icon-question-sign get-help" data-toggle="tooltip" title="Location in disk of the recipe .bb file"></i>
62 Recipe file
63 </dt>
64 <dd><code>{{object.file_path}}</code></dd>
65 <dt>
66 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The Git branch of the layer providing the recipe"></i>
67 Layer branch
68 </dt>
69 <dd>{{layer_version.branch}}</dd>
70 <dt>
71 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The Git commit of the layer providing the recipe"></i>
72 Layer commit
73 </dt>
74 <dd class="iscommit">{{layer_version.commit}}</dd>
75 </dl>
76
77 <h2 class="details">Tasks</h2>
78 {% if not tasks %}
79 <div class="alert alert-info">
80 <strong>{{object.name}}_{{object.version}}</strong> does not have any tasks in this build.
81 </div>
82 {% else %}
83 <table class="table table-bordered table-hover">
84 <thead>
85 <th>
86 <i class="icon-question-sign get-help" title="The running sequence of each task in the build"></i>
87 Order
88 </th>
89 <th>
90 <i class="icon-question-sign get-help" title="The name of the task"></i>
91 Task
92 </th>
93 <th>
94 <i class="icon-question-sign get-help" title="This value tells you if a task had to run in order to generate the task output (executed), or if the output was provided by another task and therefore the task didn't need to run (not executed)"></i>
95 Executed
96 </th>
97 <th>
98 <i class="icon-question-sign get-help" title="This column tells you if executed tasks succeeded, failed or reused output from the sstate-cache directory or mirrors. It also tells you why not executed tasks did not need to run"></i>
99 Outcome
100 </th>
101 <th>
102 <i class="icon-question-sign get-help" title="This column tells you if a task tried to restore output from the <code>sstate-cache</code> directory or mirros, and what was the result: Succeeded, Failed or File not in cache"></i>
103 Cache attempt
104 </th>
105 </thead>
106 <tbody>
107
108 {% for task in tasks %}
109
110 <tr {{ task|task_color }} >
111
112 <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.order}}</a></td>
113 <td>
114 <a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.task_name}}</a>
115 <i class="icon-question-sign get-help hover-help" title="This task fetches the source code"></i>
116 </td>
117
118 {% if task.task_executed %}
119 <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">Executed</a></td>
120 {% else %}
121 <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">Prebuilt</a></td>
122 {% endif %}
123
124 <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_outcome_display}}</a></td>
125 <td>
126 {% ifnotequal task.sstate_result task.SSTATE_NA %}
127 <a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_sstate_result_display}}</a>
128 <i class="icon-question-sign get-help hover-help" title="This task did not run because its outcome was reused from a previous build"></i>
129 {% endifnotequal %}
130 </td>
131
132 </tr>
133
134 {% endfor %}
135 </tbody>
136 </table>
137 {% endif %}
138 </div>
139 <div class="tab-pane" id="packages-built" name="packages-built">
140 {% if not packages %}
141 <div class="alert alert-info">
142 <strong>{{object.name}}_{{object.version}}</strong> does not build any packages.
143 </div>
144 {% else %}
145 <table class="table table-bordered table-hover" style="margin-top:10px;">
146 <thead>
147 <tr>
148 <th>
149 Package
150 </th>
151 <th>
152 Version
153 </th>
154 <th>
155 Size
156 </th>
157 </tr>
158 </thead>
159 <tbody>
160
161 {% for package in packages %}
162
163 <tr>
164 <td><a href="{% url "package" build.pk package.pk %}">{{package.name}}</a></td>
165 <td><a href="{% url "package" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a></td>
166 <td><a href="{% url "package" build.pk package.pk %}">{{package.size}}</a></td>
167 </tr>
168
169 {% endfor %}
170
171 </tbody>
172 </table>
173 {% endif %}
43 </div> 174 </div>
44 </td> 175 <div class="tab-pane" id="dependencies" name="dependencies">
45 </tr> 176
177 {% if not object.r_dependencies_recipe.all %}
178 <div class="alert alert-info">
179 <strong>{{object.name}}_{{object.version}}</strong> has no build dependencies.
180 </div>
181 {% else %}
182 <table class="table table-bordered table-hover">
183 <thead>
184 <tr>
185 <th>
186 Recipe
187 </th>
188 <th>
189 Version
190 </th>
191 </tr>
192 </thead>
193 <tbody>
194
195 {% for rr in object.r_dependencies_recipe.all %}
196 <tr>
197 <td><a href="{% url "recipe" build.pk rr.depends_on.pk %}">{{rr.depends_on.name}}</a></td>
198 <td><a href="{% url "recipe" build.pk rr.depends_on.pk %}">{{rr.depends_on.version}}</a></td>
199 </tr>
200 {% endfor %}
201
202 </tbody>
203 </table>
204 {% endif %}
46 205
47 {% endfor %} 206 </div>
207 <div class="tab-pane" id="brought-in-by" name="brought-in-by">
208
209 {% if not object.r_dependencies_depends.all %}
210 <div class="alert alert-info">
211 <strong>{{object.name}}_{{object.version}}</strong> has no reverse build dependencies.
212 </div>
213 {% else %}
214 <table class="table table-bordered table-hover">
215 <thead>
216 <tr>
217 <th>
218 Recipe
219 </th>
220 <th>
221 Version
222 </th>
223 </tr>
224 </thead>
225 <tbody>
226
227 {% for rr in object.r_dependencies_depends.all %}
228 <tr>
229 <td><a href="{% url "recipe" build.pk rr.recipe.pk %}">{{rr.recipe.name}}</a></td>
230 <td><a href="{% url "recipe" build.pk rr.recipe.pk %}">{{rr.recipe.version}}</a></td>
231 </tr>
232 {% endfor %}
233
234 </tbody>
235 </table>
236 {% endif %}
237
238 </div>
239 </div>
240</div>
48 241
49{% include "basetable_bottom.html" %} 242<div class="row span4 well">
243 <h2>About {{object.name}}</h2>
244 <dl>
245 {% if object.summary %}
246 <dt>Summary</dt>
247 <dd><p>{{object.summary}}</p></dd>
248 {% endif %}
249 {% if object.description %}
250 <dt>Description</dt>
251 <dd><p>{{object.description}}</dd>
252 {% endif %}
253 {% if object.homepage %}
254 <dt>Homepage</dt>
255 <dd><a href="{{object.homepage}}">{{object.homepage}}</a></dd>
256 {% endif %}
257 {% if object.bugtracker %}
258 <dt>Bugtracker</dt>
259 <dd><a href="{{object.bugtracker}}">{{object.bugtracker}}</a></dd>
260 {% endif %}
261 {% if object.section %}
262 <dt>
263 Section
264 <i class="icon-question-sign get-help" data-toggle="tooltip" title="The section in which packages should be categorised. There are 5 sections: base, console, utils, devel and libs."></i>
265 </dt>
266 <dd>{{object.section}}</dd>
267 {% endif %}
268 {% if object.license %}
269 <dt>License</dt>
270 <dd>{{object.license}}</dd>
271 {% endif %}
272 </dl>
273</div>
50 274
51{% endblock %} 275{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/templates/recipes.html b/bitbake/lib/toaster/toastergui/templates/recipes.html
new file mode 100755
index 0000000000..2e0c2d1c6d
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/recipes.html
@@ -0,0 +1,52 @@
1{% extends "basebuildpage.html" %}
2
3{% block localbreadcrumb %}
4<li>Recipes</li>
5{% endblock %}
6
7{% block buildinfomain %}
8<div class="row-fluid pull-right span10">
9{% include "basetable_top.html" %}
10
11 <tr>
12 </tr>
13 <th>Name</th>
14 <th>Version</th>
15 <th>Summary</th>
16 <th>Description</th>
17 <th>Section</th>
18 <th>License</th>
19 <th>License file</th>
20 <th>Homepage</th>
21 <th>Bugtracker</th>
22 <th>File_path</th>
23 <th style="width: 30em">Recipe Dependency</th>
24
25
26 {% for recipe in objects %}
27
28 <tr class="data">
29 <td><a name="{{recipe.name}}" href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a></td>
30 <td>{{recipe.version}}</td>
31 <td>{{recipe.summary}}</td>
32 <td>{{recipe.description}}</td>
33 <td>{{recipe.section}}</td>
34 <td>{{recipe.license}}</td>
35 <td>{{recipe.licensing_info}}</td>
36 <td>{{recipe.homepage}}</td>
37 <td>{{recipe.bugtracker}}</td>
38 <td>{{recipe.file_path}}</td>
39 <td>
40 <div style="height: 5em; overflow:auto">
41 {% for rr in recipe.r_dependencies_recipe.all %}
42 <a href="#{{rr.depends_on.name}}">{{rr.depends_on.name}}</a><br/>
43 {% endfor %}
44 </div>
45 </td>
46 </tr>
47
48 {% endfor %}
49
50{% include "basetable_bottom.html" %}
51</div>
52{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index d54c66be81..1604bb6bc4 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -335,9 +335,20 @@ def recipe(request, build_id, recipe_id):
335 template = "recipe.html" 335 template = "recipe.html"
336 if Recipe.objects.filter(pk=recipe_id).count() == 0 : 336 if Recipe.objects.filter(pk=recipe_id).count() == 0 :
337 return redirect(builds) 337 return redirect(builds)
338
339 object = Recipe.objects.filter(pk=recipe_id)[0]
340 layer_version = Layer_Version.objects.filter(pk=object.layer_version_id)[0]
341 layer = Layer.objects.filter(pk=layer_version.layer_id)[0]
342 tasks = Task.objects.filter(recipe_id = recipe_id).filter(build_id = build_id)
343 packages = Package.objects.filter(recipe_id = recipe_id).filter(build_id = build_id)
344
338 context = { 345 context = {
339 'build' : Build.objects.filter(pk=build_id)[0], 346 'build' : Build.objects.filter(pk=build_id)[0],
340 'object' : Recipe.objects.filter(pk=recipe_id)[0], 347 'object' : object,
348 'layer_version' : layer_version,
349 'layer' : layer,
350 'tasks' : tasks,
351 'packages': packages,
341 } 352 }
342 return render(request, template, context) 353 return render(request, template, context)
343 354
@@ -399,7 +410,7 @@ def tasks(request, build_id):
399 return render(request, template, context) 410 return render(request, template, context)
400 411
401def recipes(request, build_id): 412def recipes(request, build_id):
402 template = 'recipe.html' 413 template = 'recipes.html'
403 mandatory_parameters = { 'count': 100, 'page' : 1}; 414 mandatory_parameters = { 'count': 100, 'page' : 1};
404 retval = _verify_parameters( request.GET, mandatory_parameters ) 415 retval = _verify_parameters( request.GET, mandatory_parameters )
405 if retval: 416 if retval: