| 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 16 matching lines...) Expand all Loading... |
| 27 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la
yout-classes.html"> | 27 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la
yout-classes.html"> |
| 28 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm
l"> | 28 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm
l"> |
| 29 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm
l"> | 29 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm
l"> |
| 30 <link rel="import" href="/res/imp/bower_components/paper-dialog/paper-dialog.htm
l"> | 30 <link rel="import" href="/res/imp/bower_components/paper-dialog/paper-dialog.htm
l"> |
| 31 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> | 31 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> |
| 32 | 32 |
| 33 <link rel="import" href="/res/imp/common/dynamic-table-behavior.html"> | 33 <link rel="import" href="/res/imp/common/dynamic-table-behavior.html"> |
| 34 <link rel="import" href="/res/imp/common/error-toast.html"> | 34 <link rel="import" href="/res/imp/common/error-toast.html"> |
| 35 <link rel="import" href="/res/imp/common/sort-toggle.html"> | 35 <link rel="import" href="/res/imp/common/sort-toggle.html"> |
| 36 <link rel="import" href="/res/imp/common/swarming-app.html"> | 36 <link rel="import" href="/res/imp/common/swarming-app.html"> |
| 37 <link rel="import" href="/res/imp/common/task-behavior.html"> |
| 37 <link rel="import" href="/res/imp/common/url-param.html"> | 38 <link rel="import" href="/res/imp/common/url-param.html"> |
| 38 | 39 |
| 39 <link rel="import" href="task-filters.html"> | 40 <link rel="import" href="task-filters.html"> |
| 40 <link rel="import" href="task-list-data.html"> | 41 <link rel="import" href="task-list-data.html"> |
| 41 | 42 |
| 42 <dom-module id="task-list"> | 43 <dom-module id="task-list"> |
| 43 <template> | 44 <template> |
| 44 <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-
style dynamic-table-style"> | 45 <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-
style dynamic-table-style task-style"> |
| 45 task-filters { | 46 task-filters { |
| 46 margin-bottom: 8px; | 47 margin-bottom: 8px; |
| 47 margin-right: 10px; | 48 margin-right: 10px; |
| 48 } | 49 } |
| 49 .task-list th > span { | 50 .task-list th > span { |
| 50 /* Leave space for sort-toggle*/ | 51 /* Leave space for sort-toggle*/ |
| 51 padding-right: 30px; | 52 padding-right: 30px; |
| 52 } | 53 } |
| 53 | |
| 54 /* These colors are from buildbot */ | |
| 55 .failed { | |
| 56 background-color: #ffdddd; | |
| 57 } | |
| 58 .died { | |
| 59 background-color: #cccccc; | |
| 60 } | |
| 61 .exception { | |
| 62 background-color: #edd2ff; | |
| 63 } | |
| 64 .pending { | |
| 65 background-color: #fffc6c; | |
| 66 } | |
| 67 </style> | 54 </style> |
| 68 | 55 |
| 69 <url-param name="sort" | 56 <url-param name="sort" |
| 70 value="{{_sortstr}}" | 57 value="{{_sortstr}}" |
| 71 default_value="created_ts:desc"> | 58 default_value="created_ts:desc"> |
| 72 </url-param> | 59 </url-param> |
| 73 | 60 |
| 74 <swarming-app | 61 <swarming-app |
| 75 client_id="[[client_id]]" | 62 client_id="[[client_id]]" |
| 76 auth_headers="{{_auth_headers}}" | 63 auth_headers="{{_auth_headers}}" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 created_ts: sortableTime("created_ts"), | 267 created_ts: sortableTime("created_ts"), |
| 281 duration: sortableTime("duration"), | 268 duration: sortableTime("duration"), |
| 282 modified_ts: sortableTime("modified_ts"), | 269 modified_ts: sortableTime("modified_ts"), |
| 283 started_ts: sortableTime("started_ts"), | 270 started_ts: sortableTime("started_ts"), |
| 284 }; | 271 }; |
| 285 | 272 |
| 286 Polymer({ | 273 Polymer({ |
| 287 is: 'task-list', | 274 is: 'task-list', |
| 288 behaviors: [ | 275 behaviors: [ |
| 289 SwarmingBehaviors.DynamicTableBehavior, | 276 SwarmingBehaviors.DynamicTableBehavior, |
| 277 SwarmingBehaviors.TaskBehavior, |
| 290 ], | 278 ], |
| 291 | 279 |
| 292 properties: { | 280 properties: { |
| 293 client_id: { | 281 client_id: { |
| 294 type: String, | 282 type: String, |
| 295 }, | 283 }, |
| 296 | 284 |
| 297 // The task id to cancel if the prompt is accepted. | 285 // The task id to cancel if the prompt is accepted. |
| 298 _toCancel: { | 286 _toCancel: { |
| 299 type: String, | 287 type: String, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 }, | 352 }, |
| 365 | 353 |
| 366 _tag: function(task, col) { | 354 _tag: function(task, col) { |
| 367 if (!task || !task.tagMap) { | 355 if (!task || !task.tagMap) { |
| 368 return undefined; | 356 return undefined; |
| 369 } | 357 } |
| 370 return task.tagMap[col]; | 358 return task.tagMap[col]; |
| 371 }, | 359 }, |
| 372 | 360 |
| 373 _taskClass: function(task) { | 361 _taskClass: function(task) { |
| 374 var state = this._column("state", task); | 362 return this.stateClass(this._column("state", task)); |
| 375 if (state === "CANCELED" ||state === "TIMED_OUT" || state === "EXPIRED")
{ | |
| 376 return "exception"; | |
| 377 } | |
| 378 if (state === "BOT_DIED") { | |
| 379 return "died"; | |
| 380 } | |
| 381 if (state === "COMPLETED (FAILURE)") { | |
| 382 return "failed"; | |
| 383 } | |
| 384 if (state === "RUNNING" || state === "PENDING") { | |
| 385 return "pending"; | |
| 386 } | |
| 387 return ""; | |
| 388 } | 363 } |
| 389 | |
| 390 }); | 364 }); |
| 391 })(); | 365 })(); |
| 392 </script> | 366 </script> |
| 393 </dom-module> | 367 </dom-module> |
| OLD | NEW |