| 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-list> | 9 <task-list> |
| 10 | 10 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 </th> | 129 </th> |
| 130 | 130 |
| 131 <th hidden$="[[_hide('deduped_from', _columns.*)]]"> | 131 <th hidden$="[[_hide('deduped_from', _columns.*)]]"> |
| 132 <span>Deduped from</span> | 132 <span>Deduped from</span> |
| 133 <sort-toggle | 133 <sort-toggle |
| 134 name="deduped_from" | 134 name="deduped_from" |
| 135 current="[[_sort]]"> | 135 current="[[_sort]]"> |
| 136 </sort-toggle> | 136 </sort-toggle> |
| 137 </th> | 137 </th> |
| 138 | 138 |
| 139 <th hidden$="[[_hide('sk_revision', _columns.*)]]"> | 139 <th hidden$="[[_hide('source_revision', _columns.*)]]"> |
| 140 <span>Skia Revision</span> | 140 <span>Source Revision</span> |
| 141 <sort-toggle | 141 <sort-toggle |
| 142 name="sk_revision" | 142 name="source_revision" |
| 143 current="[[_sort]]"> | 143 current="[[_sort]]"> |
| 144 </sort-toggle> | 144 </sort-toggle> |
| 145 </th> | 145 </th> |
| 146 | 146 |
| 147 <template | 147 <template |
| 148 is="dom-repeat" | 148 is="dom-repeat" |
| 149 items="[[_plainColumns]]" | 149 items="[[_plainColumns]]" |
| 150 as="c"> | 150 as="c"> |
| 151 <th hidden$="[[_hide(c)]]"> | 151 <th hidden$="[[_hide(c)]]"> |
| 152 <span>[[_header(c)]]</span> | 152 <span>[[_header(c)]]</span> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 </td> | 194 </td> |
| 195 <td hidden$="[[_hide('deduped_from', _columns.*)]]"> | 195 <td hidden$="[[_hide('deduped_from', _columns.*)]]"> |
| 196 <a | 196 <a |
| 197 class="center" | 197 class="center" |
| 198 href$="[[_taskLink(task.deduped_from)]]" | 198 href$="[[_taskLink(task.deduped_from)]]" |
| 199 target="_blank"> | 199 target="_blank"> |
| 200 [[_column('deduped_from',task)]] | 200 [[_column('deduped_from',task)]] |
| 201 </a> | 201 </a> |
| 202 </td> | 202 </td> |
| 203 | 203 |
| 204 <td hidden$="[[_hide('sk_revision', _columns.*)]]"> | 204 <td hidden$="[[_hide('source_revision', _columns.*)]]"> |
| 205 <a | 205 <a |
| 206 class="center" | 206 class="center" |
| 207 href$="[[_skLink(task)]]" | 207 href$="[[_sourceLink(task)]]" |
| 208 target="_blank"> | 208 target="_blank"> |
| 209 [[_column('sk_revision',task)]] | 209 [[_column('source_revision',task)]] |
| 210 </a> | 210 </a> |
| 211 </td> | 211 </td> |
| 212 | 212 |
| 213 <template | 213 <template |
| 214 is="dom-repeat" | 214 is="dom-repeat" |
| 215 items="[[_plainColumns]]" | 215 items="[[_plainColumns]]" |
| 216 as="c"> | 216 as="c"> |
| 217 <td hidden$="[[_hide(c)]]"> | 217 <td hidden$="[[_hide(c)]]"> |
| 218 [[_column(c, task)]] | 218 [[_column(c, task)]] |
| 219 </td> | 219 </td> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 241 <paper-button dialog-dismiss autofocus>No</paper-button> | 241 <paper-button dialog-dismiss autofocus>No</paper-button> |
| 242 <paper-button dialog-confirm>Yes</paper-button> | 242 <paper-button dialog-confirm>Yes</paper-button> |
| 243 </div> | 243 </div> |
| 244 </paper-dialog> | 244 </paper-dialog> |
| 245 | 245 |
| 246 <error-toast></error-toast> | 246 <error-toast></error-toast> |
| 247 | 247 |
| 248 </template> | 248 </template> |
| 249 <script> | 249 <script> |
| 250 (function(){ | 250 (function(){ |
| 251 var specialColumns = ["deduped_from", "name", "state", "bot"]; | 251 var specialColumns = ["deduped_from", "name", "state", "bot", "source_revisi
on"]; |
| 252 | 252 |
| 253 // Given a time attribute like "abandoned_ts", humanTime returns a function | 253 // Given a time attribute like "abandoned_ts", humanTime returns a function |
| 254 // that returns the human-friendly version of that attribute. The human | 254 // that returns the human-friendly version of that attribute. The human |
| 255 // friendly time was created in task-list-data. | 255 // friendly time was created in task-list-data. |
| 256 function humanTime(attr) { | 256 function humanTime(attr) { |
| 257 return function(task) { | 257 return function(task) { |
| 258 return this._attribute(task, "human_" + attr)[0]; | 258 return this._attribute(task, "human_" + attr)[0]; |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 var columnMap = { | 261 var columnMap = { |
| 262 abandoned_ts: humanTime("abandoned_ts"), | 262 abandoned_ts: humanTime("abandoned_ts"), |
| 263 bot: function(task) { | 263 bot: function(task) { |
| 264 return this._attribute(task, "bot_id")[0]; | 264 return this._attribute(task, "bot_id")[0]; |
| 265 }, | 265 }, |
| 266 completed_ts: humanTime("completed_ts"), | 266 completed_ts: humanTime("completed_ts"), |
| 267 costs_usd: function(task) { | 267 costs_usd: function(task) { |
| 268 return this._attribute(task, "costs_usd", 0)[0]; | 268 return this._attribute(task, "costs_usd", 0)[0]; |
| 269 }, | 269 }, |
| 270 created_ts: humanTime("created_ts"), | 270 created_ts: humanTime("created_ts"), |
| 271 duration: humanTime("duration"), | 271 duration: humanTime("duration"), |
| 272 modified_ts: humanTime("modified_ts"), | 272 modified_ts: humanTime("modified_ts"), |
| 273 sk_revision: function(task) { | 273 source_revision: function(task) { |
| 274 var r = this._attribute(task, "sk_revision")[0]; | 274 var r = this._attribute(task, "source_revision")[0]; |
| 275 return r.substring(0,8); | 275 return r.substring(0,8); |
| 276 }, | 276 }, |
| 277 started_ts: humanTime("started_ts"), | 277 started_ts: humanTime("started_ts"), |
| 278 state: function(task) { | 278 state: function(task) { |
| 279 var state = this._attribute(task, "state")[0]; | 279 var state = this._attribute(task, "state")[0]; |
| 280 if (state === "COMPLETED") { | 280 if (state === "COMPLETED") { |
| 281 | 281 |
| 282 if (this._attribute(task, "failure", false)[0]) { | 282 if (this._attribute(task, "failure", false)[0]) { |
| 283 return "COMPLETED (FAILURE)"; | 283 return "COMPLETED (FAILURE)"; |
| 284 } | 284 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 }, | 415 }, |
| 416 | 416 |
| 417 reload: function() { | 417 reload: function() { |
| 418 if (!this._auth_headers || !this._query_params) { | 418 if (!this._auth_headers || !this._query_params) { |
| 419 return; | 419 return; |
| 420 } | 420 } |
| 421 var url = "/_ah/api/swarming/v1/tasks/list?" + sk.query.fromParamSet(thi
s._query_params); | 421 var url = "/_ah/api/swarming/v1/tasks/list?" + sk.query.fromParamSet(thi
s._query_params); |
| 422 this.$.page_tasks.load(url,this._auth_headers); | 422 this.$.page_tasks.load(url,this._auth_headers); |
| 423 }, | 423 }, |
| 424 | 424 |
| 425 _skLink: function(task) { | 425 _sourceLink: function(task) { |
| 426 var r = this._attribute(task, "sk_revision")[0]; | 426 var rev = this._attribute(task, "source_revision")[0]; |
| 427 if (r === "none") { | 427 var repo = this._attribute(task, "source_repo")[0]; |
| 428 if (rev === "none" || repo === "none") { |
| 428 return false; | 429 return false; |
| 429 } | 430 } |
| 430 return "https://skia.googlesource.com/skia/+/" + r; | 431 return repo.replace("%s", rev); |
| 431 }, | 432 }, |
| 432 | 433 |
| 433 _tag: function(task, col) { | 434 _tag: function(task, col) { |
| 434 if (!task || !task.tagMap) { | 435 if (!task || !task.tagMap) { |
| 435 return undefined; | 436 return undefined; |
| 436 } | 437 } |
| 437 return task.tagMap[col]; | 438 return task.tagMap[col]; |
| 438 }, | 439 }, |
| 439 | 440 |
| 440 _taskClass: function(task) { | 441 _taskClass: function(task) { |
| 441 return this.stateClass(this._column("state", task)); | 442 return this.stateClass(this._column("state", task)); |
| 442 } | 443 } |
| 443 }); | 444 }); |
| 444 })(); | 445 })(); |
| 445 </script> | 446 </script> |
| 446 </dom-module> | 447 </dom-module> |
| OLD | NEW |