diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-01-08 13:15:14 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-08 22:34:38 +0000 |
commit | 876370419a50264a28feb4278f8c465b0019e709 (patch) | |
tree | 5f6d3c4c9dfb6d6839ab3eea7136dc938d088279 /bitbake/lib/toaster/toastergui/templates | |
parent | 66e1b520d77f9c7512b7f1cf920cf9bea8d3ce3e (diff) | |
download | poky-876370419a50264a28feb4278f8c465b0019e709.tar.gz |
bitbake: toaster: implementation of project page
This patch brings the project page in line with the design,
including build error handling and suggestions.
Includes some refactoring for already existing code.
[YOCTO #6587]
(Bitbake rev: 1ea658dcdfde5465d3ecdb97550e0a66cb8b122e)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/project.html | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html index 2979db74ed..67b267256b 100644 --- a/bitbake/lib/toaster/toastergui/templates/project.html +++ b/bitbake/lib/toaster/toastergui/templates/project.html | |||
@@ -89,9 +89,9 @@ vim: expandtab tabstop=2 | |||
89 | 89 | ||
90 | <!-- build form --> | 90 | <!-- build form --> |
91 | <div class="well"> | 91 | <div class="well"> |
92 | <form class="build-form" ng-submit="targetNamedBuild()"> | 92 | <form class="build-form" ng-submit="buildNamedTarget()"> |
93 | <div class="input-append controls"> | 93 | <div class="input-append controls"> |
94 | <input type="text" class="huge span7" placeholder="Type the target(s) you want to build" autocomplete="off" ng-model="targetName" typeahead="e.name for e in getSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"/> | 94 | <input type="text" class="huge span7" placeholder="Type the target(s) you want to build" autocomplete="off" ng-model="targetName" typeahead="e.name for e in getAutocompleteSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"/> |
95 | <button type="submit" id="build-button" class="btn btn-large btn-primary" ng-disabled="!targetName.length"> | 95 | <button type="submit" id="build-button" class="btn btn-large btn-primary" ng-disabled="!targetName.length"> |
96 | Build | 96 | Build |
97 | </button> | 97 | </button> |
@@ -108,6 +108,9 @@ vim: expandtab tabstop=2 | |||
108 | </form> | 108 | </form> |
109 | </div> | 109 | </div> |
110 | 110 | ||
111 | |||
112 | <!-- latest builds list --> | ||
113 | |||
111 | <a id="buildslist"></a> | 114 | <a id="buildslist"></a> |
112 | <h2 class="air" ng-if="builds.length">Latest builds</h2> | 115 | <h2 class="air" ng-if="builds.length">Latest builds</h2> |
113 | <div class="animate-repeat alert" ng-repeat="b in builds track by b.id" ng-class="{'queued':'alert-info', 'deleted':'alert-info', 'in progress': 'alert-info', 'failed':'alert-error', 'completed':{'In Progress':'alert-info', 'Succeeded':'alert-success', 'Failed':'alert-error'}[b.build[0].status]}[b.status]"> | 116 | <div class="animate-repeat alert" ng-repeat="b in builds track by b.id" ng-class="{'queued':'alert-info', 'deleted':'alert-info', 'in progress': 'alert-info', 'failed':'alert-error', 'completed':{'In Progress':'alert-info', 'Succeeded':'alert-success', 'Failed':'alert-error'}[b.build[0].status]}[b.status]"> |
@@ -116,9 +119,27 @@ vim: expandtab tabstop=2 | |||
116 | 119 | ||
117 | <case ng-switch-when="failed"> | 120 | <case ng-switch-when="failed"> |
118 | <div class="lead span3"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span></div> | 121 | <div class="lead span3"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span></div> |
122 | <div > | ||
123 | <button class="btn pull-right btn-danger" ng-click="buildExistingTarget(b.targets)">Run again</button> | ||
124 | </div> | ||
119 | <div class="row-fluid"> | 125 | <div class="row-fluid"> |
120 | <div class="air well" ng-repeat="e in b.errors"> | 126 | <div class="air well" ng-repeat="e in b.errors"> |
121 | Error type {[e.type]}: <pre>{[e.msg]}</pre> | 127 | <pre>{[e.msg]}</pre> |
128 | <ngif ng-if="e.msg.indexOf('Nothin') == 0"> | ||
129 | <div ng-repeat="t in getTargetNameFromErrorMsg(e.msg)"> | ||
130 | <p class="lead">The target <strong>{[t]}</strong> is not provided by any of your project layers.</p> | ||
131 | <p> Your build has failed because the target <strong>{[t]}</strong> is not provided by any of your project layers.</p> | ||
132 | <ngif ng-if="layersForTargets[t].length > 0"> | ||
133 | <p>The following layers provide this target. You could add one of them to your project.</p> | ||
134 | <button class="btn btn-danger add-layer-with-dependencies" ng-repeat="l in layersForTargets[t]" ng-click="layerAddById(l.id)">Add {[l.name]}</button> | ||
135 | </ngif> | ||
136 | </div> | ||
137 | </ngif> | ||
138 | <ngif ng-if="e.msg.indexOf('Nothin') != 0"> | ||
139 | <p> | ||
140 | Please contact your system administrator to help troubleshoot this error. | ||
141 | </p> | ||
142 | </ngif> | ||
122 | </div> | 143 | </div> |
123 | </div> | 144 | </div> |
124 | </case> | 145 | </case> |
@@ -128,7 +149,7 @@ vim: expandtab tabstop=2 | |||
128 | <div class="span4 lead" >Build queued | 149 | <div class="span4 lead" >Build queued |
129 | <i title="This build will start as soon as a build server is available" class="icon-question-sign get-help get-help-blue heading-help" data-toggle="tooltip"></i> | 150 | <i title="This build will start as soon as a build server is available" class="icon-question-sign get-help get-help-blue heading-help" data-toggle="tooltip"></i> |
130 | </div> | 151 | </div> |
131 | <button class="btn pull-right btn-info" ng-click="buildCancel(b.id)">Cancel</button> | 152 | <button class="btn pull-right btn-info" ng-click="buildCancel(b)">Cancel</button> |
132 | </case> | 153 | </case> |
133 | 154 | ||
134 | <case ng-switch-when="created"> | 155 | <case ng-switch-when="created"> |
@@ -136,7 +157,7 @@ vim: expandtab tabstop=2 | |||
136 | <div class="span6" > | 157 | <div class="span6" > |
137 | <span class="lead">Creating build</span> | 158 | <span class="lead">Creating build</span> |
138 | </div> | 159 | </div> |
139 | <button class="btn pull-right btn-info" ng-click="buildCancel(b.id)">Cancel</button> | 160 | <button class="btn pull-right btn-info" ng-click="buildCancel(b)">Cancel</button> |
140 | </case> | 161 | </case> |
141 | 162 | ||
142 | <case ng-switch-when="deleted"> | 163 | <case ng-switch-when="deleted"> |
@@ -144,7 +165,7 @@ vim: expandtab tabstop=2 | |||
144 | <div class="span6" id="{[b.id]}-deleted" > | 165 | <div class="span6" id="{[b.id]}-deleted" > |
145 | <span class="lead">Build deleted</span> | 166 | <span class="lead">Build deleted</span> |
146 | </div> | 167 | </div> |
147 | <button class="btn pull-right btn-info" ng-click="buildDelete(b.id)">Close</button> | 168 | <button class="btn pull-right btn-info" ng-click="buildDelete(b)">Close</button> |
148 | </case> | 169 | </case> |
149 | 170 | ||
150 | 171 | ||
@@ -198,7 +219,7 @@ vim: expandtab tabstop=2 | |||
198 | </div> | 219 | </div> |
199 | <div> <span class="lead">Build time: <a href="{[b.build[0].build_time_page_url]}">{[b.build[0].build_time|timediff]}</a></span> | 220 | <div> <span class="lead">Build time: <a href="{[b.build[0].build_time_page_url]}">{[b.build[0].build_time|timediff]}</a></span> |
200 | <button class="btn pull-right" ng-class="{'Succeeded': 'btn-success', 'Failed': 'btn-danger'}[b.build[0].status]" | 221 | <button class="btn pull-right" ng-class="{'Succeeded': 'btn-success', 'Failed': 'btn-danger'}[b.build[0].status]" |
201 | ng-click="targetExistingBuild(b.targets)">Run again</button> | 222 | ng-click="buildExistingTarget(b.targets)">Run again</button> |
202 | 223 | ||
203 | </div> | 224 | </div> |
204 | </case> | 225 | </case> |
@@ -244,7 +265,7 @@ vim: expandtab tabstop=2 | |||
244 | </div> | 265 | </div> |
245 | <form ng-submit="layerAdd()"> | 266 | <form ng-submit="layerAdd()"> |
246 | <div class="input-append"> | 267 | <div class="input-append"> |
247 | <input type="text" class="input-xlarge" id="layer" autocomplete="off" placeholder="Type a layer name" data-minLength="1" ng-model="layerAddName" typeahead="e.name for e in getSuggestions('layers', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" typeahead-on-select="onLayerSelect($item, $model, $label)" typeahead-editable="false" ng-class="{ 'has-error': layerAddName.$invalid }" /> | 268 | <input type="text" class="input-xlarge" id="layer" autocomplete="off" placeholder="Type a layer name" data-minLength="1" ng-model="layerAddName" typeahead="e.name for e in getAutocompleteSuggestions('layers', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" typeahead-on-select="onLayerSelect($item, $model, $label)" typeahead-editable="false" ng-class="{ 'has-error': layerAddName.$invalid }" /> |
248 | <input type="submit" id="add-layer" class="btn" value="Add" ng-disabled="!layerAddName.length"/> | 269 | <input type="submit" id="add-layer" class="btn" value="Add" ng-disabled="!layerAddName.length"/> |
249 | </div> | 270 | </div> |
250 | {% csrf_token %} | 271 | {% csrf_token %} |
@@ -265,9 +286,9 @@ vim: expandtab tabstop=2 | |||
265 | Targets | 286 | Targets |
266 | <i class="icon-question-sign get-help heading-help" title="What you build, often a recipe producing a root file system file (an image). Something like <code>core-image-minimal</code> or <code>core-image-sato</code>"></i> | 287 | <i class="icon-question-sign get-help heading-help" title="What you build, often a recipe producing a root file system file (an image). Something like <code>core-image-minimal</code> or <code>core-image-sato</code>"></i> |
267 | </h3> | 288 | </h3> |
268 | <form ng-submit="targetNamedBuild()"> | 289 | <form ng-submit="buildNamedTarget()"> |
269 | <div class="input-append"> | 290 | <div class="input-append"> |
270 | <input type="text" class="input-xlarge" placeholder="Type the target(s) you want to build" autocomplete="off" data-minLength="1" ng-model="targetName1" typeahead="e.name for e in getSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"> | 291 | <input type="text" class="input-xlarge" placeholder="Type the target(s) you want to build" autocomplete="off" data-minLength="1" ng-model="targetName1" typeahead="e.name for e in getAutocompleteSuggestions('targets', $viewValue)|filter:$viewValue" typeahead-template-url="suggestion_details" ng-disabled="!layers.length"> |
271 | <button type="submit" id="build-button" class="btn btn-primary" ng-disabled="!targetName1.length"> | 292 | <button type="submit" id="build-button" class="btn btn-primary" ng-disabled="!targetName1.length"> |
272 | Build </button> | 293 | Build </button> |
273 | </div> | 294 | </div> |
@@ -304,8 +325,8 @@ vim: expandtab tabstop=2 | |||
304 | <strong>Machine changes have a big impact on build outcome.</strong> | 325 | <strong>Machine changes have a big impact on build outcome.</strong> |
305 | You cannot really compare the builds for the new machine with the previous ones. | 326 | You cannot really compare the builds for the new machine with the previous ones. |
306 | </div> | 327 | </div> |
307 | <form ng-submit="edit('#select-machine')" class="input-append"> | 328 | <form ng-submit="editProjectSettings('#select-machine')" class="input-append"> |
308 | <input type="text" id="machine" autocomplete="off" ng-model="machineName" typeahead="m.name for m in getSuggestions('machines', $viewValue)"/> | 329 | <input type="text" id="machine" autocomplete="off" ng-model="machineName" typeahead="m.name for m in getAutocompleteSuggestions('machines', $viewValue)"/> |
309 | <input type="submit" id="apply-change-machine" class="btn" type="button" ng-disabled="machineName == machine.name || machineName.length == 0" value="Save"></input> | 330 | <input type="submit" id="apply-change-machine" class="btn" type="button" ng-disabled="machineName == machine.name || machineName.length == 0" value="Save"></input> |
310 | <input type="reset" id="cancel-machine" class="btn btn-link" ng-click="toggle('#select-machine')" value="Cancel"></input> | 331 | <input type="reset" id="cancel-machine" class="btn btn-link" ng-click="toggle('#select-machine')" value="Cancel"></input> |
311 | {% csrf_token %} | 332 | {% csrf_token %} |
@@ -337,7 +358,7 @@ vim: expandtab tabstop=2 | |||
337 | <i class="icon-pencil" ng-click="toggle('#change-project-name')" ></i> | 358 | <i class="icon-pencil" ng-click="toggle('#change-project-name')" ></i> |
338 | </p> | 359 | </p> |
339 | <div id="change-project-name" style="display:none;"> | 360 | <div id="change-project-name" style="display:none;"> |
340 | <form ng-submit="edit('#change-project-name')" class="input-append"> | 361 | <form ng-submit="editProjectSettings('#change-project-name')" class="input-append"> |
341 | <input type="text" class="input-xlarge" id="type-project-name" ng-model="projectName"> | 362 | <input type="text" class="input-xlarge" id="type-project-name" ng-model="projectName"> |
342 | <input type="submit" class="btn" value="Save" ng-disabled="project.name == projectName"/> | 363 | <input type="submit" class="btn" value="Save" ng-disabled="project.name == projectName"/> |
343 | <input type="reset" class="btn btn-link" value="Cancel" ng-click="toggle('#change-project-name')"> | 364 | <input type="reset" class="btn btn-link" value="Cancel" ng-click="toggle('#change-project-name')"> |
@@ -354,7 +375,7 @@ vim: expandtab tabstop=2 | |||
354 | <i id="change-version" class="icon-pencil" ng-click="toggle('#change-project-version')" ></i> | 375 | <i id="change-version" class="icon-pencil" ng-click="toggle('#change-project-version')" ></i> |
355 | </p> | 376 | </p> |
356 | <div class="div-inline" id="change-project-version" style="display:none;"> | 377 | <div class="div-inline" id="change-project-version" style="display:none;"> |
357 | <form ng-submit="test('#change-project-version')" class="input-append"> | 378 | <form ng-submit="testProjectSettingsChange('#change-project-version')" class="input-append"> |
358 | <select id="select-version" ng-model="projectVersion"> | 379 | <select id="select-version" ng-model="projectVersion"> |
359 | <option ng-repeat="r in releases" value="{[r.id]}" ng-selected="r.id == project.release.id">{[r.description]}</option> | 380 | <option ng-repeat="r in releases" value="{[r.id]}" ng-selected="r.id == project.release.id">{[r.description]}</option> |
360 | </select> | 381 | </select> |
@@ -404,6 +425,7 @@ angular.element(document).ready(function() { | |||
404 | scope.updateDisplayWithCommands(); | 425 | scope.updateDisplayWithCommands(); |
405 | scope.validateData(); | 426 | scope.validateData(); |
406 | 427 | ||
428 | scope.init(); | ||
407 | scope.$digest(); | 429 | scope.$digest(); |
408 | 430 | ||
409 | }); | 431 | }); |