aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/orm/models.py2
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js5
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py7
-rw-r--r--bitbake/lib/toaster/toastergui/templates/mrb_section.html2
4 files changed, 15 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 2a615a9fd0e..4d57c8dce6a 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -351,11 +351,13 @@ class Build(models.Model):
SUCCEEDED = 0
FAILED = 1
IN_PROGRESS = 2
+ CANCELLED = 3
BUILD_OUTCOME = (
(SUCCEEDED, 'Succeeded'),
(FAILED, 'Failed'),
(IN_PROGRESS, 'In Progress'),
+ (CANCELLED, 'Cancelled'),
)
search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"]
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index c688f794606..39837b72baf 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -131,11 +131,16 @@ var libtoaster = (function (){
url: url,
data: { 'buildCancel': build_ids },
headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ beforeSend: function() {
+ $('#loading-notification').html("Build cancellation is in process. Please wait");
+ },
success: function (_data) {
/* No proper reponse YOCTO #7995
if (_data.error !== "ok") {
console.warn(_data.error);
} else {*/
+ $('#loading-notification').html("Build cancellation successful");
+ setTimeout(function() {}, 2000)
if (onsuccess !== undefined) onsuccess(_data);
//}
},
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 48a7c7bd9c4..2af4b73d81e 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -1272,8 +1272,13 @@ class BuildsTable(ToasterTable):
bbctrl = bbcontroller.BitbakeController(br.environment)
bbctrl.forceShutDown()
while True:
- if BuildRequest.objects.get(pk = i).build.outcome == 0:
+ import time
+ time.sleep(2)
+ build = BuildRequest.objects.get(pk = i).build
+ if build.outcome == 0:
br.state = BuildRequest.REQ_DELETED
+ build.outcome = 3
+ build.save()
br.save()
break
except BuildRequest.DoesNotExist:
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index 68e18d13676..0a389f7604e 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -134,6 +134,8 @@
Cancel
</button>
{%endif%}
+ {%else%}
+ <i class="icon-question-sign get-help heading-help pull-right" data-placement="left" title="" data-original-title="Builds in this projects cannot be cancelled from Toaster: they can only be cancelled from the command line"></i>
{%endif%}
{%endif%}
</div>