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

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

Issue 2912393002: Add cost to task page (Closed)
Patch Set: Created 3 years, 6 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/ui/build/elements.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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 </tr> 484 </tr>
485 <tr> 485 <tr>
486 <td>Failure</td> 486 <td>Failure</td>
487 <td class$="[[_failureClass(_result.failure)]]">[[_result.fail ure]]</td> 487 <td class$="[[_failureClass(_result.failure)]]">[[_result.fail ure]]</td>
488 </tr> 488 </tr>
489 <tr> 489 <tr>
490 <td>Internal Failure</td> 490 <td>Internal Failure</td>
491 <td class$="[[_internalClass(_result.internal_failure)]]">[[_r esult.internal_failure]]</td> 491 <td class$="[[_internalClass(_result.internal_failure)]]">[[_r esult.internal_failure]]</td>
492 </tr> 492 </tr>
493 <tr> 493 <tr>
494 <td>Cost (USD)</td>
495 <td>$[[_cost(_result)]]</td>
496 </tr>
497 <tr>
494 <td>Isolated Outputs</td> 498 <td>Isolated Outputs</td>
495 <td> 499 <td>
496 <a href$="[[_isolateLink(_result.outputs_ref)]]"> 500 <a href$="[[_isolateLink(_result.outputs_ref)]]">
497 [[_result.outputs_ref.isolated]] 501 [[_result.outputs_ref.isolated]]
498 </a> 502 </a>
499 </td> 503 </td>
500 </tr> 504 </tr>
501 <tr> 505 <tr>
502 <td>Bot version</td> 506 <td>Bot version</td>
503 <td>[[_result.bot_version]]</td> 507 <td>[[_result.bot_version]]</td>
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 }, 798 },
795 799
796 _command: function(request) { 800 _command: function(request) {
797 if (!request || !request.properties) { 801 if (!request || !request.properties) {
798 return ""; 802 return "";
799 } 803 }
800 var args = request.properties.command || []; 804 var args = request.properties.command || [];
801 return args.join(" "); 805 return args.join(" ");
802 }, 806 },
803 807
808 _cost: function(result) {
809 if (!result || !result.costs_usd || !result.costs_usd.length) {
810 return 0;
811 }
812 return result.costs_usd[0].toFixed(4);
813 },
814
804 _disambiguate: function(taskId, result) { 815 _disambiguate: function(taskId, result) {
805 if (!taskId.endsWith("0") || !result) { 816 if (!taskId.endsWith("0") || !result) {
806 return false; 817 return false;
807 } 818 }
808 return result.try_number > 1; 819 return result.try_number > 1;
809 }, 820 },
810 821
811 _empty: function(array) { 822 _empty: function(array) {
812 return !array || array.length == 0; 823 return !array || array.length == 0;
813 }, 824 },
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", " _busyRunningCount", this._auth_headers, taskCountParams); 1064 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", " _busyRunningCount", this._auth_headers, taskCountParams);
1054 // change running to pending 1065 // change running to pending
1055 taskCountParams.state = ["PENDING"]; 1066 taskCountParams.state = ["PENDING"];
1056 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", " _busyPendingCount", this._auth_headers, taskCountParams); 1067 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", " _busyPendingCount", this._auth_headers, taskCountParams);
1057 } 1068 }
1058 } 1069 }
1059 }); 1070 });
1060 })(); 1071 })();
1061 </script> 1072 </script>
1062 </dom-module> 1073 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698