bitbake: toastergui: project page - consistent error display

We modify the project page to provide a consistent view of the
build errors. The display is now similar with the
managed_mrb_section and links point to the buildrequest
detail view.

[YOCTO #7188]

(Bitbake rev: d37eaaa48a63a137ded25a14911c97a5ae861ff6)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN 2015-03-09 16:42:44 +00:00 committed by Richard Purdie
parent daaafb4b5b
commit c8714ec0cd
2 changed files with 32 additions and 23 deletions

View File

@ -130,29 +130,35 @@ vim: expandtab tabstop=2
<switch ng-switch="b.status">
<case ng-switch-when="failed">
<div class="lead span3"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span></div>
<div >
<button class="btn pull-right btn-danger" ng-click="buildExistingTarget(b.targets)">Run again</button>
<div class="lead span3">
<a ng-class="{'succeeded': 'success', 'failed': 'error'}[b.status]" href="{[b.br_page_url]}">
<span ng-repeat="t in b.targets" ng-include src="'target_display'"></span>
</a>
</div>
<div class="row-fluid">
<div class="air well" ng-repeat="e in b.errors">
<pre>{[e.msg]}</pre>
<ngif ng-if="e.msg.indexOf('Nothin') == 0">
<div ng-repeat="t in getTargetNameFromErrorMsg(e.msg)">
<p class="lead">The target <strong>{[t]}</strong> is not provided by any of your project layers.</p>
<p> Your build has failed because the target <strong>{[t]}</strong> is not provided by any of your project layers.</p>
<ngif ng-if="layersForTargets[t].length > 0">
<p>The following layers provide this target. You could add one of them to your project.</p>
<button class="btn btn-danger add-layer-with-dependencies" ng-repeat="l in layersForTargets[t]" ng-click="layerAddById(l.id)">Add {[l.name]}</button>
</ngif>
</div>
</ngif>
<ngif ng-if="e.msg.indexOf('Nothin') != 0">
<p>
Please contact your system administrator to help troubleshoot this error.
</p>
</ngif>
</div>
<div class="span2 lead">
<ngif ng-if="b.updated - todaydate > 0">
{[b.updated|date:'HH:mm']}
</ngif>
<ngif ng-if="b.updated - todaydate < 0">
{[b.updated|date:'dd/MM/yy HH:mm']}
</ngif>
</div>
<div class="span2">
<ngif ng-if="b.errors.length">
<span>
<i class="icon-minus-sign red lead"></i>
<a href="{[b.br_page_url]}#errors" class="lead error">{[b.errors.length]}
<ng-pluralize count="b.errors.length" when="{'1':'error','other':'errors'}"></ng-pluralize></a>
</span>
</ngif>
</div>
<div class="span2">
<!-- we don't have warnings in this case -->
</div>
<div> <span class="lead">Build time: {[b.command_time|timediff]}</span>
<button class="btn pull-right" ng-class="{'succeeded': 'btn-success', 'failed': 'btn-danger'}[b.status]"
ng-click="buildExistingTarget(b.targets)">Run again</button>
</div>
</case>

View File

@ -66,7 +66,10 @@ def _project_recent_build_list(prj):
"id": x.pk,
"targets" : map(lambda y: {"target": y.target, "task": y.task }, x.brtarget_set.all()),
"status": x.get_state_display(),
"errors": map(lambda y: {"type": y.errtype, "msg": y.errmsg, "tb": y.traceback}, x.brerror_set.exclude(errmsg__contains="Command Failed")),
"errors": map(lambda y: {"type": y.errtype, "msg": y.errmsg, "tb": y.traceback}, x.brerror_set.all()),
"updated": x.updated.strftime('%s')+"000",
"command_time": (x.updated - x.created).total_seconds(),
"br_page_url": reverse('buildrequestdetails', args=(x.project.id, x.pk) ),
"build" : map( lambda y: {"id": y.pk,
"status": y.get_outcome_display(),
"completed_on" : y.completed_on.strftime('%s')+"000",