Chromium Code Reviews| 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.*)]]"> | |
| 140 <span>Skia Revision</span> | |
| 141 <sort-toggle | |
| 142 name="sk_revision" | |
| 143 current="[[_sort]]"> | |
| 144 </sort-toggle> | |
| 145 </th> | |
| 146 | |
| 139 <template | 147 <template |
| 140 is="dom-repeat" | 148 is="dom-repeat" |
| 141 items="[[_plainColumns]]" | 149 items="[[_plainColumns]]" |
| 142 as="c"> | 150 as="c"> |
| 143 <th hidden$="[[_hide(c)]]"> | 151 <th hidden$="[[_hide(c)]]"> |
| 144 <span>[[_header(c)]]</span> | 152 <span>[[_header(c)]]</span> |
| 145 <sort-toggle | 153 <sort-toggle |
| 146 name="[[c]]" | 154 name="[[c]]" |
| 147 current="[[_sort]]"> | 155 current="[[_sort]]"> |
| 148 </sort-toggle> | 156 </sort-toggle> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 </td> | 194 </td> |
| 187 <td hidden$="[[_hide('deduped_from', _columns.*)]]"> | 195 <td hidden$="[[_hide('deduped_from', _columns.*)]]"> |
| 188 <a | 196 <a |
| 189 class="center" | 197 class="center" |
| 190 href$="[[_taskLink(task.deduped_from)]]" | 198 href$="[[_taskLink(task.deduped_from)]]" |
| 191 target="_blank"> | 199 target="_blank"> |
| 192 [[_column('deduped_from',task)]] | 200 [[_column('deduped_from',task)]] |
| 193 </a> | 201 </a> |
| 194 </td> | 202 </td> |
| 195 | 203 |
| 204 <td hidden$="[[_hide('sk_revision', _columns.*)]]"> | |
| 205 <a | |
| 206 class="center" | |
| 207 href$="[[_skLink(task)]]" | |
| 208 target="_blank"> | |
| 209 [[_column('sk_revision',task)]] | |
| 210 </a> | |
| 211 </td> | |
| 212 | |
| 196 <template | 213 <template |
| 197 is="dom-repeat" | 214 is="dom-repeat" |
| 198 items="[[_plainColumns]]" | 215 items="[[_plainColumns]]" |
| 199 as="c"> | 216 as="c"> |
| 200 <td hidden$="[[_hide(c)]]"> | 217 <td hidden$="[[_hide(c)]]"> |
| 201 [[_column(c, task)]] | 218 [[_column(c, task)]] |
| 202 </td> | 219 </td> |
| 203 </template> | 220 </template> |
| 204 | 221 |
| 205 </tr> | 222 </tr> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 bot: function(task) { | 263 bot: function(task) { |
| 247 return this._attribute(task, "bot_id")[0]; | 264 return this._attribute(task, "bot_id")[0]; |
| 248 }, | 265 }, |
| 249 completed_ts: humanTime("completed_ts"), | 266 completed_ts: humanTime("completed_ts"), |
| 250 costs_usd: function(task) { | 267 costs_usd: function(task) { |
| 251 return this._attribute(task, "costs_usd", 0)[0]; | 268 return this._attribute(task, "costs_usd", 0)[0]; |
| 252 }, | 269 }, |
| 253 created_ts: humanTime("created_ts"), | 270 created_ts: humanTime("created_ts"), |
| 254 duration: humanTime("duration"), | 271 duration: humanTime("duration"), |
| 255 modified_ts: humanTime("modified_ts"), | 272 modified_ts: humanTime("modified_ts"), |
| 273 sk_revision: function(task) { | |
| 274 var r = this._attribute(task, "sk_revision")[0]; | |
| 275 return r.substring(0,8); | |
| 276 }, | |
| 256 started_ts: humanTime("started_ts"), | 277 started_ts: humanTime("started_ts"), |
| 257 state: function(task) { | 278 state: function(task) { |
| 258 var state = this._attribute(task, "state")[0]; | 279 var state = this._attribute(task, "state")[0]; |
| 259 if (state === "COMPLETED") { | 280 if (state === "COMPLETED") { |
| 260 | 281 |
| 261 if (this._attribute(task, "failure", false)[0]) { | 282 if (this._attribute(task, "failure", false)[0]) { |
| 262 return "COMPLETED (FAILURE)"; | 283 return "COMPLETED (FAILURE)"; |
| 263 } | 284 } |
| 264 var tryNum = this._attribute(task, "try_number", "-1")[0]; | 285 var tryNum = this._attribute(task, "try_number", "-1")[0]; |
| 265 if (tryNum === "0") { | 286 if (tryNum === "0") { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 }, | 415 }, |
| 395 | 416 |
| 396 reload: function() { | 417 reload: function() { |
| 397 if (!this._auth_headers || !this._query_params) { | 418 if (!this._auth_headers || !this._query_params) { |
| 398 return; | 419 return; |
| 399 } | 420 } |
| 400 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); |
| 401 this.$.page_tasks.load(url,this._auth_headers); | 422 this.$.page_tasks.load(url,this._auth_headers); |
| 402 }, | 423 }, |
| 403 | 424 |
| 425 _skLink: function(task) { | |
| 426 var r = this._attribute(task, "sk_revision")[0]; | |
| 427 if (r === "none") { | |
| 428 return undefined; | |
|
stephana
2016/10/03 19:58:35
who not return empty string ?
kjlubick
2016/10/03 20:07:45
Empty string is a valid "href" and so the links ar
stephana
2016/10/04 13:24:32
Acknowledged.
| |
| 429 } | |
| 430 return "https://skia.googlesource.com/skia/+/" + r; | |
| 431 }, | |
| 432 | |
| 404 _tag: function(task, col) { | 433 _tag: function(task, col) { |
| 405 if (!task || !task.tagMap) { | 434 if (!task || !task.tagMap) { |
| 406 return undefined; | 435 return undefined; |
| 407 } | 436 } |
| 408 return task.tagMap[col]; | 437 return task.tagMap[col]; |
| 409 }, | 438 }, |
| 410 | 439 |
| 411 _taskClass: function(task) { | 440 _taskClass: function(task) { |
| 412 return this.stateClass(this._column("state", task)); | 441 return this.stateClass(this._column("state", task)); |
| 413 } | 442 } |
| 414 }); | 443 }); |
| 415 })(); | 444 })(); |
| 416 </script> | 445 </script> |
| 417 </dom-module> | 446 </dom-module> |
| OLD | NEW |