| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 | 5 |
| 6 This in an HTML Import-able file that contains the definition | 6 This in an HTML Import-able file that contains the definition |
| 7 of the following elements: | 7 of the following elements: |
| 8 | 8 |
| 9 <task-page-data> | 9 <task-page-data> |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 reload: function(){ | 123 reload: function(){ |
| 124 if (!this.task_id || !this.auth_headers) { | 124 if (!this.task_id || !this.auth_headers) { |
| 125 console.log("task_id and auth_headers can't be empty"); | 125 console.log("task_id and auth_headers can't be empty"); |
| 126 return; | 126 return; |
| 127 } | 127 } |
| 128 if (lastRequest) { | 128 if (lastRequest) { |
| 129 this.cancelAsync(lastRequest); | 129 this.cancelAsync(lastRequest); |
| 130 } | 130 } |
| 131 | 131 |
| 132 var baseUrl = "/_ah/api/swarming/v1/task/" + this.task_id; | 132 var baseUrl = "/api/swarming/v1/task/" + this.task_id; |
| 133 lastRequest = this.async(function(){ | 133 lastRequest = this.async(function(){ |
| 134 lastRequest = undefined; | 134 lastRequest = undefined; |
| 135 this._getJsonAsync("_request", baseUrl + "/request", | 135 this._getJsonAsync("_request", baseUrl + "/request", |
| 136 "_busy1", this.auth_headers); | 136 "_busy1", this.auth_headers); |
| 137 this._getJsonAsync("_result", | 137 this._getJsonAsync("_result", |
| 138 baseUrl + "/result?include_performance_stats=true", | 138 baseUrl + "/result?include_performance_stats=true", |
| 139 "_busy2", this.auth_headers); | 139 "_busy2", this.auth_headers); |
| 140 this.reloadStdout(); | 140 this.reloadStdout(); |
| 141 }, TASK_ID_DEBOUNCE_MS); | 141 }, TASK_ID_DEBOUNCE_MS); |
| 142 }, | 142 }, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 }, | 186 }, |
| 187 | 187 |
| 188 _parseStdout: function(stdout) { | 188 _parseStdout: function(stdout) { |
| 189 if (!stdout || !stdout.output) { | 189 if (!stdout || !stdout.output) { |
| 190 return "[No output yet]"; | 190 return "[No output yet]"; |
| 191 } | 191 } |
| 192 return stdout.output; | 192 return stdout.output; |
| 193 }, | 193 }, |
| 194 | 194 |
| 195 reloadStdout: function() { | 195 reloadStdout: function() { |
| 196 this._getJsonAsync("_stdout", "/_ah/api/swarming/v1/task/" + | 196 this._getJsonAsync("_stdout", "/api/swarming/v1/task/" + |
| 197 this.task_id + "/stdout", "_busy3", this.auth_headers); | 197 this.task_id + "/stdout", "_busy3", this.auth_headers); |
| 198 }, | 198 }, |
| 199 | 199 |
| 200 }); | 200 }); |
| 201 })(); | 201 })(); |
| 202 </script> | 202 </script> |
| 203 </dom-module> | 203 </dom-module> |
| OLD | NEW |