Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(998)

Unified Diff: appengine/swarming/elements/res/imp/tasklist/task-list.html

Issue 2302973002: Refactor post requests, implement bot cancel/terminate (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@basic-layout
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/elements/res/imp/tasklist/task-list.html
diff --git a/appengine/swarming/elements/res/imp/tasklist/task-list.html b/appengine/swarming/elements/res/imp/tasklist/task-list.html
index 5be3c649271cb04061a61c5b53e877dad87250b7..1fd26648a84f7fdfb600ae9d1c851cd5c15234e6 100644
--- a/appengine/swarming/elements/res/imp/tasklist/task-list.html
+++ b/appengine/swarming/elements/res/imp/tasklist/task-list.html
@@ -332,25 +332,9 @@
}
var id = task.task_id
- // Keep toast displayed until we hear back from the cancel.
- this.$.toast.duration = 0;
this.$.toast.text="Canceling task " + id;
- this.$.toast.open();
var url = "/_ah/api/swarming/v1/task/" + id +"/cancel";
- sk.request("POST", url, undefined, this._auth_headers).then(function(response) {
- this.$.toast.close();
- this.$.toast.show({
- text: "Request sent. Response: "+response,
- duration: 3000,
- });
- }.bind(this)).catch(function(reason) {
- console.log("Cancellation failed", reason);
- this.$.toast.close();
- this.$.toast.show({
- text: "Request failed. Reason: "+reason,
- duration: 3000,
- });
- }.bind(this));
+ this._postWithToast(url, this.$.toast, this._auth_headers);
},
_tag: function(task, col) {

Powered by Google App Engine
This is Rietveld 408576698