| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 var now = new Date(); | 181 var now = new Date(); |
| 182 TIMES.forEach(function(time) { | 182 TIMES.forEach(function(time) { |
| 183 swarming.sanitizeAndHumanizeTime(result, time); | 183 swarming.sanitizeAndHumanizeTime(result, time); |
| 184 }); | 184 }); |
| 185 // Running tasks have no duration set, so we can figure it out. | 185 // Running tasks have no duration set, so we can figure it out. |
| 186 if (!result.duration && result.state === this.RUNNING && result.started_
ts){ | 186 if (!result.duration && result.state === this.RUNNING && result.started_
ts){ |
| 187 result.duration = (now - result.started_ts) / 1000; | 187 result.duration = (now - result.started_ts) / 1000; |
| 188 } | 188 } |
| 189 // Make the duration human readable | 189 // Make the duration human readable |
| 190 if (result.duration){ | 190 result.human_duration = this._humanDuration(result.duration); |
| 191 result.human_duration = this._humanDuration(result.duration); | |
| 192 } | |
| 193 return result; | 191 return result; |
| 194 }, | 192 }, |
| 195 | 193 |
| 196 _parseStdout: function(stdout) { | 194 _parseStdout: function(stdout) { |
| 197 if (!stdout || !stdout.output) { | 195 if (!stdout || !stdout.output) { |
| 198 return ""; | 196 return ""; |
| 199 } | 197 } |
| 200 return stdout.output; | 198 return stdout.output; |
| 201 }, | 199 }, |
| 202 | 200 |
| 203 reloadStdout: function() { | 201 reloadStdout: function() { |
| 204 this._getJsonAsync("_stdout", "/api/swarming/v1/task/" + | 202 this._getJsonAsync("_stdout", "/api/swarming/v1/task/" + |
| 205 this.task_id + "/stdout", "_busy3", this.auth_headers); | 203 this.task_id + "/stdout", "_busy3", this.auth_headers); |
| 206 }, | 204 }, |
| 207 | 205 |
| 208 }); | 206 }); |
| 209 })(); | 207 })(); |
| 210 </script> | 208 </script> |
| 211 </dom-module> | 209 </dom-module> |
| OLD | NEW |