diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/mrb_section.html')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/mrb_section.html | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 432955ab88..c7bddf0372 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html | |||
| @@ -50,9 +50,6 @@ | |||
| 50 | <span class="lead{%if not MANAGED or not build.project%} pull-right{%endif%}"> | 50 | <span class="lead{%if not MANAGED or not build.project%} pull-right{%endif%}"> |
| 51 | Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a> | 51 | Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a> |
| 52 | </span> | 52 | </span> |
| 53 | {% if MANAGED and build.project %} | ||
| 54 | <a class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%elif build.outcome == build.FAILED%}btn-danger{%else%}btn-info{%endif%} pull-right" onclick="scheduleBuild({% url 'xhr_projectbuild' build.project.id as bpi%}{{bpi|json}}, {{build.project.name|json}}, {{build.get_sorted_target_list|mapselect:'target'|json}})">Run again</a> | ||
| 55 | {% endif %} | ||
| 56 | </div> | 53 | </div> |
| 57 | {%endif%} | 54 | {%endif%} |
| 58 | {%if build.outcome == build.IN_PROGRESS %} | 55 | {%if build.outcome == build.IN_PROGRESS %} |
| @@ -68,41 +65,5 @@ | |||
| 68 | 65 | ||
| 69 | {% endfor %} | 66 | {% endfor %} |
| 70 | </div> | 67 | </div> |
| 71 | |||
| 72 | <script> | ||
| 73 | |||
| 74 | function _makeXHRBuildCall(url, data, onsuccess, onfail) { | ||
| 75 | $.ajax( { | ||
| 76 | type: "POST", | ||
| 77 | url: url, | ||
| 78 | data: data, | ||
| 79 | headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, | ||
| 80 | success: function (_data) { | ||
| 81 | if (_data.error != "ok") { | ||
| 82 | console.warn(_data.error); | ||
| 83 | } else { | ||
| 84 | if (onsuccess != undefined) onsuccess(_data); | ||
| 85 | } | ||
| 86 | }, | ||
| 87 | error: function (_data) { | ||
| 88 | console.warn("Call failed"); | ||
| 89 | console.warn(_data); | ||
| 90 | if (onfail) onfail(data); | ||
| 91 | } }); | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | function scheduleBuild(url, projectName, buildlist) { | ||
| 96 | console.warn("scheduleBuild"); | ||
| 97 | _makeXHRBuildCall(url, {targets: buildlist.join(" ")}, function (_data) { | ||
| 98 | |||
| 99 | $('#latest-builds').prepend('<div class="alert alert-info" style="padding-top:0px">' + '<span class="label label-info" style="font-weight: normal; margin-bottom: 5px; margin-left:-15px; padding-top:5px;">'+projectName+'</span><div class="row-fluid">' + | ||
| 100 | '<div class="span4 lead">' + buildlist.join(" ") + | ||
| 101 | '</div><div class="span4 lead pull-right">Build queued. Your build will start shortly.</div></div></div>'); | ||
| 102 | }); | ||
| 103 | } | ||
| 104 | |||
| 105 | </script> | ||
| 106 | |||
| 107 | {%endif%} | 68 | {%endif%} |
| 108 | 69 | ||
