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

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

Issue 2306103002: Add aliases to bot-page and refactor duplicated code (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@fix-buttons
Patch Set: rebase again 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..6cfee118634e54fd0b7d62448b6ff013f97515d7 100644
--- a/appengine/swarming/elements/res/imp/tasklist/task-list.html
+++ b/appengine/swarming/elements/res/imp/tasklist/task-list.html
@@ -26,10 +26,10 @@
<link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="/res/imp/bower_components/paper-button/paper-button.html">
-<link rel="import" href="/res/imp/bower_components/paper-toast/paper-toast.html">
<link rel="import" href="/res/imp/bower_components/polymer/polymer.html">
<link rel="import" href="/res/imp/common/dynamic-table-behavior.html">
+<link rel="import" href="/res/imp/common/error-toast.html">
<link rel="import" href="/res/imp/common/sort-toggle.html">
<link rel="import" href="/res/imp/common/swarming-app.html">
<link rel="import" href="/res/imp/common/url-param.html">
@@ -89,7 +89,7 @@
primary_arr="{{_primary_arr}}">
</task-list-data>
- <paper-toast id="toast"></paper-toast>
+ <error-toast></error-toast>
<div class="horizontal layout">
@@ -332,25 +332,8 @@
}
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));
+ swarming.postWithToast(url, "Canceling task " + id, this._auth_headers);
},
_tag: function(task, col) {

Powered by Google App Engine
This is Rietveld 408576698