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

Unified Diff: appengine/swarming/ui/res/imp/taskpage/task-page.html

Issue 2813593002: Add editing of dimensions on retry (Closed)
Patch Set: Address feedback Created 3 years, 8 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/ui/res/imp/taskpage/task-page.html
diff --git a/appengine/swarming/ui/res/imp/taskpage/task-page.html b/appengine/swarming/ui/res/imp/taskpage/task-page.html
index 795e408c6ce2ac0c99a1053aa48a1ecae080a691..0ac6bdbd0abf72f9c1688d6452e1cda40a683014 100644
--- a/appengine/swarming/ui/res/imp/taskpage/task-page.html
+++ b/appengine/swarming/ui/res/imp/taskpage/task-page.html
@@ -41,6 +41,7 @@
<link rel="import" href="/res/imp/common/url-param.html">
<link rel="import" href="task-page-data.html">
+<link rel="import" href="task-retry-prompt.html">
<link rel="import" href="task-disambiguation.html">
<dom-module id="task-page">
@@ -603,6 +604,17 @@
</div>
</paper-dialog>
+ <paper-dialog id="retry_task" modal on-iron-overlay-closed="_retryClosed">
+ <task-retry-prompt id="retry_task_prompt"
+ task_id="[[task_id]]"
+ task_dimensions="{{_retry_dimensions}}">
+ </task-retry-prompt>
+ <div class="buttons">
+ <paper-button dialog-dismiss>Cancel</paper-button>
+ <paper-button dialog-confirm>OK</paper-button>
+ </div>
+ </paper-dialog>
+
<interval-timer period="[[_refresh_interval]]" on-trigger="_softRefresh">
</interval-timer>
@@ -693,6 +705,9 @@
_result: {
type: Object,
},
+ _retry_dimensions: {
+ type: Array,
+ },
_server_details: {
type: Object,
},
@@ -889,11 +904,7 @@
_promptClosed: function(e) {
if (e.detail.confirmed) {
- if (this._dialog_prompt.startsWith("cancel")) {
- this._cancelTask();
- } else {
- this._retryTask();
- }
+ this._cancelTask();
}
},
@@ -903,47 +914,18 @@
},
_promptRetry: function() {
- this.set("_dialog_prompt", "retry task "+this.task_id);
- this.$.prompt.open();
+ this.$.retry_task_prompt.setDimensions(this._request.properties.dimensions);
+ this.$.retry_task.open();
},
- _rawOutput: function(stdout, result) {
- if (stdout) {
- return stdout;
- }
- if (result.state === "PENDING" || result.state === "RUNNING") {
- return "[No output yet]";
- }
- return "[No output received]";
- },
-
- _refresh: function() {
- this.$.data.reload();
- },
-
- _requestUpdated: function(request) {
- if (this._noMilo(request)) {
- this.set("_show_raw", 1);
- }
- },
-
- _softRefresh: function() {
- if (this._result && this._result.state !== "RUNNING" &&
- this._result.state !== "PENDING") {
- return;
- }
- this.$.data.reload();
- var miloFrame = this.$$("iframe")
- if (miloFrame) {
- miloFrame.src = this._getDisplayServerLink(this._server_details.display_server_url_template,this.task_id);
- }
- },
-
- _retryTask: function() {
+ _retryClosed: function(e) {
if (!this._request) {
sk.errorMessage("Task not yet loaded", 3000);
return;
}
+ if (!e.detail.confirmed) {
+ return;
+ }
var newTask = {
expiration_secs: this._request.expiration_secs,
name: this._request.name +" (retry)",
@@ -954,6 +936,14 @@
user: this._profile.email,
service_account: this._request.service_account,
}
+ newTask.properties.dimensions = this._retry_dimensions.filter(function(d){
+ return d && d.key && d.value;
+ });
+ if (!newTask.properties.dimensions || !newTask.properties.dimensions.length) {
+ sk.errorMessage("Your retried task must specify dimensions", 5000);
+ return;
+ }
+ console.log("Retrying with dimensions", newTask.properties.dimensions);
newTask.properties.idempotent = false;
swarming.postWithToast("/api/swarming/v1/tasks/new", "Retrying task " + this.task_id,
this._auth_headers, newTask)
@@ -970,6 +960,39 @@
);
},
+ _rawOutput: function(stdout, result) {
+ if (stdout) {
+ return stdout;
+ }
+ if (result.state === "PENDING" || result.state === "RUNNING") {
+ return "[No output yet]";
+ }
+ return "[No output received]";
+ },
+
+ _refresh: function() {
+ this.$.data.reload();
+ },
+
+ _requestUpdated: function(request) {
+ if (this._noMilo(request)) {
+ this.set("_show_raw", 1);
+ }
+ },
+
+ _softRefresh: function() {
+ if (this._result && this._result.state !== "RUNNING" &&
+ this._result.state !== "PENDING") {
+ return;
+ }
+ this.$.data.reload();
+ var miloFrame = this.$$("iframe")
+ if (miloFrame) {
+ var templ = this._server_details.display_server_url_template;
+ miloFrame.src = this._getDisplayServerLink(templ, this.task_id);
+ }
+ },
+
_rowspan: function(dims) {
dims = dims || [];
return dims.length + 1;
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/taskpage/task-page-demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698