diff options
Diffstat (limited to 'yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html')
-rw-r--r-- | yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html | 108 |
1 files changed, 63 insertions, 45 deletions
diff --git a/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html index bd8f99178..b5e798d7c 100644 --- a/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -2,11 +2,26 @@ {% load projecttags %} {% load project_url_tag %} {% load humanize %} +<script src="{% static 'js/mrbsection.js' %}"></script> +<script> + $(document).ready(function () { + var ctx = { + mrbType : "{{mrb_type}}", + } + + try { + mrbSectionInit(ctx); + } catch (e) { + document.write("Sorry, An error has occurred loading this page"); + console.warn(e); + } + }); +</script> {%if mru and mru.count > 0%} {%if mrb_type == 'project' %} - <h2> + <h2 class="page-header"> Latest project builds {% if project.is_default %} @@ -14,7 +29,7 @@ {% endif %} </h2> {% else %} - <div class="page-header"> + <div class="page-header top-air"> <h1> Latest builds </h1> @@ -38,8 +53,9 @@ {% if build.target_set.all.count > 0 %} <span data-toggle="tooltip" {% if build.target_set.all.count > 1 %} - title="Targets: - {% for target in build.target_set.all %} + {{build.get_sorted_target_list.0.target}} + title="Recipes: + {% for target in build.get_sorted_target_list %} {% if target.task %} {{target.target}}:{{target.task}} {% else %} @@ -49,12 +65,12 @@ {% endif %} > {% if build.target_set.all.0.task %} - {{build.target_set.all.0.target}}:{{build.target_set.all.0.task}} + {{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}} {% else %} - {{build.target_set.all.0.target}} + {{build.get_sorted_target_list.0.target}} {% endif %} {% if build.target_set.all.count > 1 %} - (+ {{build.target_set.all.count|add:"-1"}}) + (+{{build.target_set.all.count|add:"-1"}}) {% endif %} </span> {% endif %} @@ -98,7 +114,7 @@ " title="Builds in this project cannot be started from Toaster: they are started from the command line"> </i> {% else %} - <button class="btn + <button class="run-again-btn btn {% if build.outcome == build.SUCCEEDED %} btn-success {% elif build.outcome == build.FAILED %} @@ -107,54 +123,56 @@ btn-info {%endif%} pull-right" - onclick='scheduleBuild({% url 'projectbuilds' build.project.id as bpi %}{{bpi|json}}, - {{build.project.name|json}}, - {% url 'project' build.project.id as purl %}{{purl|json}}, - {{build.target_set.all|get_tasks|json}})'> + data-request-url="{% url 'xhr_buildrequest' build.project.pk %}" + data-target='{{build.target_set.all|get_tasks|json}}'> + - Run again + Rebuild </button> {% endif %} </div> {%endif%} {%if build.outcome == build.IN_PROGRESS %} - <div class="span4 offset1"> - <div class="progress" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete"> - <div style="width: {{build.completeper}}%;" class="bar"></div> - </div> - </div> - <div class="lead pull-right">{{build.completeper}}% of tasks complete</div> - {%endif%} - </div> + <div class="span4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}"> + <p class="lead">Cancelling the build ...</p> </div> + <div class="span4 offset1 progress-info"> + <div class="progress" id="build-pc-done-title-{{build.pk}}" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete"> + <div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="bar"></div> + </div> + </div> + <div class="lead span3 progress-info"><span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete</div> + {# No build cancel for command line builds project #} + {% if build.project.is_default %} + <i class="icon-question-sign get-help get-help-blue pull-right" title="" data-original-title="Builds in this project cannot be cancelled from Toaster: they can only be cancalled from the command line"></i> + {% else %} + <div class="lead pull-right progress-info"> + <button class="cancel-build-btn btn btn-info pull-right" + data-buildrequest-id={{build.buildrequest.pk}} + data-request-url="{% url 'xhr_buildrequest' build.project.pk %}" > + Cancel + </button> + </div> + {% endif %} - {% endfor %} - </div> - -<script> - -function scheduleBuild(url, projectName, projectUrl, buildlist) { - console.log("scheduleBuild"); - libtoaster.startABuild(url, null, buildlist.join(" "), function(){ - console.log("reloading page"); - window.location.reload(); - }, null); -} - -$(document).ready(function(){ + {%endif%} {# end if in progress #} - $(".cancel-build-btn").click(function (){ - var url = $(this).data('request-url'); - var buildIds = $(this).data('build-id'); - var btn = $(this); + {% if build.outcome == build.CANCELLED %} + <div class="span4"> + <p class="lead">Build cancelled</p> + </div> + <button class="btn btn-info pull-right run-again-btn" + data-request-url="{% url 'xhr_buildrequest' build.project.pk %}" + data-target='{{build.target_set.all|get_tasks|json}}'> + Rebuild - libtoaster.cancelABuild(url, buildIds, function(){ - btn.parents(".alert").fadeOut(); - }, null); - }); -}); + </button> + {% endif %} + </div> +</div> -</script> + {% endfor %} + </div> {%endif%} |