| 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> | 9 <task-page> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 --> | 25 --> |
| 26 | 26 |
| 27 <link rel="import" href="/res/imp/bower_components/iron-icon/iron-icon.html"> | 27 <link rel="import" href="/res/imp/bower_components/iron-icon/iron-icon.html"> |
| 28 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> | 28 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> |
| 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-checkbox/paper-checkbox
.html"> | 30 <link rel="import" href="/res/imp/bower_components/paper-checkbox/paper-checkbox
.html"> |
| 31 <link rel="import" href="/res/imp/bower_components/paper-dialog/paper-dialog.htm
l"> | 31 <link rel="import" href="/res/imp/bower_components/paper-dialog/paper-dialog.htm
l"> |
| 32 <link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html"
> | 32 <link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html"
> |
| 33 <link rel="import" href="/res/imp/bower_components/paper-tabs/paper-tabs.html"> | 33 <link rel="import" href="/res/imp/bower_components/paper-tabs/paper-tabs.html"> |
| 34 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> | 34 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> |
| 35 <link rel="import" href="/res/imp/bower_components/svg-piechart/svg-piechart.htm
l"> |
| 35 | 36 |
| 36 <link rel="import" href="/res/imp/common/common-behavior.html"> | 37 <link rel="import" href="/res/imp/common/common-behavior.html"> |
| 37 <link rel="import" href="/res/imp/common/interval-timer.html"> | 38 <link rel="import" href="/res/imp/common/interval-timer.html"> |
| 38 <link rel="import" href="/res/imp/common/single-page-style.html"> | 39 <link rel="import" href="/res/imp/common/single-page-style.html"> |
| 39 <link rel="import" href="/res/imp/common/swarming-app.html"> | 40 <link rel="import" href="/res/imp/common/swarming-app.html"> |
| 40 <link rel="import" href="/res/imp/common/task-behavior.html"> | 41 <link rel="import" href="/res/imp/common/task-behavior.html"> |
| 41 <link rel="import" href="/res/imp/common/url-param.html"> | 42 <link rel="import" href="/res/imp/common/url-param.html"> |
| 42 | 43 |
| 43 <link rel="import" href="task-page-data.html"> | 44 <link rel="import" href="task-page-data.html"> |
| 44 <link rel="import" href="task-retry-prompt.html"> | 45 <link rel="import" href="task-retry-prompt.html"> |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 <a | 249 <a |
| 249 title="The list of bots that matches the list of dimensi
ons" | 250 title="The list of bots that matches the list of dimensi
ons" |
| 250 href$="[[_botListLink(_request.properties.dimensions)]]"
>bots</a> | 251 href$="[[_botListLink(_request.properties.dimensions)]]"
>bots</a> |
| 251 can run this task | 252 can run this task |
| 252 (<span class$="[[_it(_bots_count.dead)]]">[[_bots_count.dead
]]</span> | 253 (<span class$="[[_it(_bots_count.dead)]]">[[_bots_count.dead
]]</span> |
| 253 dead, | 254 dead, |
| 254 <span class$="[[_it(_bots_count.dead)]]">[[_bots_count.quara
ntined]]</span> | 255 <span class$="[[_it(_bots_count.dead)]]">[[_bots_count.quara
ntined]]</span> |
| 255 quarantined) | 256 quarantined) |
| 256 </td> | 257 </td> |
| 257 </tr> | 258 </tr> |
| 258 <tr> | |
| 259 <td>Created</td> | |
| 260 <td title$="[[_request.created_ts]]">[[_request.human_created_
ts]]</td> | |
| 261 </tr> | |
| 262 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> | |
| 263 <tr> | |
| 264 <td>Started</td> | |
| 265 <td title$="[[_result.started_ts]]">[[_result.human_started_
ts]]</td> | |
| 266 </tr> | |
| 267 </template> | |
| 268 <template is="dom-if" if="[[_wasNotPickedUp(_result)]]"> | |
| 269 <tr> | |
| 270 <td>Expires</td> | |
| 271 <td>[[_expires(_request)]]</td> | |
| 272 </tr> | |
| 273 </template> | |
| 274 <template is="dom-if" if="[[_result.human_completed_ts]]"> | |
| 275 <tr> | |
| 276 <td>Completed</td> | |
| 277 <td title$="[[_result.completed_ts]]">[[_result.human_comple
ted_ts]]</td> | |
| 278 </tr> | |
| 279 </template> | |
| 280 <template is="dom-if" if="[[_result.human_abandoned_ts]]"> | |
| 281 <tr> | |
| 282 <td>Abandoned</td> | |
| 283 <td title$="[[_result.abandoned_ts]]">[[_result.human_abando
ned_ts]]</td> | |
| 284 </tr> | |
| 285 </template> | |
| 286 <tr> | |
| 287 <td>Last Updated</td> | |
| 288 <td title$="[[_result.modified_ts]]">[[_result.human_modified_
ts]]</td> | |
| 289 </tr> | |
| 290 <template is="dom-if" if="[[_result.deduped_from]]"> | 259 <template is="dom-if" if="[[_result.deduped_from]]"> |
| 291 <tr> | 260 <tr> |
| 292 <td><b>Deduped from</b></td> | 261 <td><b>Deduped from</b></td> |
| 293 <td> | 262 <td> |
| 294 <a href$="[[_taskLink(_result.deduped_from)]]"> | 263 <a href$="[[_taskLink(_result.deduped_from)]]"> |
| 295 [[_result.deduped_from]] | 264 [[_result.deduped_from]] |
| 296 </a> | 265 </a> |
| 297 </td> | 266 </td> |
| 298 </tr> | 267 </tr> |
| 299 </template> | 268 </template> |
| 300 <tr> | 269 <tr> |
| 301 <td>Pending Time</td> | |
| 302 <td>[[_pending(_result)]]</td> | |
| 303 </tr> | |
| 304 <tr> | |
| 305 <td>Duration</td> | |
| 306 <td>[[_result.human_duration]]</td> | |
| 307 </tr> | |
| 308 <tr> | |
| 309 <td>Priority</td> | 270 <td>Priority</td> |
| 310 <td>[[_request.priority]]</td> | 271 <td>[[_request.priority]]</td> |
| 311 </tr> | 272 </tr> |
| 312 <tr> | 273 <tr> |
| 313 <td>User</td> | 274 <td>User</td> |
| 314 <td>[[_request.user]]</td> | 275 <td>[[_request.user]]</td> |
| 315 </tr> | 276 </tr> |
| 316 <tr> | 277 <tr> |
| 317 <td>Authenticated</td> | 278 <td>Authenticated</td> |
| 318 <td>[[_request.authenticated]]</td> | 279 <td>[[_request.authenticated]]</td> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 </tr> | 431 </tr> |
| 471 <template is="dom-repeat" items="[[_request.properties.caches]]"
as="cache"> | 432 <template is="dom-repeat" items="[[_request.properties.caches]]"
as="cache"> |
| 472 <tr> | 433 <tr> |
| 473 <td><span>[[cache.name]]</span>:<span>[[cache.path]]</span><
/td> | 434 <td><span>[[cache.name]]</span>:<span>[[cache.path]]</span><
/td> |
| 474 </tr> | 435 </tr> |
| 475 </template> | 436 </template> |
| 476 | 437 |
| 477 </tbody> | 438 </tbody> |
| 478 </table> | 439 </table> |
| 479 | 440 |
| 441 <div class="title" hidden$="[[_not(_task_exists)]]">Task Timing Info
rmation</div> |
| 442 <div class="horizontal layout wrap"> |
| 443 <div class="left flex"> |
| 444 <table class="task-info" hidden$="[[_not(_task_exists)]]"> |
| 445 <tbody> |
| 446 <tr> |
| 447 <td>Created</td> |
| 448 <td title$="[[_request.created_ts]]">[[_request.human_crea
ted_ts]]</td> |
| 449 </tr> |
| 450 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> |
| 451 <tr> |
| 452 <td>Started</td> |
| 453 <td title$="[[_result.started_ts]]">[[_result.human_star
ted_ts]]</td> |
| 454 </tr> |
| 455 </template> |
| 456 <template is="dom-if" if="[[_wasNotPickedUp(_result)]]"> |
| 457 <tr> |
| 458 <td>Expires</td> |
| 459 <td>[[_expires(_request)]]</td> |
| 460 </tr> |
| 461 </template> |
| 462 <template is="dom-if" if="[[_result.human_completed_ts]]"> |
| 463 <tr> |
| 464 <td>Completed</td> |
| 465 <td title$="[[_result.completed_ts]]">[[_result.human_co
mpleted_ts]]</td> |
| 466 </tr> |
| 467 </template> |
| 468 <template is="dom-if" if="[[_result.human_abandoned_ts]]"> |
| 469 <tr> |
| 470 <td>Abandoned</td> |
| 471 <td title$="[[_result.abandoned_ts]]">[[_result.human_ab
andoned_ts]]</td> |
| 472 </tr> |
| 473 </template> |
| 474 <tr> |
| 475 <td>Last updated</td> |
| 476 <td title$="[[_result.modified_ts]]">[[_result.human_modif
ied_ts]]</td> |
| 477 </tr> |
| 478 <tr> |
| 479 <td>Pending Time</td> |
| 480 <td> |
| 481 <font color="#cc79a7">[[_pending(_result)]]</font> |
| 482 </td> |
| 483 </tr> |
| 484 <tr> |
| 485 <td>Duration</td> |
| 486 <td> |
| 487 <font color="#0072b2">[[_result.human_duration]]</font> |
| 488 </td> |
| 489 </tr> |
| 490 </tbody> |
| 491 </table> |
| 492 </div> |
| 493 <div class="right flex"> |
| 494 <template is="dom-if" if="[[_result.human_completed_ts]]"> |
| 495 <div class="left flex" style="padding-left: 50px; padding-righ
t: 50px"> |
| 496 <svg-piechart |
| 497 data="[[_computePiechartData(_result)]]" |
| 498 colors="["rgb(204,121,167)", "rgb(0,114,178
)"]"> |
| 499 </svg-piechart> |
| 500 </div> |
| 501 </template> |
| 502 </div> |
| 503 </div> |
| 504 |
| 480 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</
div> | 505 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</
div> |
| 481 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> | 506 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> |
| 482 <table hidden$="[[_not(_task_exists)]]"> | 507 <table hidden$="[[_not(_task_exists)]]"> |
| 483 <tr> | 508 <tr> |
| 484 <td>Bot assigned to task</td> | 509 <td>Bot assigned to task</td> |
| 485 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]
</td> | 510 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]
</td> |
| 486 </tr> | 511 </tr> |
| 487 <tr> | 512 <tr> |
| 488 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> | 513 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> |
| 489 <a>Bot Dimensions</a> | 514 <a>Bot Dimensions</a> |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 value: false, | 721 value: false, |
| 697 }, | 722 }, |
| 698 _busyPendingCount: { | 723 _busyPendingCount: { |
| 699 type: Boolean, | 724 type: Boolean, |
| 700 value: false, | 725 value: false, |
| 701 }, | 726 }, |
| 702 _busyBotCount: { | 727 _busyBotCount: { |
| 703 type: Boolean, | 728 type: Boolean, |
| 704 value: false, | 729 value: false, |
| 705 }, | 730 }, |
| 731 |
| 706 _dialog_prompt: { | 732 _dialog_prompt: { |
| 707 type: String, | 733 type: String, |
| 708 value: "", | 734 value: "", |
| 709 }, | 735 }, |
| 710 _host_url: { | 736 _host_url: { |
| 711 type: String, | 737 type: String, |
| 712 value: function(){ | 738 value: function(){ |
| 713 return window.location.hostname; | 739 return window.location.hostname; |
| 714 } | 740 } |
| 715 }, | 741 }, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 }, | 889 }, |
| 864 | 890 |
| 865 _command: function(request) { | 891 _command: function(request) { |
| 866 if (!request || !request.properties) { | 892 if (!request || !request.properties) { |
| 867 return ""; | 893 return ""; |
| 868 } | 894 } |
| 869 var args = request.properties.command || []; | 895 var args = request.properties.command || []; |
| 870 return args.join(" "); | 896 return args.join(" "); |
| 871 }, | 897 }, |
| 872 | 898 |
| 899 _computePiechartData: function(result) { |
| 900 var created = result.created_ts; |
| 901 var started = result.started_ts; |
| 902 var completed = result.completed_ts; |
| 903 return [ |
| 904 this._duration(created, started), |
| 905 this._duration(started, completed)]; |
| 906 }, |
| 907 |
| 873 _cost: function(result) { | 908 _cost: function(result) { |
| 874 if (!result || !result.costs_usd || !result.costs_usd.length) { | 909 if (!result || !result.costs_usd || !result.costs_usd.length) { |
| 875 return 0; | 910 return 0; |
| 876 } | 911 } |
| 877 return result.costs_usd[0].toFixed(4); | 912 return result.costs_usd[0].toFixed(4); |
| 878 }, | 913 }, |
| 879 | 914 |
| 880 _disambiguate: function(taskId, result) { | 915 _disambiguate: function(taskId, result) { |
| 881 if (!taskId.endsWith("0") || !result) { | 916 if (!taskId.endsWith("0") || !result) { |
| 882 return false; | 917 return false; |
| 883 } | 918 } |
| 884 return result.try_number > 1; | 919 return result.try_number > 1; |
| 885 }, | 920 }, |
| 886 | 921 |
| 922 _duration: function(start, end) { |
| 923 if (start.getTime() >= end.getTime()){ |
| 924 return 0; |
| 925 } |
| 926 return end.getTime() - start.getTime(); |
| 927 }, |
| 928 |
| 887 _empty: function(array) { | 929 _empty: function(array) { |
| 888 return !array || array.length == 0; | 930 return !array || array.length == 0; |
| 889 }, | 931 }, |
| 890 | 932 |
| 891 _eq: function(a,b) { | 933 _eq: function(a,b) { |
| 892 return a === b; | 934 return a === b; |
| 893 }, | 935 }, |
| 894 | 936 |
| 895 _expires: function(request) { | 937 _expires: function(request) { |
| 896 var delta = parseInt(request.expiration_secs); | 938 var delta = parseInt(request.expiration_secs); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 | 1175 |
| 1134 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", "_b
usyRunningCount", this._auth_headers, taskCountParams); | 1176 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", "_b
usyRunningCount", this._auth_headers, taskCountParams); |
| 1135 // change running to pending | 1177 // change running to pending |
| 1136 taskCountParams.state = ["PENDING"]; | 1178 taskCountParams.state = ["PENDING"]; |
| 1137 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", "_b
usyPendingCount", this._auth_headers, taskCountParams); | 1179 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", "_b
usyPendingCount", this._auth_headers, taskCountParams); |
| 1138 } | 1180 } |
| 1139 }); | 1181 }); |
| 1140 })(); | 1182 })(); |
| 1141 </script> | 1183 </script> |
| 1142 </dom-module> | 1184 </dom-module> |
| OLD | NEW |