Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: appengine/swarming/elements/res/imp/taskpage/task-page.html

Issue 2391583002: Several small changes to new UI pages (Closed) Base URL: git@github.com:luci/luci-py@uptime
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/swarming/elements/res/imp/tasklist/task-list.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 busy="[[_busy]]" 111 busy="[[_busy]]"
112 name="Swarming Task Page"> 112 name="Swarming Task Page">
113 113
114 <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> 114 <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2>
115 115
116 <div hidden$="[[_not(_signed_in)]]"> 116 <div hidden$="[[_not(_signed_in)]]">
117 117
118 <task-page-data 118 <task-page-data
119 id="data" 119 id="data"
120 auth_headers="[[_auth_headers]]" 120 auth_headers="[[_auth_headers]]"
121 refresh_interval="[[_refresh_interval]]"
122 task_id="[[task_id]]" 121 task_id="[[task_id]]"
123 122
124 busy="{{_busy}}" 123 busy="{{_busy}}"
125 request="{{_request}}" 124 request="{{_request}}"
126 result="{{_result}}" 125 result="{{_result}}"
127 stdout="{{_stdout}}"> 126 stdout="{{_stdout}}">
128 </task-page-data> 127 </task-page-data>
129 128
130 <div class="horizontal layout wrap"> 129 <div class="horizontal layout wrap">
131 <div class="left flex"> 130 <div class="left flex">
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 <paper-tabs selected="{{_show_raw}}" no-bar> 420 <paper-tabs selected="{{_show_raw}}" no-bar>
422 <paper-tab disabled$="[[_noMilo(_request)]]">Milo Output</pape r-tab> 421 <paper-tab disabled$="[[_noMilo(_request)]]">Milo Output</pape r-tab>
423 <paper-tab>Raw Output</paper-tab> 422 <paper-tab>Raw Output</paper-tab>
424 </paper-tabs> 423 </paper-tabs>
425 </div> 424 </div>
426 425
427 <paper-input 426 <paper-input
428 class="refresh_input" 427 class="refresh_input"
429 label="Refresh Interval (seconds)" 428 label="Refresh Interval (seconds)"
430 value="{{_refresh_interval}}" 429 value="{{_refresh_interval}}"
430 title="How often to refresh all information about the task"
431 auto-validate 431 auto-validate
432 min="1" 432 min="1"
433 max="1000" 433 max="1000"
434 pattern="[0-9]+"> 434 pattern="[0-9]+">
435 </paper-input> 435 </paper-input>
436 </div> 436 </div>
437 437
438 <template is="dom-if" if="[[_supportsMilo(_request,_show_raw)]]"> 438 <template is="dom-if" if="[[_supportsMilo(_request,_show_raw)]]">
439 <iframe id="miloFrame" class="milo tabbed" src$="[[_getMiloLink(mi lo_prefix,task_id)]]"></iframe> 439 <iframe id="miloFrame" class="milo tabbed" src$="[[_getMiloLink(mi lo_prefix,task_id)]]"></iframe>
440 </template> 440 </template>
441 <template is="dom-if" if="[[_show_raw]]"> 441 <template is="dom-if" if="[[_show_raw]]">
442 <div class="code stdout tabbed">[[_stdout]]</div> 442 <div class="code stdout tabbed">[[_stdout]]</div>
443 </template> 443 </template>
444 </div> 444 </div>
445 </div> 445 </div>
446 </div> 446 </div>
447 </swarming-app> 447 </swarming-app>
448 448
449 <paper-dialog id="prompt" modal on-iron-overlay-closed="_promptClosed"> 449 <paper-dialog id="prompt" modal on-iron-overlay-closed="_promptClosed">
450 <h2>Are you sure?</h2> 450 <h2>Are you sure?</h2>
451 <div>Are you sure you want to [[_dialogPrompt]]?</div> 451 <div>Are you sure you want to [[_dialogPrompt]]?</div>
452 <div class="buttons"> 452 <div class="buttons">
453 <paper-button dialog-dismiss autofocus>No</paper-button> 453 <paper-button dialog-dismiss autofocus>No</paper-button>
454 <paper-button dialog-confirm>Yes</paper-button> 454 <paper-button dialog-confirm>Yes</paper-button>
455 </div> 455 </div>
456 </paper-dialog> 456 </paper-dialog>
457 457
458 <error-toast></error-toast> 458 <error-toast></error-toast>
459 459
460 <interval-timer period="[[_refresh_interval]]" on-trigger="_refreshOutput"> 460 <interval-timer period="[[_refresh_interval]]" on-trigger="_softRefresh">
461 </interval-timer> 461 </interval-timer>
462 462
463 </template> 463 </template>
464 <script> 464 <script>
465 (function(){ 465 (function(){
466 Polymer({ 466 Polymer({
467 is: 'task-page', 467 is: 'task-page',
468 468
469 behaviors: [ 469 behaviors: [
470 SwarmingBehaviors.CommonBehavior, 470 SwarmingBehaviors.CommonBehavior,
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 _promptRetry: function() { 645 _promptRetry: function() {
646 this.set("_dialogPrompt", "retry task "+this.task_id); 646 this.set("_dialogPrompt", "retry task "+this.task_id);
647 this.$.prompt.open(); 647 this.$.prompt.open();
648 }, 648 },
649 649
650 _refresh: function() { 650 _refresh: function() {
651 this.$.data.reload(); 651 this.$.data.reload();
652 }, 652 },
653 653
654 _refreshOutput: function() {
655 this.$.data.reloadStdout();
656 var miloFrame = this.$$("iframe")
657 if (miloFrame) {
658 miloFrame.src = this._getMiloLink(this.milo_prefix,this.task_id);
659 }
660 },
661
662 _requestUpdated: function(request) { 654 _requestUpdated: function(request) {
663 if (this._noMilo(request)) { 655 if (this._noMilo(request)) {
664 this.set("_show_raw", 1); 656 this.set("_show_raw", 1);
665 } 657 }
666 }, 658 },
667 659
660 _softRefresh: function() {
661 if (this._result && this._result.state !== "RUNNING" &&
662 this._result.state !== "PENDING") {
663 console.log("Don't reload because not running");
664 return;
665 }
666 this.$.data.reload();
667 var miloFrame = this.$$("iframe")
668 if (miloFrame) {
669 miloFrame.src = this._getMiloLink(this.milo_prefix,this.task_id);
670 }
671 },
672
668 _retryTask: function() { 673 _retryTask: function() {
669 if (!this._request) { 674 if (!this._request) {
670 sk.errorMessage("Task not yet loaded", 3000); 675 sk.errorMessage("Task not yet loaded", 3000);
671 return; 676 return;
672 } 677 }
673 var newTask = { 678 var newTask = {
674 expiration_secs: this._request.expiration_secs, 679 expiration_secs: this._request.expiration_secs,
675 name: this._request.name +" (retry)", 680 name: this._request.name +" (retry)",
676 parent_task_id: this._request.parent_task_id, 681 parent_task_id: this._request.parent_task_id,
677 priority: this._request.priority, 682 priority: this._request.priority,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 return result && result.state !== this.PENDING && result.state !== this. CANCELED && result.state != this.EXPIRED; 742 return result && result.state !== this.PENDING && result.state !== this. CANCELED && result.state != this.EXPIRED;
738 }, 743 },
739 744
740 _wasNotPickedUp: function(result) { 745 _wasNotPickedUp: function(result) {
741 return result && !this._wasPickedUp(result); 746 return result && !this._wasPickedUp(result);
742 }, 747 },
743 }); 748 });
744 })(); 749 })();
745 </script> 750 </script>
746 </dom-module> 751 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/elements/res/imp/tasklist/task-list.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698