| 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 </paper-input> | 492 </paper-input> |
| 493 </div> | 493 </div> |
| 494 | 494 |
| 495 <template is="dom-if" if="[[_supportsMilo(_request,_show_raw)]]"> | 495 <template is="dom-if" if="[[_supportsMilo(_request,_show_raw)]]"> |
| 496 <div class="milo tabbed" hidden$="[[_isSummaryLink(task_id)]]"> | 496 <div class="milo tabbed" hidden$="[[_isSummaryLink(task_id)]]"> |
| 497 Milo results are only generated for task summaires, that is, tas
ks whose ids end in 0. Tasks ending in 1 or 2 represent possible retries of tas
ks. See <a href="//goo.gl/LE4rwV">the docs</a> for more. | 497 Milo results are only generated for task summaires, that is, tas
ks whose ids end in 0. Tasks ending in 1 or 2 represent possible retries of tas
ks. See <a href="//goo.gl/LE4rwV">the docs</a> for more. |
| 498 </div> | 498 </div> |
| 499 <iframe id="miloFrame" class="milo tabbed" src$="[[_getDisplayServ
erLink(_server_details.display_server_url_template,task_id)]]"></iframe> | 499 <iframe id="miloFrame" class="milo tabbed" src$="[[_getDisplayServ
erLink(_server_details.display_server_url_template,task_id)]]"></iframe> |
| 500 </template> | 500 </template> |
| 501 <template is="dom-if" if="[[_show_raw]]"> | 501 <template is="dom-if" if="[[_show_raw]]"> |
| 502 <div class="code stdout tabbed">[[_stdout]]</div> | 502 <div class="code stdout tabbed">[[_rawOutput(_stdout,_result)]]</d
iv> |
| 503 </template> | 503 </template> |
| 504 </div> | 504 </div> |
| 505 </div> | 505 </div> |
| 506 </div> | 506 </div> |
| 507 </swarming-app> | 507 </swarming-app> |
| 508 | 508 |
| 509 <paper-dialog id="prompt" modal on-iron-overlay-closed="_promptClosed"> | 509 <paper-dialog id="prompt" modal on-iron-overlay-closed="_promptClosed"> |
| 510 <h2>Are you sure?</h2> | 510 <h2>Are you sure?</h2> |
| 511 <div>Are you sure you want to [[_dialog_prompt]]?</div> | 511 <div>Are you sure you want to [[_dialog_prompt]]?</div> |
| 512 <div class="buttons"> | 512 <div class="buttons"> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 return packages; | 630 return packages; |
| 631 }, | 631 }, |
| 632 | 632 |
| 633 _disambiguate: function(taskId, result) { | 633 _disambiguate: function(taskId, result) { |
| 634 if (!taskId.endsWith("0") || !result) { | 634 if (!taskId.endsWith("0") || !result) { |
| 635 return false; | 635 return false; |
| 636 } | 636 } |
| 637 return result.try_number > 1; | 637 return result.try_number > 1; |
| 638 }, | 638 }, |
| 639 | 639 |
| 640 _empty: function(array) { |
| 641 return !array || array.length == 0; |
| 642 }, |
| 643 |
| 640 _expires: function(request) { | 644 _expires: function(request) { |
| 641 var delta = parseInt(request.expiration_secs); | 645 var delta = parseInt(request.expiration_secs); |
| 642 if (delta) { | 646 if (delta) { |
| 643 return sk.human.localeTime(new Date(request.created_ts.getTime() + del
ta * 1000)); | 647 return sk.human.localeTime(new Date(request.created_ts.getTime() + del
ta * 1000)); |
| 644 } | 648 } |
| 645 // Fall back to something | 649 // Fall back to something |
| 646 return request.expiration_secs + " seconds from created time"; | 650 return request.expiration_secs + " seconds from created time"; |
| 647 }, | 651 }, |
| 648 | 652 |
| 649 _extraArgs: function(request) { | 653 _extraArgs: function(request) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 _promptCancel: function() { | 720 _promptCancel: function() { |
| 717 this.set("_dialog_prompt", "cancel task "+this.task_id); | 721 this.set("_dialog_prompt", "cancel task "+this.task_id); |
| 718 this.$.prompt.open(); | 722 this.$.prompt.open(); |
| 719 }, | 723 }, |
| 720 | 724 |
| 721 _promptRetry: function() { | 725 _promptRetry: function() { |
| 722 this.set("_dialog_prompt", "retry task "+this.task_id); | 726 this.set("_dialog_prompt", "retry task "+this.task_id); |
| 723 this.$.prompt.open(); | 727 this.$.prompt.open(); |
| 724 }, | 728 }, |
| 725 | 729 |
| 730 _rawOutput: function(stdout, result) { |
| 731 if (stdout) { |
| 732 return stdout; |
| 733 } |
| 734 if (result.state === "PENDING" || result.state === "RUNNING") { |
| 735 return "[No output yet]"; |
| 736 } |
| 737 return "[No output received]"; |
| 738 }, |
| 739 |
| 726 _refresh: function() { | 740 _refresh: function() { |
| 727 this.$.data.reload(); | 741 this.$.data.reload(); |
| 728 }, | 742 }, |
| 729 | 743 |
| 730 _requestUpdated: function(request) { | 744 _requestUpdated: function(request) { |
| 731 if (this._noMilo(request)) { | 745 if (this._noMilo(request)) { |
| 732 this.set("_show_raw", 1); | 746 this.set("_show_raw", 1); |
| 733 } | 747 } |
| 734 }, | 748 }, |
| 735 | 749 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 console.log("Task could not be retried", e); | 785 console.log("Task could not be retried", e); |
| 772 } | 786 } |
| 773 ); | 787 ); |
| 774 }, | 788 }, |
| 775 | 789 |
| 776 _rowspan: function(dims) { | 790 _rowspan: function(dims) { |
| 777 dims = dims || []; | 791 dims = dims || []; |
| 778 return dims.length + 1; | 792 return dims.length + 1; |
| 779 }, | 793 }, |
| 780 | 794 |
| 781 _empty: function(array) { | |
| 782 return !array || array.length == 0; | |
| 783 }, | |
| 784 | |
| 785 _supportsMilo: function(request, showRaw) { | 795 _supportsMilo: function(request, showRaw) { |
| 786 return !showRaw && request && this._tag(request, "allow_milo"); | 796 return !showRaw && request && this._tag(request, "allow_milo"); |
| 787 }, | 797 }, |
| 788 | 798 |
| 789 | |
| 790 | |
| 791 _toggleDetails: function() { | 799 _toggleDetails: function() { |
| 792 this.set("_request_detail", !this._request_detail); | 800 this.set("_request_detail", !this._request_detail); |
| 793 }, | 801 }, |
| 794 | 802 |
| 795 _tag: function(result, col) { | 803 _tag: function(result, col) { |
| 796 if (!result || !result.tagMap) { | 804 if (!result || !result.tagMap) { |
| 797 return undefined; | 805 return undefined; |
| 798 } | 806 } |
| 799 return result.tagMap[col]; | 807 return result.tagMap[col]; |
| 800 }, | 808 }, |
| 801 | 809 |
| 802 _wasPickedUp: function(result) { | 810 _wasPickedUp: function(result) { |
| 803 return result && result.state !== this.PENDING && result.state !== this.
CANCELED && result.state != this.EXPIRED; | 811 return result && result.state !== this.PENDING && result.state !== this.
CANCELED && result.state != this.EXPIRED; |
| 804 }, | 812 }, |
| 805 | 813 |
| 806 _wasNotPickedUp: function(result) { | 814 _wasNotPickedUp: function(result) { |
| 807 return result && !this._wasPickedUp(result); | 815 return result && !this._wasPickedUp(result); |
| 808 }, | 816 }, |
| 809 }); | 817 }); |
| 810 })(); | 818 })(); |
| 811 </script> | 819 </script> |
| 812 </dom-module> | 820 </dom-module> |
| OLD | NEW |